Laravel_Theme_Bundle icon indicating copy to clipboard operation
Laravel_Theme_Bundle copied to clipboard

Documentation lists $theme->render() for rendering - parameter missing

Open judgej opened this issue 12 years ago • 1 comments

That statement as it appears in the documentation, results in an error. A parameter is required for this method.

The documentation also states $theme = IoC::resolve('Theme'); can be used in a controller. In this context, what is "Theme"? What does "Theme" do differently than "Foo" as that parameter.

Just as a side-note, I'm new to Laravel, and am finding the documentation all over the place does this - it says that you can call $Foo->Bar($Thing) and then usually fails to say what any of those things are or do or need to be.

judgej avatar Apr 29 '13 00:04 judgej

In the documentation, I have said instead of using View::make() method to prepare the views, we use the $theme->render() where parameters goes similar to View::make() method. I will put additional details in the docs to avoid the confusion.

For example if we use View::make('path/to/view',array('data'=>'something')); in order to use the theme to generate the view, we use have to use $theme->render(path/to/view',array('data'=>'something'));

To your next question about using Theme instance inside the controller, I have mentioned in the docs to use the Laravel IoC to resolve the instance of the $theme with its state in place. $theme = IoC::resolve('Theme'); will return the instance of the Theme class as an object to be used in the controller or any other place.

Hope this info helps.

raftalks avatar May 22 '13 10:05 raftalks