ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Template library problem

December 15, 2010 4:30pm

Subscribe [1]
  • #1 / Dec 15, 2010 4:30pm

    eggzy

    30 posts

    I’m using template library but I have a problem displaying the data.

    I have my admin controller:

    class Admin_Controller extends MY_Controller {
        
        function Admin_Controller() {
            
            parent::__construct();
            
            // Setup template output
            $this->template->set_layout('default', 'admin')
                            ->enable_parser(FALSE)
                            
                            ->set_partial('header', 'admin/partials/header')
                            ->set_partial('navigation', 'admin/partials/navigation')
                            ->set_partial('footer', 'admin/partials/footer');
            
        }
        
    }

    There I setup default layout I want to use in admin area (in views/admin/layouts/default.php)

    And I have admin controller:

    class Admin extends Admin_Controller {
    
        function __construct() {
            parent::__construct();
        }
        
        function index() {
            
            $this->template->inject_partial('body', 'something similar…');
            
        }
    }

    So I want to have base controller that has admin layout and admin controllers to fill in the body content.

    But it only outputs blank page, I don’t know what I’m doing wrong.

  • #2 / Dec 16, 2010 3:35pm

    eggzy

    30 posts

    le bump

    anyone?

  • #3 / Dec 16, 2010 3:49pm

    WanWizard

    4475 posts

    blank pages are usually an indication of an error.

    Set error_reporting to E_ALL, and display_errors to On in php.ini, restart your webserver, and see if you get any errors.

  • #4 / Dec 16, 2010 3:59pm

    eggzy

    30 posts

    All error reporting turned on.
    I thought that views are empty but that’s not also.

  • #5 / Dec 16, 2010 4:40pm

    WanWizard

    4475 posts

    Where in your code do you generate the output? This is all template definition. I’m missing a

    $this->template->build('view_name', $data);
  • #6 / Dec 16, 2010 4:44pm

    eggzy

    30 posts

    ohhh, I feel like dumbass now.
    thanks for help

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases