I have this code in template blase:
@section('views', $post->views)
when i call the views from the template using this :
@yield('views')
It show the number of views.
Now i need to make this:
I need to add a php code to check the result of @yield('views') , if it is divided by 5 then do this , if not do that.
Thanks
you have that the wrong way around... in the base template you should have yield(views)
and in the other template using the base u do section(view...)
but i/we need more info on why u want to divide it by 5? is it to you want to display 5 divs in a row? and then ending that row.. & starting new one?
I need to add value to var:
if the views divide by 5 then var1 =xxxx and var2=yyyyy if not, then var1=cccc and var2=ddddd
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community