Welcome Guest, Not a member yet? Register   Sign In
Template Library Version 1.4.1. Need help
#1

[eluser]prashid[/eluser]
Hi,

I am new to CI and struggling to learn. I was checking Template Library Version 1.4.1 and downloaded it to use with CI 1.7.2.

Code:
Problem is template.php is loading but CONTENTS not filling. Below what I have done
  
   1.  /libraries/Template.php
      Move to your application /libraries/ folder.
   2. /config/template.php
      Move to your application /config/ folder.
   3. /views/template.php
      Move to your application /views/ folder.
      
    4. application/config/template.php //Added below code
      $template['default']['regions'] = array(
        'content',
        );
    5.application/views/basic.php //This code
    <strong>Name:</strong> &lt;?= $name ?&gt;
    6.application/views/fancy.php //This code
    <strong>Fancy Name:</strong> &lt;?= $name ?&gt;  
    7.application/views/template.php //This code
        &lt;html&gt;
           &lt;head&gt;
           &lt;/head&gt;
           &lt;body&gt;
                &lt;?= $content ?&gt;
           &lt;/body&gt;
        &lt;/html&gt;
    8.application/controller/basic.php //This code
    &lt;?php
        class Basic extends Controller {

            function Basic()
            {
                parent::Controller();
            }

            function index()
            {

            }

                function show_name()
                {
                   $this->load->library('template');

                   $data = array('name' => 'John');
                   $this->template->write('content', 'fancy', $data, 'basic');
                   $this->template->render();
                }
        }

    ?&gt;
    9. When I am trying to call show_name function using URL
    http://localhost/ci_test/index.php/basic/show_name
    
    I see in page view source below
    &lt;html&gt;
       &lt;head&gt;
       &lt;/head&gt;
       &lt;body&gt;
        &lt;?= $content ?&gt;
       &lt;/body&gt;
    &lt;/html&gt;
    
    CONTENT not filling.
    
    Any idea what is missing?


Messages In This Thread
Template Library Version 1.4.1. Need help - by El Forum - 09-06-2010, 08:43 PM
Template Library Version 1.4.1. Need help - by El Forum - 09-07-2010, 02:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB