Support the ongoing development of Laravel.io →
Views Blade Architecture
Last updated 1 month ago.
0

Read these two pages and I think you'll be more familiar with the api. If you're practicing with it, as you mentioned, I suggest first using it in the standard way.

http://laravel.com/docs/responses

http://laravel.com/docs/templates

Last updated 1 month ago.
0

Yeah I also found that it bit retarded. The short answer is that's just how it works.

I ended using the default controller to deal with the problem and sett all the default stuff that was in my view

class BaseController extends Controller {

	/**
	 * Setup the layout used by the controller.
	 *
	 * @return void
	 */

	// By default overide to use  layouts.main

	protected $layout = 'layouts.main';


	protected function setupLayout() {
		if ( ! is_null( $this->layout ) ) {
			$this->layout = View::make( $this->layout );
		}
		// Default Layout configuration
		$this->layout->title =  'default title';
		$this->layout->header = View::make( 'home.header' );
		$this->layout->nav = View::make( 'home.nav' );

	}

}

Last updated 1 month ago.
0

AnthonyVipond said:

Read these two pages and I think you'll be more familiar with the api. If you're practicing with it, as you mentioned, I suggest first using it in the standard way.

http://laravel.com/docs/responses

http://laravel.com/docs/templates

Last updated 1 month ago.
0

AnthonyVipond said:

Read these two pages and I think you'll be more familiar with the api. If you're practicing with it, as you mentioned, I suggest first using it in the standard way.

http://laravel.com/docs/responses

http://laravel.com/docs/templates

As an newbie, only thing we could do is Google and check documents when not as expect, unfortunate, answer is so hard to get if not lucky enough that someone has exactly same scenario.
In my case, I do follow your suggestion to read those papers but still no clue why the second code not working? what is their difference?
By the way, I download many your tutorials, pretty good, hopefully I could integrated these skills into my own project soon. Thanks.

Last updated 1 month ago.
0

If you are trying to use

return View::make('admin.todo.index',compact('var')); 

Then your ...admin/todo/index.blade.php should be :

@extends('admin.layouts.default')

@section('content')
...
@stop

Last updated 1 month ago.
0

mcraz said:

If you are trying to use

return View::make('admin.todo.index',compact('var')); 

Then your ...admin/todo/index.blade.php should be :

@extends('admin.layouts.default')

@section('content')
...
@stop

Mcraz, thanks, it work, now I have some idea what this 2 methods work. One more question, why

{{$var->links()}}

get me only Page Bar but no summary message like Showing 1 to 2 of 2 entries? Such message seems should came with paginate? Again, I follow tutorial but missing this Summary message, no clue after I Google the web.

Last updated 1 month ago.
0

Sign in to participate in this thread!

LaraJobs

Your banner here too?

jack6800 jack6800 jack6800 Joined 14 May 2014

Moderators

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

Your logo here?

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

© 2022 Laravel.io - All rights reserved.