Actually, what you describe is exactly the intention. The idea that
Action Controller rendered view scripts can inject some dependencies
into the final layout. To be honest, I used my original headTitle() for
this, and I have not put the current headTitle() (in the incubator) into
production. Currently, I have only unit tested it, and am not sure how
it plays with the current Zend_Layout and view objects.
Ill play with this first thing in the morning and get back to you
though. In fact, I'll be putting alot of time this weekend into
Zend_Layout usage, as well as finishing (or at least attempting to
finish) whats left of the current head*() helpers.
-Ralph
Simon Mundy wrote:
Hey Ralph
I should have made that slightly clearer - I've been trying to use it as
a two-step process - the headTitle() is called from a view script and
the echo is called from a layout script. That's because all my view
scripts are code fragments and the layouts output the meta information,
scripts and styles all in the one place.
As I read your example, it relies on creating a unique object and then
referencing it to create the output. That, to me, seems a little
pointless as I'd almost never be outputting the title from within the
same view.
The generic 'placeholder()' helper uses a registry-style system to store
its data - was there any reason that the headTitle, headScript, etc.
series doesn't also follow this pattern? I'd find it far more useful to
collect script/style/meta data from within my views and then output it
all at once from a master layout template.
Was that the original intention?
Kind regards
Thats odd behavior. Are you all synced up with the incubator?
Here is a very stripped down simulation of your code, and it seems to
work for me:
[EMAIL PROTECTED] ~/zfdev/test-random $ cat headtitle.php
<?php
set_include_path(get_include_path() . PATH_SEPARATOR .
'../working-trunk/incubator/library/');
require_once 'Zend/View/Helper/HeadTitle.php';
$ht = new Zend_View_Helper_HeadTitle();
$ht->headTitle('my title');
?>
<?= $ht; ?>
[EMAIL PROTECTED] ~/zfdev/test-random $ php headtitle.php
<title>my title</title>
See if that works on your setup.
-ralph
Simon Mundy wrote:
Hi Matthew, Ralph
Could you please clarify the usage for the new placeholder helpers
like headTitle and headScript?
I can use the more generic placeholder like so:-
<? $this->placeholder('foo')->append('bar') ?>
...and call it from another script (like a layout or a partial) like
<?= $this->placeholder('foo') ?>
But when I try to do the following:-
<? $this->headTitle('foo') ?>
<?= $this->headTitle() ?>
...all I get is an empty <title></title> string. Am I using it the
right way?
Cheers
--
Simon Mundy | Director | PEPTOLAB
""" " "" """""" "" "" """"""" " "" """"" " """"" " """""" "" "
*Please support Movember today! Visit
http://www.movember.com/au/donate *
*Registration number for Simon 160725*
202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124
http://www.peptolab.com
--
Simon Mundy | Director | PEPTOLAB
""" " "" """""" "" "" """"""" " "" """"" " """"" " """""" "" "
*PeptoLab will be closed:*
*Saturday 15th December through until Monday 17th December *
*Saturday 22nd December through until Wednesday 2nd January*
*For urgent requests, please call 0438 046 061*
*
*
202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124
http://www.peptolab.com
--
Simon Mundy | Director | PEPTOLAB
""" " "" """""" "" "" """"""" " "" """"" " """"" " """""" "" "
*PeptoLab will be closed:*
*Saturday 15th December through until Monday 17th December *
*Saturday 22nd December through until Wednesday 2nd January*
*For urgent requests, please call 0438 046 061*
*
*
202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124
http://www.peptolab.com