Part of the EllisLab Network
   
22 of 24
22
Template Library Version 1.4.1
Posted: 10 November 2011 11:51 AM   [ Ignore ]   [ # 211 ]  
Grad Student
Avatar
Rank
Total Posts:  67
Joined  03-28-2007

Ok. Thank you.

Regards

 Signature 

Olio Extravergine

Profile
 
 
Posted: 14 November 2011 09:10 AM   [ Ignore ]   [ # 212 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  134
Joined  03-19-2007
daweb - 10 November 2011 11:21 AM

Is it still compatible with the last CI release? Anyone use it on production and last CI release?

Thank you

I’m using it with CI 2.0.3 and it works just fine.

 Signature 

I plan on being spontaneous tomorrow.

Profile
 
 
Posted: 07 December 2011 03:07 PM   [ Ignore ]   [ # 213 ]  
Summer Student
Total Posts:  4
Joined  11-10-2011

Hi,

Thanks everyone and specially the creator of the template. I am quite a newbie to Codeigniter and while using the template I am having this particular issue. I have searched the net a bit and this forum too and was unable to find a solution, so if any one can pinpoint me to it or provide me then I would be really greatfull:

$data->sizes $this->m_price->get_sizes();
$this->template->write_view('part4''parts/part4'$data);
var_dump($data); 

Now to showcase what the $data actually holds here is the result of the var_dump of the $data variable:

object(stdClass)#29 (1) { ["sizes"]=> array(26) { [0]=> object(stdClass)#34 (1) { ["actual_size"]=> string(1) "6" } [1]=> object(stdClass)#33 (1) { ["actual_size"]=> string(1) "8" } [2]=> object(stdClass)#35 (1) { ["actual_size"]=> string(2) "10" } [3]=> object(stdClass)#36 (1) { ["actual_size"]=> string(2) "12" } [4]=> object(stdClass)#37 (1) { ["actual_size"]=> string(2) "14" } [5]=> object(stdClass)#38 (1) { ["actual_size"]=> string(2) "16" } [6]=> object(stdClass)#39 (1) { ["actual_size"]=> string(2) "18" } [7]=> object(stdClass)#40 (1) { ["actual_size"]=> string(2) "20" } [8]=> object(stdClass)#41 (1) { ["actual_size"]=> string(2) "22" } [9]=> object(stdClass)#42 (1) { ["actual_size"]=> string(2) "24" } [10]=> object(stdClass)#43 (1) { ["actual_size"]=> string(2) "26" } [11]=> object(stdClass)#44 (1) { ["actual_size"]=> string(2) "28" } [12]=> object(stdClass)#45 (1) { ["actual_size"]=> string(2) "30" } [13]=> object(stdClass)#46 (1) { ["actual_size"]=> string(2) "32" } [14]=> object(stdClass)#47 (1) { ["actual_size"]=> string(2) "34" } [15]=> object(stdClass)#48 (1) { ["actual_size"]=> string(2) "36" } [16]=> object(stdClass)#49 (1) { ["actual_size"]=> string(2) "38" } [17]=> object(stdClass)#50 (1) { ["actual_size"]=> string(2) "40" } [18]=> object(stdClass)#51 (1) { ["actual_size"]=> string(2) "42" } [19]=> object(stdClass)#52 (1) { ["actual_size"]=> string(2) "44" } [20]=> object(stdClass)#53 (1) { ["actual_size"]=> string(2) "46" } [21]=> object(stdClass)#54 (1) { ["actual_size"]=> string(2) "48" } [22]=> object(stdClass)#55 (1) { ["actual_size"]=> string(2) "50" } [23]=> object(stdClass)#56 (1) { ["actual_size"]=> string(2) "52" } [24]=> object(stdClass)#57 (1) { ["actual_size"]=> string(2) "54" } [25]=> object(stdClass)#58 (1) { ["actual_size"]=> string(2) "56" } } } 


Now when I try to var_dump the same $data in the said view the result I get is NULL during bug_tracking.

I have tried it with simple data too, but the variable is not being passed on with the write_view and gives NULL in each case.

I am using codeigniter 2.0 and template 1.4 with codeigniter being on basic configuration. Let me know if I need to give some added information and what is it that I am doing wrong or missing.

Thanks in advance!! Any help would be greatly appreciated.

 

Profile
 
 
Posted: 07 December 2011 03:30 PM   [ Ignore ]   [ # 214 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  134
Joined  03-19-2007
Shreshtha - 07 December 2011 03:07 PM
$data->sizes $this->m_price->get_sizes();
$this->template->write_view('part4''parts/part4'$data);
var_dump($data); 

Try making $data an array instead of an object:

$data = array('sizes' => $this->m_price->get_sizes());
$this->template->write_view('part4''parts/part4'$data);
var_dump($data); 
 Signature 

I plan on being spontaneous tomorrow.

Profile
 
 
Posted: 07 December 2011 03:54 PM   [ Ignore ]   [ # 215 ]  
Summer Student
Total Posts:  4
Joined  11-10-2011

Thanks for the fast reply. With your suggestion this is what I did:

$canvasprices_data = array();
$canvasprices_data['sizes'$this->m_price->get_sizes();
$this->template->write_view('part4''parts/part4'$canvasprices_data);
var_dump($canvasprices_data); 

Result for the var_dump is similar with all the objectvalues being put in an array at a field [size], but again when I try var_dump it in the view to check what is the var that is being passed it is giving NULL.

Profile
 
 
Posted: 07 December 2011 03:56 PM   [ Ignore ]   [ # 216 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  134
Joined  03-19-2007

The view will have a variable called $sizes - not $canvasprices_data

 Signature 

I plan on being spontaneous tomorrow.

Profile
 
 
Posted: 07 December 2011 04:03 PM   [ Ignore ]   [ # 217 ]  
Summer Student
Total Posts:  4
Joined  11-10-2011

Thanks a lot for the reply it did the work!!  smile

Profile
 
 
Posted: 31 December 2011 03:35 PM   [ Ignore ]   [ # 218 ]  
Summer Student
Total Posts:  4
Joined  12-31-2011

Hi,
just started using CodeIgniter and downloaded the template library.
followed all the instructions and placed the files in the right places.

what i don’t get it how the template is being called ? im getting a 404 page not found.

i want to have a master template as the default website page.

should the routes.php have

$route['default_controller'"template"

?
should the libraries/Template.php be included in the autoload ?

should there be a template.php file in the controller folder ? if so what code should it have ?

what basic thing am i missing ?

Thanks

Profile
 
 
Posted: 09 February 2012 04:46 AM   [ Ignore ]   [ # 219 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2774
Joined  07-27-2006

Template is a library, not a controller. It has no URI callback. To understand libraries better, visit http://codeigniter.com/user_guide/general/libraries.html

 Signature 

Check out the Template Library
Oh yeah, I tweet, too (regarding CodeIgniter on occassion).

Profile
 
 
Posted: 19 February 2012 12:28 AM   [ Ignore ]   [ # 220 ]  
Summer Student
Total Posts:  7
Joined  06-29-2011

Fantastic library, very natural with CI, as it always should be with a plugin smile
I was amazed that I could keep lines like the one below in my views/template.php and it still all would work fine.

<?php $this->load->view('layout\header');?> 

So I implemented in 3 minutes. Great. One thing, I guess it’s just syntactic sugar smile but is it possible to make some changes to make method chaining possible?

For example if write_view returns $this, I can do something like the stuff below:

// Prepare template, filling up region "content" with people_view + data & render
$this->template->write_view('content''people_view',$data)
               ->
render(); 

 

Profile
 
 
   
22 of 24
22