• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with Template/Cache Libraries that I wrote...

#1
[eluser]mlage[/eluser]
Hello everyone! I wanted to write a nifty template/cache engine for this framework (and of course, my personal use) and I have finished writing the first version of the code but every time I try to use it, I get blank pages sent to me without any PHP errors.

I have checked the configuration, PHP errors are set on. I'm running Apache2, PHP 5, the latest of most modules on an Apache Server on my personal Ubuntu machine at home...

Full Documentation and source code viewable here:
My Online Documentation

I have setup in the main config that personal libraries are "LAGE_". Session and the appropriate libraries in use are auto-loaded... I just don't get why I don't get errors from PHP... just a blank page... I was hoping someone with a fresh perspective could see what I easily did wrong and lead me in the right direction for debugging...

An example of the controller that gives me a blank page:
Code:
class Test extends Controller {

    private var $dData;
    private var $sData;
    
    //Constructor
    function Test()
    {
            parent::Controller();
            $this->dData = array()
            $this->sData = array();

            if ( $this->session->userdata('loggedIn') == TRUE)
            {    //Status: Logged In
                
                $this->sData = ( 'groupId' => 1 );
                $this->sData = ( 'username' => $this->session->userdata('username'));
                
            }
            else
            {
                $this->sData = ( 'groupId' => 0 );
                $this->sData = ( 'username' => "Guest"));
                $array_items = array('userId' => 0, 'username' => 'Guest', 'email' => '', 'loggedIn' => FALSE);
                $this->session->set_userdata($array_items);
            }
    }
    
    //Index Page
    function index() // index.php/home/index or index.php/home or index.php (since Home class is default Controller)
    {
        $CI->load->library( 'templater', "gh" );
        /*
            Skeleton
            {v:head}
                {d:pageTitle}
            {v:mainNav}
            {d:contentTitle}
            <p>Username: {s:username} - {d:authLink} (logout/login)</p>
            {d:contentData}
            {v:footer}
        */
            if ( $this->sData[groupId] > 0 ) //Logged In
            {
                //logout link array
                $this->dData = ( 'authLink' => "<a href='#'>Log Out</a>" );
            }
            else
            {
                $this->dData = ( 'authLink' => "<a href='#'>Log In</a>" );
            }
        $this->dData = ( 'pageTitle' => "LageCMS v0.0.4 SandBox" );
        $this->dData = ( 'contentTitle' => "h1 block - Lage" );
        $this->dData = ( 'contentData' => "<p>bla bla bla, content ... content... content...</p>" );
        
        $CI->templater->addData($this->dData);
        $CI->templater->makeTemplate( $sData );
        $CI->templater->output();
    }
}

File Structure:
LageCMS/index.php
LageCMS/system/application/libraries/ the two libraries
LageCMS/system/application/controllers/test.php
LageCMS/system/gh/ skeleton.html and all necessary views (footer.html, head.html, mainNav.html)

Does anyone know for some debugging techniques in CI? Like if I can setup "break" points with a debug class or something to analyze the data as it flows through the program? Any help is greatly appreciated!!!!


Messages In This Thread
Need help with Template/Cache Libraries that I wrote... - by El Forum - 07-31-2010, 03:02 PM
Need help with Template/Cache Libraries that I wrote... - by El Forum - 07-31-2010, 03:24 PM
Need help with Template/Cache Libraries that I wrote... - by El Forum - 07-31-2010, 03:59 PM
Need help with Template/Cache Libraries that I wrote... - by El Forum - 08-02-2010, 08:49 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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