Hi,
i tried "echo $this->partial('user/show.phtml');" within a template.
That works fine so far - the show.phtml is rendered in my master
layout.phtml file.
But when i use "echo
$this->controller('show','user','default',array('param1'=>'value'));"
only the show.phtml file is rendered, the layout.phtml not.
Did i missed something?
Thanks, Jörg
Marko Korhonen schrieb:
> Thanks,
>
> I downloaded View helper named "controller" from Zend_View Enhanced SVN and
> now I can do my rendering with following easy call:
>
> echo $this->controller('action', 'controller', 'module', array('param1' =>
> 'value'));
>
> Cool!
>
> Thanks again Jack!
>
> br, Marko
>
>
>
> 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
>>
>>
>>
>
>