Welcome Guest, Not a member yet? Register   Sign In
Template Lib/Parser question

Using Phil Sturgeons library for templating i have
     ->build('admin/clientlist', $data);
in my controller, so oif i wanted to say if clientlist template is used do this how would i acheive this?



This will be what i should write in my view file to say if the template is a specific page/template then do this else do this.

After a quick glance through the source, I don't see anything that passes the view name to the template content. You'd have to add that, either to your $data array, or modify the Template library to do it automatically.

My full controller
$total = $this->client_model->client_count();
  $per_pg = 20;
  $offset = $this->uri->segment(3);

  $config['base_url'] = $data['base'].'/admin/clientlist/';
  $config['total_rows'] = $total;
  $config['per_page'] = $per_pg;
  $config['full_tag_open'] = '<div id="pagination">';
  $config['full_tag_close'] = '</div>';
        $data['pagination'] = $this->pagination->create_links();
        $data['total_rows'] = $config['total_rows'];
  $data['show_from'] = $offset + 1;
  $data['show_to'] = $offset + $per_pg;
  if($data['show_to'] > $total) {
   $data['show_to'] = $total;
        $data['query'] = $this->client_model->get_all($per_pg,$offset);

   ->build('admin/clientlist', $data);

So now i need to know how to get in my view file, if the template is set to clientlist for example so this, else show this...

[eluser]Phil Sturgeon[/eluser]
     ->set('is_client_list', true)
     ->build('admin/clientlist', $data);


Gracias great one!

Thanks Phil

So would just do in view right:

?php if ($template['is_client_list'] == TRUE) { ?&gt;

blah blah

Theme © iAndrew 2016 - Forum software by © MyBB