-- Christian Sanchez <[EMAIL PROTECTED]> wrote
(on Tuesday, 08 July 2008, 03:19 PM -0500):
> Looking forward to use this :)
> Can you send a little glimpse on how to use this elements?
> Is it like any other zend_form_element?
> I know you're in active development of this elements, but it's just too good
> to
> wait for it :P
Patience... they're not quite ready to start testing with -- no unit
tests yet, and only the most cursory of sanity checks. Additionally, I
need to build some functionality to make it easy to Dojo-enable your
forms without needing to do a ton of these:
$form->addPrefixPath('Zend_Dojo_Form', 'Zend/Dojo/Form')
->addElementPrefixPath('Zend_Dojo_Form', 'Zend/Dojo/Form')
->addDisplayGroupPrefixPath('Zend_Dojo_Form', 'Zend/Dojo/Form');
That's just unwieldy. :)
Give me a day or so, and you'll get to play with it. It'll be worth the
wait. :)
> 2008/7/8 matthew <[EMAIL PROTECTED]>:
>
> Revision
> 9999
> Author
> matthew
> Date
> 2008-07-08 13:06:40 -0700 (Tue, 08 Jul 2008)
>
> Log Message
>
> [EMAIL PROTECTED]: matthew | 2008-07-08 16:06:29 -0400
> * Updated Form dijit helper to conform to standard Form view helper
> * Added DijitForm form decorator
>
> Modified Paths
>
> □ standard/incubator/library/Zend/Dojo/Form/Decorator/DijitContainer.php
> □ standard/incubator/library/Zend/Dojo/View/Helper/Form.php
> □ standard/incubator/tests/Zend/Dojo/View/Helper/FormTest.php
>
> Added Paths
>
> □ standard/incubator/library/Zend/Dojo/Form/Decorator/DijitForm.php
>
> Property Changed
>
> □ standard/
>
> Diff
>
> Property changes: standard
>
> Name: svk:merge
> - 33008bc5-088a-4725-8053-8b13bfceb19a:/local/framework/standard:20488
> + 33008bc5-088a-4725-8053-8b13bfceb19a:/local/framework/standard:20493
>
> Modified: standard/incubator/library/Zend/Dojo/Form/Decorator/
> DijitContainer.php (9998 => 9999)
>
> ---
> standard/incubator/library/Zend/Dojo/Form/Decorator/DijitContainer.php
> 2008-07-08 19:54:41 UTC (rev 9998)
> +++
> standard/incubator/library/Zend/Dojo/Form/Decorator/DijitContainer.php
> 2008-07-08 20:06:40 UTC (rev 9999)
> @@ -168,7 +168,7 @@
> }
>
> /**
> [DEL:- * Render a form
> :DEL][INS:+ * Render a dijit layout container
> :INS] *
> * Replaces $content entirely from currently set element.
> *
>
> Added: standard/incubator/library/Zend/Dojo/Form/Decorator/DijitForm.php
> (0
> => 9999)
>
> --- standard/incubator/library/Zend/Dojo/Form/Decorator/DijitForm.php
> (rev 0)
> +++ standard/incubator/library/Zend/Dojo/Form/Decorator/DijitForm.php
> 2008-07-08 20:06:40 UTC (rev 9999)
> @@ -0,0 +1,60 @@
> [INS:+<?php
> +/**
> + * Zend Framework
> + *
> + * LICENSE
> + *
> + * This source file is subject to the new BSD license that is bundled
> + * with this package in the file LICENSE.txt.
> + * It is also available through the world-wide-web at this URL:
> + * http://framework.zend.com/license/new-bsd
> + * If you did not receive a copy of the license and are unable to
> + * obtain it through the world-wide-web, please send an email
> + * to [EMAIL PROTECTED] so we can send you a copy immediately.
> + *
> + * @category Zend
> + * @package Zend_Form
> + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
> (http://www.zend.com)
> + * @license http://framework.zend.com/license/new-bsd New BSD
> License
> + */
> +
> +/** Zend_Dojo_Form_Decorator_DijitContainer */
> +require_once 'Zend/Dojo/Form/Decorator/DijitContainer.php';
> +
> +/**
> + * Zend_Dojo_Form_Decorator_DijitForm
> + *
> + * Render a dojo form dijit via a view helper
> + *
> + * Accepts the following options:
> + * - helper: the name of the view helper to use
> + *
> + * @package Zend_Dojo
> + * @subpackage Form_Decorator
> + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
> (http://www.zend.com)
> + * @license http://framework.zend.com/license/new-bsd New BSD
> License
> + * @version $Id: $
> + */
> +class Zend_Dojo_Form_Decorator_DijitForm extends
> Zend_Dojo_Form_Decorator_DijitContainer
> +{
> + /**
> + * Render a form
> + *
> + * Replaces $content entirely from currently set element.
> + *
> + * @param string $content
> + * @return string
> + */
> + public function render($content)
> + {
> + $element = $this->getElement();
> + $view = $form->getView();
> + if (null === $view) {
> + return $content;
> + }
> +
> + $attribs = $this->getOptions();
> +
> + return $view->form($element->getName(), $attribs, $content);
> + }
> +}
> :INS]Property changes on:
> standard/incubator/library/Zend/Dojo/Form/Decorator/DijitForm.php
> ___________________________________________________________________
> Name: svn:keywords
> + Id Author Date Rev
>
> Modified: standard/incubator/library/Zend/Dojo/View/Helper/Form.php (9998
> => 9999)
>
> --- standard/incubator/library/Zend/Dojo/View/Helper/Form.php
> 2008-07-08 19:54:41 UTC (rev 9998)
> +++ standard/incubator/library/Zend/Dojo/View/Helper/Form.php
> 2008-07-08 20:06:40 UTC (rev 9999)
> @@ -50,13 +50,21 @@
> * dijit.form.Form
> *
> * @param int $id
> [DEL:- * @param string $content
> - * @param array $attribs HTML attributes
> :DEL][INS:+ * @param null|array $attribs HTML attributes
> + * @param false|string $content
> :INS] * @return string
> */
> [DEL:- public function form($id, $content, array $attribs = array())
> :DEL][INS:+ public function form($id, $attribs = null, $content =
> false)
> :INS] {
> [INS:+ if (!is_array($attribs)) {
> + $attribs = (array) $attribs;
> + }
> :INS] $attribs['id'] = $id;
> [INS:+
> + if (false === $content) {
> + $content = '';
> + }
> +
> :INS] $attribs = $this->_prepareDijit($attribs, array(),
> 'layout');
>
> $html = '<form' . $this->_htmlAttribs($attribs) . '>'
>
> Modified: standard/incubator/tests/Zend/Dojo/View/Helper/FormTest.php
> (9998
> => 9999)
>
> --- standard/incubator/tests/Zend/Dojo/View/Helper/FormTest.php
> 2008-07-08 19:54:41 UTC (rev 9998)
> +++ standard/incubator/tests/Zend/Dojo/View/Helper/FormTest.php
> 2008-07-08 20:06:40 UTC (rev 9999)
> @@ -96,7 +96,7 @@
>
> public function getForm()
> {
> [DEL:- return $this->helper->form('myForm', '', array('action' =>
> '/foo'));
> :DEL][INS:+ return $this->helper->form('myForm', array('action' =>
> '/foo'), '');
> :INS] }
>
> public function testShouldAllowDeclarativeDijitCreation()
>
>
>
>
>
> --
> Christian S nchez A.
--
Matthew Weier O'Phinney
Software Architect | [EMAIL PROTECTED]
Zend Framework | http://framework.zend.com/