2008年10月19日星期日

Re: [fw-mvc] Creating a Zend_Dojo_View_Helper

-- Daniel Skinner <skinner@destiny-denied.co.uk> wrote
(on Sunday, 19 October 2008, 10:43 PM +0100):
> Perhaps, and I have not thought this through at all, the programmatic syntax
> should use constructors instead of attaching attributes to DOM nodes. This
> would be fine for Tooltip except that the view helper would need to know in
> advance whether declarative mode is enabled or not (and this may change even
> after the helper is called). Also, even in programmatic mode the dijit form
> helpers must return markup.
>
> I will think about this further if I get some time.

I originally went down this path, but quickly ran into difficulties. The
current solution was actually suggested (and the original implementation
provided) by Peter Higgins of the Dojo project. The rationale is that
dojo.parser is actually somewhat "smarter" than doing instantiation,
particularly when you have nested dijits. The alternative requires a
fairly complex knowledge of the document structure, to ensure that
parent/child relationships are created in the correct order.

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

没有评论: