Support the ongoing development of Laravel.io →
posted 10 years ago
Blade

http://stackoverflow.com/questions/25115720/undefined-variable-title-in-laravel

Yes, it´s works, but don´t exist most elegant method?

with laravel 4.1 just need:

public function index(){
    $this->layout->title = 'Index Title';
    return View::make('pages.index');
}

with laravel 4.2 must:

public function index(){
    $this->layout->title = 'Index Title';
    return View::make('pages.index')->with('title,$this->layout->title);
}

why?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

bigxu bigxu Joined 25 Feb 2014

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.

© 2025 Laravel.io - All rights reserved.