2009年1月10日星期六

Re: [fw-mvc] Problem with $this->action()

If I might suggest an alternate approach.

Create two new View Helpers which retrieve the latest news/topics using the appropriate Models, and which render them to the correct templates (perhaps some Partials). This will allow you to bypass the Controller stack entirely and be more performant and reusable over time.
 
Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative



From: psil <calle.gunnarsson@gmail.com>
To: fw-mvc@lists.zend.com
Sent: Sunday, January 11, 2009 12:32:05 AM
Subject: [fw-mvc] Problem with $this->action()


Hello,

I have a little problem with the View Helper action()

I have a startpage on my site which have the five latest topics form my
forum and the five latest news

My startup page is the view script /index/index.phtml in my 'default' module

and when i use $this->action('index', 'index', 'news); to fetch the latest
news (News module, IndexController) it will render my default modules
index.phtml so it will be and endless loop.
I know why this happens, because i don't have the news module view script
dir in my path, but if i add it to my path it will be the same problem again
because the files have the same name. And when i try to add the forum
threads with $this->action('latest-topics', 'topic', 'forum'); it won't find
the view script either.

So my quiestion is, do anyone have a really smart sulution for this problem?

Sorry for my bad english by the way.
--
View this message in context: http://www.nabble.com/Problem-with-%24this-%3Eaction%28%29-tp21394676p21394676.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: