2008年11月7日星期五

Re: [fw-mvc] Dojo form not working on placeholders in layout file

-- Zladivliba Voskuy <nospampam@hotmail.fr> wrote
(on Friday, 07 November 2008, 11:33 AM +0100):
> Hi everyone,
>
> I can't seem to get dojo to work on a placeholder located in my layout file.
> The form is a simple login form that works fine. However when I try to put it
> in the placeholder the form shows but without dojo applying to it.
> Here's an extract :
>
> This doesn't work, on my index.phtml :
>
> $login = new Login();
> $this->placeholder('loginbox')->set($login);
>
> Here's the target in my layout file :
> <?php echo $this->placeholder('loginbox'); ?>

$login is a form object. set() in the placeholders is expecting a
string. Cast the $login object to a string when you pass it:

$this->placeholder('loginbox')->set((string) $login);

// or
$this->placeholder('loginbox')->set($login->render());

> However this works fine in the index.phtml :
> $login = new Login();
> echo $login ;
>
> Any idea how do deal with this bug ?

--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/

没有评论:

发表评论