Welcome Guest, Not a member yet? Register   Sign In
Layout Library Question

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);

Here's an example:

class Sample extends Controller
    function __construct()
        $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.

Theme © iAndrew 2016 - Forum software by © MyBB