Re: [fw-general] PHP Catchable fatal error: Argument 4 passed to Zend_Dojo_View_Helper_DateTextBox::dateTextBox() must be an array, null given in Zend/Dojo/View/Helper/DateTextBox.php on line 64
There should be a way to globally change the Zend_Form decorators and as well globally set/change the Dojo decorators (either with one method or two methods this could be done). Otherwise, if you have a form with 25 elements and all of them have, say something simple like directions added (the directions decorator) then you have to declare 5 or 6 lines of default decorators for each element. That's 5 x 25 = 125 extra lines of "default" looking code added to your poor extended Zend_Form class. My $.02, Eddie On Oct 12, 2008, at 11:14 AM, Matthew Weier O'Phinney wrote: -- Edward Haber <[EMAIL PROTECTED]> wrote (on Sunday, 12 October 2008, 08:48 AM -0400): I noticed this problem when using the normal Zend Form Element stack of decorators on a form a that a dijit element in it (specifically it was the DateTextBox). For example, I was trying to add Description decorators to my Zend_Dojo_Form. The form is a mix of regular Zend_Form elements and Dojo elements. If you put a global elements decorator declaration at the end of the element declarations like so: class forms_AdminArticleForm extends Zend_Dojo_Form { public function __construct($options = null) { parent::__construct($options); $this->setName('article_form') ->setAction(URL.'/admin/article/save') ->setMethod('post') ->addPrefixPath('MF_Form_Element', 'MF/Form/Element/', 'element') ->setAttrib('id', 'article-form'); ... declare some elements here ... $this->setElementDecorators(array( 'ViewHelper', Here's the problem right here. The Dijit form elements all use the DijitElement decorator as their base decorator. This is because the dijit view helpers have a different signature than other form view helpers (in order to accomodate a separation between dijit parameters and HTML attributes). Using setElementDecorators() on a mixture of Zend_Form and Zend_Dojo_Form elements is going to be problematic as a result. 'Description', 'Errors', array('HtmlTag', array('tag' => 'dd')), array('Label', array('tag' => 'dt')), )); } } It will trigger the exact error you mention. What I did was remove global decorators for the form and set decorators on a per element basis (only on the form elements that needed a description field). For Dojo elements, the decorator stack is slightly different: /** * creationdate */ $this->addElement('DateTextBox', 'creationdate', array( 'label' => 'Creation Date', 'description' => 'Leave blank for current date', 'decorators' => array( 'DijitElement', 'Description', 'Errors', array('HtmlTag', array('tag' => 'dd')), array('Label', array('tag' => 'dt')), ) )); This fixed the problem but I had that nagging feeling something deeper must not be right either with the way I was approach my form, something I hadn't included, or some problem with ZF. For one thing, it would be nice to be able to describe one set of element decorators for all the form elements at once (since Zend_Form and Zend_Dojo_Form are supposed to be someone interchangeable). Eddie On Oct 12, 2008, at 4:32 AM, Benjamin Eberlei wrote: On Sunday 12 October 2008 01:36:27 rswarthout wrote: When I try to use any Dojo enabled field I receive an error that just does not make any sense. PHP Catchable fatal error: Argument 4 passed to Zend_Dojo_View_Helper_DateTextBox::dateTextBox() must be an array, null given in Zend/Dojo/View/Helper/DateTextBox.php on line 64 Any insight would be greatly appreciated. Robert are you ultimately using the view helper or the form element? 1.) if using the view helper, you have to specify $this- dateTextBox($id, $value, array(), array()); if you want to pass no information to the attribs or dijit fields. $this->dateTextBox($id, $value, null, null); is not allowed 2.) if you are using Form: are you setting 'attribs' or 'dijitParams' => null in the configuration of the form element? this leads to the problem described above. you ahve to set it to => array() to explicity stating its emptiness. greetings Benjamin -- Benjamin Eberlei http://www.beberlei.de -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/
Re: [fw-general] PHP Catchable fatal error: Argument 4 passed to Zend_Dojo_View_Helper_DateTextBox::dateTextBox() must be an array, null given in Zend/Dojo/View/Helper/DateTextBox.php on line 64
-- Edward Haber <[EMAIL PROTECTED]> wrote (on Sunday, 12 October 2008, 08:48 AM -0400): > I noticed this problem when using the normal Zend Form Element stack of > decorators on a form a that a dijit element in it (specifically it was > the DateTextBox). For example, I was trying to add Description > decorators to my Zend_Dojo_Form. The form is a mix of regular Zend_Form > elements and Dojo elements. > > If you put a global elements decorator declaration at the end of the > element declarations like so: > > class forms_AdminArticleForm extends Zend_Dojo_Form > { > public function __construct($options = null) > { > parent::__construct($options); > > $this->setName('article_form') > ->setAction(URL.'/admin/article/save') > ->setMethod('post') > ->addPrefixPath('MF_Form_Element', 'MF/Form/Element/', > 'element') > ->setAttrib('id', 'article-form'); > > ... declare some elements here ... > > > $this->setElementDecorators(array( > 'ViewHelper', Here's the problem right here. The Dijit form elements all use the DijitElement decorator as their base decorator. This is because the dijit view helpers have a different signature than other form view helpers (in order to accomodate a separation between dijit parameters and HTML attributes). Using setElementDecorators() on a mixture of Zend_Form and Zend_Dojo_Form elements is going to be problematic as a result. > 'Description', > 'Errors', > array('HtmlTag', array('tag' => 'dd')), > array('Label', array('tag' => 'dt')), > )); > } > } > > It will trigger the exact error you mention. What I did was remove > global decorators for the form and set decorators on a per element basis > (only on the form elements that needed a description field). For Dojo > elements, the decorator stack is slightly different: > > > /** >* creationdate >*/ > $this->addElement('DateTextBox', 'creationdate', array( > 'label' => 'Creation Date', > 'description' => 'Leave blank for current date', > 'decorators' => array( > 'DijitElement', > 'Description', > 'Errors', > array('HtmlTag', array('tag' => 'dd')), > array('Label', array('tag' => 'dt')), > ) > )); > > This fixed the problem but I had that nagging feeling something deeper > must not be right either with the way I was approach my form, something I > hadn't included, or some problem with ZF. For one thing, it would be nice > to be able to describe one set of element decorators for all the form > elements at once (since Zend_Form and Zend_Dojo_Form are supposed to be > someone interchangeable). > > Eddie > > On Oct 12, 2008, at 4:32 AM, Benjamin Eberlei wrote: > >> On Sunday 12 October 2008 01:36:27 rswarthout wrote: >>> When I try to use any Dojo enabled field I receive an error that >>> just does >>> not make any sense. >>> >>> PHP Catchable fatal error: Argument 4 passed to >>> Zend_Dojo_View_Helper_DateTextBox::dateTextBox() must be an array, >>> null >>> given in Zend/Dojo/View/Helper/DateTextBox.php on line 64 >>> >>> Any insight would be greatly appreciated. >>> >>> Robert >> >> are you ultimately using the view helper or the form element? >> >> 1.) if using the view helper, you have to specify $this- >> >dateTextBox($id, >> $value, array(), array()); if you want to pass no information to the >> attribs >> or dijit fields. >> >> $this->dateTextBox($id, $value, null, null); is not allowed >> >> 2.) if you are using Form: are you setting 'attribs' or 'dijitParams' >> => null >> in the configuration of the form element? this leads to the problem >> described >> above. you ahve to set it to => array() to explicity stating its >> emptiness. >> >> greetings >> Benjamin >> >> -- >> Benjamin Eberlei >> http://www.beberlei.de > -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/
Re: [fw-general] zend dojo text area- how that work?
Hi, I'm having the same trouble. But you can use SHIFT + ENTER to get into a new row. -- View this message in context: http://www.nabble.com/zend-dojo-text-area--how-that-work--tp19498776p19941582.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Custom route loaded via Zend_Config not working
As per the docs, I have a custom route defined in my site config file: ; Custom routes routes.about.type = "Zend_Controller_Router_Route_Static" routes.about.route = "about" routes.about.defaults.controller = "index" routes.about.defaults.action = "about" Which I then load in the bootstrap file: // Custom Routes $router = new Zend_Controller_Router_Rewrite(); $router->addConfig($site_cfg, 'routes'); However, when I navigate to http://site/about, I get the following error: Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (about)' in... Can anybody shed some light on this? As far as I can tell, this is done exactly as specified in the docs, so I have no idea why it's not working. Cheers, -- Steven
Re: [fw-general] PHP Catchable fatal error: Argument 4 passed to Zend_Dojo_View_Helper_DateTextBox::dateTextBox() must be an array, null given in Zend/Dojo/View/Helper/DateTextBox.php on line 64
I noticed this problem when using the normal Zend Form Element stack of decorators on a form a that a dijit element in it (specifically it was the DateTextBox). For example, I was trying to add Description decorators to my Zend_Dojo_Form. The form is a mix of regular Zend_Form elements and Dojo elements. If you put a global elements decorator declaration at the end of the element declarations like so: class forms_AdminArticleForm extends Zend_Dojo_Form { public function __construct($options = null) { parent::__construct($options); $this->setName('article_form') ->setAction(URL.'/admin/article/save') ->setMethod('post') ->addPrefixPath('MF_Form_Element', 'MF/Form/Element/', 'element') ->setAttrib('id', 'article-form'); ... declare some elements here ... $this->setElementDecorators(array( 'ViewHelper', 'Description', 'Errors', array('HtmlTag', array('tag' => 'dd')), array('Label', array('tag' => 'dt')), )); } } It will trigger the exact error you mention. What I did was remove global decorators for the form and set decorators on a per element basis (only on the form elements that needed a description field). For Dojo elements, the decorator stack is slightly different: /** * creationdate */ $this->addElement('DateTextBox', 'creationdate', array( 'label' => 'Creation Date', 'description' => 'Leave blank for current date', 'decorators' => array( 'DijitElement', 'Description', 'Errors', array('HtmlTag', array('tag' => 'dd')), array('Label', array('tag' => 'dt')), ) )); This fixed the problem but I had that nagging feeling something deeper must not be right either with the way I was approach my form, something I hadn't included, or some problem with ZF. For one thing, it would be nice to be able to describe one set of element decorators for all the form elements at once (since Zend_Form and Zend_Dojo_Form are supposed to be someone interchangeable). Eddie On Oct 12, 2008, at 4:32 AM, Benjamin Eberlei wrote: On Sunday 12 October 2008 01:36:27 rswarthout wrote: When I try to use any Dojo enabled field I receive an error that just does not make any sense. PHP Catchable fatal error: Argument 4 passed to Zend_Dojo_View_Helper_DateTextBox::dateTextBox() must be an array, null given in Zend/Dojo/View/Helper/DateTextBox.php on line 64 Any insight would be greatly appreciated. Robert are you ultimately using the view helper or the form element? 1.) if using the view helper, you have to specify $this- >dateTextBox($id, $value, array(), array()); if you want to pass no information to the attribs or dijit fields. $this->dateTextBox($id, $value, null, null); is not allowed 2.) if you are using Form: are you setting 'attribs' or 'dijitParams' => null in the configuration of the form element? this leads to the problem described above. you ahve to set it to => array() to explicity stating its emptiness. greetings Benjamin -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Zend_File_Transfer Fatal error
Well, according to the manual and the API the method addValidators() (note the s for plural) is for adding multiple validators and needs an array as input. And the method addValidator() (note the missing s for singular) uses the notation you mentioned. Please read the manual and the examples and look in the API. Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com - Original Message - From: "cybershark" <[EMAIL PROTECTED]> To: Sent: Saturday, October 11, 2008 3:58 PM Subject: [fw-general] Zend_File_Transfer Fatal error Hi whatever I try I end up with the error below: Catchable fatal error: Argument 1 passed to Zend_File_Transfer_Adapter_Abstract::addValidators() must be an array, string given, called in F:\wwwroot\ultitecwww\admin\admin.php on line 174 and defined in F:\wwwroot\library\Zend\File\Transfer\Adapter\Abstract.php on line 333 I'm using 1.6.1, I'm not using the whole framework and I'm only using Zend_File_Transfer. $upload = new Zend_File_Transfer_Adapter_Http(); $upload->addValidators('Size', '250kB') ->addValidators('Count', 5) ->addValidators('FilesSize', '1MB') ->addValidators('Extension', 'gif, jpg, png') ->addValidators('ImageSize', array(10, 10, 1024, 768)) ->setDestination('C:/uploads'); if (!$upload->isValid()) { print_r($upload->getMessages()); die(); } try { $upload->receive(); } catch (Zend_File_Transfer_Exception $e) { $e->getMessage(); } -- View this message in context: http://www.nabble.com/Zend_File_Transfer-Fatal-error-tp19932788p19932788.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_Form - Description
I tried the following: $taElement = new Zend_Form_Element_Textarea('ta', array('required' => true, 'label' => 'Add a Comment')); $idElement = new Zend_Form_Element_Hidden('id', array('values' => $id)); $memberElement = new Zend_Form_Element_Hidden('member_id', array('values' => $this->member_id)); $buttonElement = new Zend_Form_Element_Image('button', array('src' => 'images/buttons/comment.png', 'value' => 'Add Comment')); $memberElement->removeDecorator('DtDdWrapper'); $idElement->removeDecorator('DtDdWrapper'); $buttonElement->removeDecorator('DtDdWrapper'); $frm->addElements(array($wallElement, $memberElement, $tattooElement, $buttonElement)); I also tried $idElement-> addDecorator('HtmlTag', array('tag' => 'dd'))->removeDecorator('DtDdWrapper'); The form still shows the dt's and dd's on all elements. Any other ideas on how to remove dt's and dd's from form elements? Holger Lampe wrote: > > I have a form element like this: > > > > $checkbox = new Zend_Form_Element_Checkbox('thecheckbox'); > > $checkbox->setDescription('do this'); > > > > And I want following result: > > > > value="1" > /> do this > > > > How do I achieve this? > > > > > > Another question. > > How do I remove the from Zend_Form_Element_Submit, > removeDecorator('label') doesn't seem to do the trick. > > > > Cheers, > > Holger > > > -- View this message in context: http://www.nabble.com/Zend_Form---Description-tp16103893p19939574.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] PHP Catchable fatal error: Argument 4 passed to Zend_Dojo_View_Helper_DateTextBox::dateTextBox() must be an array, null given in Zend/Dojo/View/Helper/DateTextBox.php on line 64
On Sunday 12 October 2008 01:36:27 rswarthout wrote: > When I try to use any Dojo enabled field I receive an error that just does > not make any sense. > > PHP Catchable fatal error: Argument 4 passed to > Zend_Dojo_View_Helper_DateTextBox::dateTextBox() must be an array, null > given in Zend/Dojo/View/Helper/DateTextBox.php on line 64 > > Any insight would be greatly appreciated. > > Robert are you ultimately using the view helper or the form element? 1.) if using the view helper, you have to specify $this->dateTextBox($id, $value, array(), array()); if you want to pass no information to the attribs or dijit fields. $this->dateTextBox($id, $value, null, null); is not allowed 2.) if you are using Form: are you setting 'attribs' or 'dijitParams' => null in the configuration of the form element? this leads to the problem described above. you ahve to set it to => array() to explicity stating its emptiness. greetings Benjamin -- Benjamin Eberlei http://www.beberlei.de