TFT2012 Posted July 23, 2012 Share Posted July 23, 2012 Hi, I just start learning Zend Framework (1.11) and follow the ZF reference guide on Zend.com. I have a question here: I added the an _init function into Bootstrap under Application folder. The whole Bootstrap codes look like: class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function _initDocType() { $this->bootstrap('View'); $view = $this->getResource('View'); $view->doctype('XHTML1_STRICT'); } } After I adding this _initDocType() function, the main page http://localhost/public/ cannot be displayed. If I commented out the _initDocType(), then page shows. Can anyone help me on this? Thank You! Quote Link to comment https://forums.phpfreaks.com/topic/266129-zend-initial-view-resource-in-bootstrap/ Share on other sites More sharing options...
avibitton Posted July 24, 2012 Share Posted July 24, 2012 Hi im also new at zend , so im suggesting to try to do this : application/configs/application.ini Add to [production] section: resources.view[] = than check the main page . also if done zf enable layout and added the code to layout.phtml you can display the layout . i wonder if it will solve your problem . so if no tell me which errors you get , and if it did help . Avi. Quote Link to comment https://forums.phpfreaks.com/topic/266129-zend-initial-view-resource-in-bootstrap/#findComment-1364009 Share on other sites More sharing options...
TFT2012 Posted July 24, 2012 Author Share Posted July 24, 2012 Thank you Avi. It works. The Zend reference guide didn't mention that at all. Could you explain to me why it should add resource.view[] to configuration. Quote Link to comment https://forums.phpfreaks.com/topic/266129-zend-initial-view-resource-in-bootstrap/#findComment-1364050 Share on other sites More sharing options...
avibitton Posted July 24, 2012 Share Posted July 24, 2012 yes i can explain , you need to initialize the View resource , just than you can use the view object . in fact what you wrote and gave the view[] which is exctly nothing inside , thats the initiate of the view . http://framework.zend.com/manual/en/learning.quickstart.create-layout.html. read this it will help understand better . and BTW if you want to share knowledge with me i will be happy , since the learning curve is heavy for zend , so i will be happy to learn from you and if i can help i will help also . good luck . Avi. Quote Link to comment https://forums.phpfreaks.com/topic/266129-zend-initial-view-resource-in-bootstrap/#findComment-1364081 Share on other sites More sharing options...
TFT2012 Posted July 25, 2012 Author Share Posted July 25, 2012 Thank you very much. Quote Link to comment https://forums.phpfreaks.com/topic/266129-zend-initial-view-resource-in-bootstrap/#findComment-1364239 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.