On 9/19/07, Joó Ádám <[EMAIL PROTECTED]> wrote:
> > Using the register would require that I have setup a view class
> > initially and then saved it.
>
> In your plugin you put the identity into a registry variable, then you
> just read it out in your view script. Easy, huh? :)
>
>

And just how would one access registry variables within the view
scripts, while maintaining logical/presentation separation. ;)

Using: $me = Zend_Registry::get('identity');
starts to mix the two.

However, my real problem is variables aren't getting set. As you see
from my test, I've also set a "this is a test" variable -- it's blank,
too.

On 9/19/07, Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote:
> You've got the order wrong. At dispatchLoopShutdown(), the action has
> already been performed, and the template already rendered -- the way you
> have it now, you're assigning variables to the view object, but then not
> rendering anything afterwards (index/index.phtml was rendered *before*
> this plugin action was ever invoked).
>
> Make the plugin operate at either dispatchLoopStartup() or preDispatch()
> (the first will be executed exactly once, the second during each
> iteration of the dispatch loop).

Okay, makes sense. So, let me make sure I get this. preDispatch() is
called every time an action is dispatched; majority of the time it'll
be called just once, but in cases where I use _forward() it'll get
called twice? But dispatchLoopStartup() is only called once in that
instance?

Either way, I moved all the code to the dispatchLoopStartup() and
changed the get to getStaticHelper (was getExistingHelper) and it's
still not working.

I also added a print statement to insure it's accessing that
condition, and it is. I get no values from either variables.


I also followed the examples in Zend_View() docs and it all fails
badly. Creating a new Zend_View() instance, assigning a variable and
calling render() -- Exception. Remove render() call -- no variable
data.

I found out I need to use $this->view->variable but that doesn't work
in the controller plugin either.

-- 
Philip
[EMAIL PROTECTED]
http://www.gpcentre.net/

Reply via email to