kadnan
15
14
Laravel

Undefined Variable in partial view

Posted 2 years ago by kadnan

I am using Larvel 5.3.

I am passing variable in my view partial but in partial it says variable not found. I am doing following.

@include('partials._latest',['title' => 'Latest Products','entries' => $entries])

and in partial I am calling as {{$title}}

I am getting:

ErrorException in 4ffcd30ab3dcb337e74cecc7f61f71723f113d8f.php line 3:
Undefined variable: title (View:..

Please note that title is not being passed from Controller to parent View. It was only visible for partial view.

update

Code Repo is here: https://github.com/kadnan/simpleb2b

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.