[Solar-talk] Re: [Solar-svn] Intersperse XHTML in a form

Antti Holvikari anttih at gmail.com
Fri Jan 11 12:30:22 CST 2008


On Dec 4, 2007 3:56 PM, Cruz, Darwin <Darwin.Cruz at gd-ais.com> wrote:

You posted your e-mail to the svn notifications list. Let's continue
the discussion at solar-talk :-)

> I'm trying to intersperse xhtml into a form i've created so i can format the
> form using css.  I'm using the example i have below in my view:
>
>             echo $this->form()
>                ->xhtml('<div name="foo">')
>                ->input($this->myForm->elements['user_email'])
>                ->xhtml('</div>')
>                ->fetch();
>
>
> I'm running into the following error though in my apache logs.  Can anyone
> help me understand what i'm doing wrong?:

The xhtml() call calls actually the formXhtml helper which is exactly
like any other form* helper in that it accpets an array of params. The
formXhtml helper grabs the XHTML from the 'value' key in the params
*and* you also need to give the element a name with the 'name' key. So
your call to ->xhtml() should be something like:

->xhtml(array('name' => 'xhtml', 'value' => '<div name="foo">'))

The error is 'ERR_NO_ELEMENT_TYPE' because you didn't give it a name.

Hope that helps :-)

-- 
Antti Holvikari


More information about the Solar-talk mailing list