> That's about the long and short of it. I invite you to open a feature
> request to add this and attach it as a patch. :)
Will do!
Also, I think there should be a slight tweak to Zend_Dojo_View_Helper_Dijit:
protected function _prepareDijit(array $attribs, array $params,
$type, $dijit = null)
{
switch ($type) {
case 'layout':
$stripParams = array('id');
break;
case 'element':
$stripParams = array('id', 'name', 'value', 'type');
foreach (array('checked', 'disabled', 'readonly') as
$attrib) {
if (array_key_exists($attrib, $attribs)) {
if ($attribs[$attrib]) {
$attribs[$attrib] = $attrib;
} else {
unset($attribs[$attrib]);
}
}
}
break;
case 'textarea':
$stripParams = array('id', 'name', 'type');
break;
default:
/* ##### Add the following line so that the method still
works without notice/warning if $type is not explicitly accounted for
##### */
$stripParams = array();
}
foreach ($stripParams as $param) {
if (array_key_exists($param, $params)) {
unset($params[$param]);
}
}
...
}
Shall I patch that too?
Daniel
Matthew Weier O'Phinney wrote:
> -- Daniel Skinner <skinner@destiny-denied.co.uk> wrote
> (on Saturday, 18 October 2008, 07:04 PM +0100):
>
>> Ok. Tooltip should be quite simple. Take a look at one of the current dijit
>> implementations:
>>
>> class Zend_Dojo_View_Helper_Textarea extends Zend_Dojo_View_Helper_Dijit
>> {
>> protected $_dijit = 'dijit.form.Textarea';
>>
>> protected $_module = 'dijit.form.Textarea';
>>
>> public function textarea($id, $value = null, array $params = array(), array
>> $attribs = array())
>> {
>> ...
>> }
>> }
>>
>> So, with absolutely no pre-thought to if this will actually work, I would start
>> out with:
>>
>> class My_Dojo_View_Helper_Tooltip extends Zend_Dojo_View_Helper_Dijit
>> {
>> protected $_dijit = 'dijit.Tooltip';
>>
>> protected $_module = 'dijit.Tooltip';
>>
>> public function tooltip($id, $value = null, array $params = array(), array
>> $attribs = array())
>> {
>> $attribs = $this->_prepareDijit($attribs, $params, null);
>> /* Output div dojoType="dijit.Tooltip" markup here only if use
>> declarative */
>> }
>> }
>>
>
>
> That's about the long and short of it. I invite you to open a feature
> request to add this and attach it as a patch. :)
>
>
>
>> Steven wrote:
>>
>> I wasnt thinking of anything that ambitious - I don't really know alot
>> about JavaScript hence my interest in ZFs Dojo implementation.
>>
>> I was hoping to implement digit.tooltip, dojox.analytics - and maybe some
>> type of carousell.
>>
>> Steve
>>
>> On Sat, Oct 18, 2008 at 5:51 PM, Daniel Skinner <
>> skinner@destiny-denied.co.uk> wrote:
>>
>> What dijits are you looking to implement specifically?
>>
>> Take a look at Zend_Dojo_View_Helper_Dijit. This is the base class you
>> will be extending from.
>>
>> A few of us are in the early states of proposing dijit.Tree, dojo(X)
>> data stores and DnD components. Let us know if that compliments your
>> interests.
>>
>> Daniel
>>
>>
>> Steven wrote:
>>
>> Hi there,
>>
>> I'm not that familiar with Dojo but would like to implement View
>> Helpers for some of the other Dijits not currently included with ZF
>> - however the manual doesn't really outline the specifics for doing
>> so. Can anyone help me out?
>>
>> Cheers
>>
>> Steve
>>
>>
>>
>>
>>
>>
>
>
没有评论:
发表评论