Re: including an element in the head depending on which view I'm in

2006-06-29 Thread brandags

I don't know if this is the best solution, but I created a variable
called addHead, which I create in my view (or maybe I created it in
my app controller...? can't remember..), then use it in the layout.
Like so:

index.thtml:
?php $this-addHead .= 'This will go in the head section';?

layout.thtml:
head
?php if (isset($this-addHead)) echo $this-addHead;?
/head

If anyone has a better way, let it be heard!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: including an element in the head depending on which view I'm in

2006-06-29 Thread guillaume bordas
While you're in the snippet section, don't forget to grab the Util Helper, Head helper make use of it;)Head helper manual by example: 
http://rossoft.wordpress.com/2006/03/28/register-head-tags-from-helpers-2/Third comment, important one (rossoft, maybe it should be on the top of the article) : 

			3. rossoft - May 16, 2006			

			I've talked with Nao and __construct() works in PHP4.
Note for readers: Don't forget to include the HeadHelper in your
AppController, and put this in your HEAD section of your layout:
if (isset($head)) echo $head-print_registered();

			I just discovered it this morning, having a coffee and reading the mailing list, I was about to code a helper to do something like this.Thanks a lot Rossoft for saving our time ! :D
2006/6/29, Olivier Percebois-Garve [EMAIL PROTECTED]:
The head helper made by rossoft is probably the best way.brandags wrote: I don't know if this is the best solution, but I created a variable called addHead, which I create in my view (or maybe I created it in
 my app controller...? can't remember..), then use it in the layout. Like so: index.thtml: ?php $this-addHead .= 'This will go in the head section';? layout.thtml
: head ?php if (isset($this-addHead)) echo $this-addHead;? /head If anyone has a better way, let it be heard! 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: including an element in the head depending on which view I'm in

2006-06-29 Thread RosSoft

Thanks to all for using it :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: including an element in the head depending on which view I'm in

2006-06-29 Thread RosSoft

I talked to them and it's possible to see at core


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---