php_begins Posted February 6, 2012 Share Posted February 6, 2012 I have the following code in zend: $arrErrors=array(); if (!empty($this->post['submit'])) { // Each time theres an error, add an error message to the error array // using the field name as the key. if (empty($this->post['client_name'])) $arrErrors['client_name'] = "Please Enter Client's name as it appears in the carrier software"; } if i set $this->view->arrErrors=$arrErrors in the controller, Can I access it as $this->arrErrors['client_name'] in the view? Link to comment https://forums.phpfreaks.com/topic/256555-accessing-array-in-view/ Share on other sites More sharing options...
noXstyle Posted February 6, 2012 Share Posted February 6, 2012 Yes. Shouldn't you like try before asking here? If it doesn't work you can always fix it . And zend has probably the best documentation out there, learn to use it. You will need it sooner or later. Link to comment https://forums.phpfreaks.com/topic/256555-accessing-array-in-view/#findComment-1315198 Share on other sites More sharing options...
php_begins Posted February 6, 2012 Author Share Posted February 6, 2012 I tried the above and also few other formats, but didnt get any result.. one of the methods i tried was : $arrErrors['test'] = "Please Enter Client's name"; $this->view->arrErrors=$arrErrors['test']; Zend doc didnt provide any help on this one.. Link to comment https://forums.phpfreaks.com/topic/256555-accessing-array-in-view/#findComment-1315209 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.