ZF-3841: Expand Zend_Dojo_Data to include custom parameters
Description
The dojo.data.QueryReadStore requires a "numRows" parameter of the data JSON block. While patching this particular parameter would be easy, it might be better to allow a user-expandable array for any parameters they might want to add. I have implemented such in my extension of this class.
<?php class Dojoplus_Data extends Zend_Dojo_Data { public $extra_params = array(); public function set_extra_param($pKey, $pValue){ $this->extra_params[$pKey] = $pValue; } public function get_extra_param($pKey){ if(isset($this->extra_params[$pKey])): return $this->extra_params[$pKey]; else: return NULL; endif; } public function toArray(){ return array_merge($this->extra_params, parent::toArray()); } } ?>
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2008-09-08T09:10:20.000+0000
Patch committed to trunk and 1.6 release branch. API is as follows: