Jump to content

[Zend] - Initial view resource in bootstrap


TFT2012

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.