Hello,
 
I've got myself a bit confused, maybe someone can clarify this for me.

Some background:

I've got variables in my actions that I would like to pass to my layout. 

Currently I'm doing this ...

In my actionController, ---> $this->view->noContentBorder = true;

In the view template for that action, --->
$this->placeholder('noContentBorder')->set($this->noContentBorder);

And then in the layout it's something like, --> if
(isset($this->noContentBorder) && $this->noContentBorder == true) {...

Ok, so I'm wanting to remove the place holder because there are a few views
that have only placeholders for forwarding them to the layout template.

I tried this in the actionController, -->
Zend_Layout::getMvcInstance()->assign('noContentBorder',true);

However, it doesn't seem to work ...

I looked at the assign function in the layout, simply put it assigned the
variable to an array...
-- $this->_container[$spec] = $value;

In the render function, the comments say - * assigns layout variables to
view,...

But, I do not see where the variables from the $this->_container are
assigned to the layout view that is rendered ... 

What am I missing ...

Terre

~ snip render function from zend/layout.php

/**
     * Render layout
     *
     * Sets internal script path as last path on script path stack, assigns 
     * layout variables to view, determines layout name using inflector, and

     * renders layout view script.
     *
     * $name will be passed to the inflector as the key 'script'.
     * 
     * @param  mixed $name 
     * @return mixed
     */ 
    public function render($name = null) 
    { 
        if (null === $name) {
            $name = $this->getLayout();
        }

        if ($this->inflectorEnabled() && (null !== ($inflector =
$this->getInflector())))
        {
            $name = $this->_inflector->filter(array('script' => $name));
        }

        $view = $this->getView();

        if (null !== ($path = $this->getViewScriptPath())) {
            if (method_exists($view, 'addScriptPath')) {
                $view->addScriptPath($path);
            } else {
                $view->setScriptPath($path);
            }
        } elseif (null !== ($path = $this->getViewBasePath())) {
            $view->addBasePath($path, $this->_viewBasePrefix);
        }

        return $view->render($name);
    }



Reply via email to