• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Layout Library Question

#1
[eluser]psylence[/eluser]
I found this Lib in the wiki HERE.

But anyway,
I wanna know how exactly to set up the controller file mentioned in that Wiki Page.
Ive read about controllers in the user-guide, but will admit to being a bit of a slow learner.

incase you dont wanna click the link...here's a quote from the wiki:
Quote:In Your Controller:

Place this in the Controllers Constructor:
$this->load->library('layout', 'layout_main');

Place this in the Controllers Methods:
$this->layout->view('/shop/view_cart', $data);

#2
[eluser]axle_foley00[/eluser]
Here's an example:

Code:
class Sample extends Controller
{
    function __construct()
    {
        parent::Controller();
        $this->load->library('layout', 'layout_main');
    }

    function index()
    {
        $data['page_title'] = 'View Shopping Cart';

        // Load data view into layout with extra data
        $this->layout->view('/shop/view_cart', $data);
    }
}

Hope that helps.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.