Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 为什么不是';这台Laravel控制器也能按我的要求工作吗?_Php_Laravel - Fatal编程技术网

Php 为什么不是';这台Laravel控制器也能按我的要求工作吗?

Php 为什么不是';这台Laravel控制器也能按我的要求工作吗?,php,laravel,Php,Laravel,如果数据库中没有要显示的组,我将尝试进行CSS编辑,因为如果“添加组”按钮下没有组,则该按钮没有底部边框。很抱歉,如果我完全弄错了,我对Laravel和PHP是新手 if(DB::table('forum_groups')->where('author_id')->first() >= 0) { echo(' <style type="text/css"> a.btn.btn-default {

如果数据库中没有要显示的组,我将尝试进行CSS编辑,因为如果“添加组”按钮下没有组,则该按钮没有底部边框。很抱歉,如果我完全弄错了,我对Laravel和PHP是新手

if(DB::table('forum_groups')->where('author_id')->first() >= 0) {
            echo('
            <style type="text/css">
            a.btn.btn-default {
                border-bottom-left-radius: 0;
                border-bottom-right-radius: 0;
                border-bottom: none;
            }
            </style>
            ');
} else {}

if(DB::table('forum_groups')->where('author_id')->first()>=0){
回声('
a、 btn.btn-default{
边框左下半径:0;
边框右下半径:0;
边框底部:无;
}
');
}else{}

而不是通过这种方式。。。您可以创建一个特殊的css类,并将其添加到您的标记中,您可以通过

return View::make(your.page)->with('value',$value)
在视图中,您只需检查示例

您的自定义css类似于

       .bottom_border {
            border-bottom-left-radius: 0;
            border-bottom-right-radius: 0;
            border-bottom: none;
        }
例如,在按钮中,您可以像

<button class="btn btn-default {{ !empty($value) ? 'bottom_border' : '' }}">add Group </button>
添加组
其中$value是您获取的组,如果上面存在组,则代码会将该类添加到标记中,否则不会


我希望这对你有帮助

尝试将对象与0进行比较,请不要这样做。在laracasts.com上看一些东西来帮助你开始,因为所有这些看起来都很糟糕。