Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-09-2008, 12:38 PM
Junior Member
 
Join Date: Jul 2008
Posts: 5
Default Adding content into partials

After following a few tutorials and books I am making my 1st attempt at making a ZF application.

What I am trying to do is add in the Year to my copyright notice into my footer.phtml that I am rendering as a partial in my default layout such as this :

© 2008 Company name

I have used Zend_Date to generate the year but how do I get the variable into a controller that will be used by the footer.phtml across all my default/frontend views ?

Any help appreciated, thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-09-2008, 04:23 PM
Member
 
Join Date: Jun 2008
Location: Florida
Posts: 76
Default

I don't understand exactly what the problem you're having is, but if I understand correctly, then you can just assign the value to a view variable:

Code:
$this->view->year = Zend_Date();
From within a controller:
Code:
echo $this->view->year;
From within a view script:
Code:
echo $this->year;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-09-2008, 07:21 PM
Junior Member
 
Join Date: Jul 2008
Posts: 5
Default

I have that bit I want to pass my date result to the footer.phtml that will appear with the front end layout (i.e. every page no matter the controller). I know how to write it into the pages for a specific controller just the global layout.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:36 PM.