This error I am getting in Laravel. Can I know what exactly can be the issue. I have spent my full day into this.
Asked
Active
Viewed 1,560 times
0
-
Without seeing some code, we really can't do anything but *guess*. It just means that it hasn't been declared before you're trying to use it. – Qirel Feb 21 '16 at 13:04
-
Provide the code, please. – Roman Feb 21 '16 at 13:09
-
Please don't post images of code in your questions, post the code instead. – kebs Feb 21 '16 at 13:21
3 Answers
2
you should pass all your variables you use in view, if you use $title as a title for each page in your website you should pass it from your controller function to the view like this:
return View::make('home.index')->with('title', 'your title here');
and in your view you can make a condition to display public title to all pages don't have a title like this:
@if(isset($title)){{$title}} @else {{'Default title here'}} @endif

Gouda Elalfy
- 6,888
- 1
- 26
- 38
2
Check your Controller. If in controller variable $title is empty and you manipulate with it then you will get similar error.

Mindau
- 690
- 6
- 19
1
your $title
variable is null .
Make sure that $title
is not null
try this in your blade
@if(isset($title)){{$title}}@endif

paranoid
- 6,799
- 19
- 49
- 86