Support the ongoing development of Laravel.io →
posted 9 years ago
Blade
Last updated 2 years ago.
0

it means you should pass a variable called name to your view or do this:

<title>{{isset($name) ?  $name: ''}}</title>
0

thanks @beanmoss it stopped it from crashing. but do I ad another {{}} inside the quotes to make the name change dynamically? I want every story to have its own title. Just got your message. I'll experiment and see. But still thanks

0

The error you got is due to you did not pass $name variable to view Or you did spelling mistake while writing $name

you can see following code

$storyname = 'some name'; // you can pass dynamic name from here
View::make('story.show')->with('name',$storyname ) ;

If you are passing story model to view

$story = Story::find(1); 
View::make('story.show')->with('name',$story ) ;

Then In your view you must write like this

<title>{{$name->name}}</title>

You can't directly echo $name

Last updated 9 years ago.
0

Thanks I see the error in my ways

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.