Hi guys,
i enable zend_layout in my application, there are four template files,
layout.phtml, header.phtml, index.phtml, footer.phtml ,to render.
layout.phtml is the layout template,and header.phtml and footer.phtml
rendered in layout.phtml,the code as following:
layout.phtml
-
Does this happen if you try to put the headScript() calls into your
view script itself and not in the action? Do you have error_reporting
set to E_ALL and do you notice anything such as a notice or a warning?
--
Chris Weldon
On Thu, Jan 29, 2009 at 4:24 AM, Michel Morelli wrote:
> Hi all. I have
Hi all. I have this piece of code:
public function formAction() {
$this->view->headScript()->appendFile('/js/myscripts.js');
$this->view->headScript()->appendFile('/js/jquery.tooltip.js');
$this->view->headScript()->appendFile('/js/jquery.dimensions2.js');
http://framework.zend.com/issues/browse/ZF-2403
This is signed as fixed but It's still not working at my case.
I'm doing in my layout $this->action('actName');
and then in actNameAction view script I use
$this->HeadScript()->appendFile(H.'media/js/search.js');
but that gives no effect in my hea
This view helper should fix it:
class My_View_Helper_HeadScript extends Zend_View_Helper_HeadScript
{
private $_scripts = array();
public function appendFile($path)
{
if (!in_array($path,$this->_scripts)) {
array_push($this
yes, you can make the call, but for things like that, you might be
interested in this usage case:
// from views (you'd be essentially over writing the file at that index.
// but this would be a application "Best practice" you'd decide for
// the whole project
$view->HeadScript()->offsetSetFile(-
dinok wrote:
Store the scripts in an array in the registry or in an action helper.
Remove duplicate keys / check before adding them (array_key_exists) and at
the end you render them with the helper (for example, build an
headScriptMultiple($myArray) viewHelper).
Thats a good suggestion. I'm h
Store the scripts in an array in the registry or in an action helper.
Remove duplicate keys / check before adding them (array_key_exists) and at
the end you render them with the helper (for example, build an
headScriptMultiple($myArray) viewHelper).
--
View this message in context:
http://www.na
I'm playing with the HeadScript placeholder in the incubator. I'm
creating forms elements specific to jQuery. I am wanting the form
element to add which files are need for the specific plugin. The
problem is if I have two different plugin on the same page there is a
repeat of loading the sam