« Return to Thread: View Partial from another action
Jack Sleight wrote:Unfortunately the wiki is down right now, but when it's back up check
out the Zend_View Enhanced proposal. It provides built in support for
partials, and you can call them simply with
$this->partial('controller/action');. There is a sample implementation
with the proposal, which I've been using for a while now with no
problems. In the meantime do a search on the mailing list for partials,
this has come up a number of times and there are a few solutions
floating about. The Http_Client method is completely unnecessary, and
yes, I would imagine there would be a major impact on performance
(though that is just my assumption).
Marko Korhonen wrote:
> I wanted to render some part of the page from some other action:
> {module/controller/action/params}.
>
> So I made following in my action:
>
> $link = 'http://ww.mydomain.com/module/controller/action/param1/value';
>
> $client = new Zend_Http_Client($link);
> $response = $client->request();
>
> // Initial content for my Ajax-driven partial in this view
> $this->view->partial_content_to_my_page = $response->getBody();
>
> I use that link as a Ajax source but I wanted to render initial view without
> Ajax. Only when this partial
> is updated by some user action, I will update it via Ajax.
>
>
> So my question is:
>
> Is this Zend_Http_Client usage in this case ok? What are the pros and cons
> in this approach?
> Does it take too much resources or something? Is it safe?
> Or can I do it some other way? Should I make some action helper which runs
> selected action and
> returns its rendered view to me?
>
>
>
> br, Marko
>
--
Jack
« Return to Thread: View Partial from another action
| Free embeddable forum powered by Nabble | Forum Help |