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? Quote 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. Quote 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.. Quote Link to comment https://forums.phpfreaks.com/topic/256555-accessing-array-in-view/#findComment-1315209 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.