Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-28-2008, 04:26 PM
Member
 
Join Date: Jan 2008
Location: chicago
Posts: 98
Default How do I set the Doctype in the Bootstrap?

I am trying to set the Doctype of my site in the bootstrapper:

PHP Code:
// Set the Doctype to XHTML 1.0 TRANSITIONAL for purposes of view helpers
$viewRenderer Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
$viewRenderer->view->doctype('XHTML1_TRANSITIONAL'); 
However I get this error message:

PHP Code:
Fatal error:  Call to a member function doctype() on a non-object in /srv/httpd/highlandgroupinc.com/html/els/certificates/index.php on line 33 
I know this error means that I am not creating an instance of the viewRenderer properly or that I am applying the method function to the wrong type of object.

What is the correct way to set the doctype in the bootstrap file?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-28-2008, 05:18 PM
Junior Member
 
Join Date: Oct 2007
Posts: 11
Default

Hey notrub225,

I don't have an answer for your question, but I am getting something similar when I attempt to use the placeholder helper in the bootstrap.

Code:
Fatal error: Call to a member function placeholder() on a non-object in /var/www/zfApp/library/Bigbadwolf/Common/Application/ZApplication.php on line 89
We're missing something somewhere, its just a matter of what.

Sorry, I was not able to help and only offer a, "me too" :-/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-28-2008, 07:56 PM
Junior Member
 
Join Date: Mar 2008
Posts: 15
Default

Your $viewRenderer->view is returning a Zend_View_Interface Type, which I don't think you can call that specific function.

Please make sure you call the correct object.


The function you want is inside Zend_View_Helper directory, but I dun think the function i s attached to the Interface.

Last edited by iroy2000 : 03-28-2008 at 08:08 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-31-2008, 03:24 PM
Member
 
Join Date: Jan 2008
Location: chicago
Posts: 98
Default

Yes, thank you. For some reason I thought I had to use one of the View objects. Here is the code that worked for me:

PHP Code:
// Set the Doctype to XHTML 1.0 TRANSITIONAL for purposes of form view helpers
$documentType = new Zend_View_Helper_Doctype();
$documentType->doctype('XHTML1_TRANSITIONAL'); 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-29-2008, 04:55 PM
Junior Member
 
Join Date: Apr 2008
Posts: 1
Default

Quote:
Originally Posted by notrub225 View Post
I am trying to set the Doctype of my site in the bootstrapper:

PHP Code:
// Set the Doctype to XHTML 1.0 TRANSITIONAL for purposes of view helpers
$viewRenderer Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
$viewRenderer->view->doctype('XHTML1_TRANSITIONAL'); 
However I get this error message:

PHP Code:
Fatal error:  Call to a member function doctype() on a non-object in /srv/httpd/highlandgroupinc.com/html/els/certificates/index.php on line 33 
I know this error means that I am not creating an instance of the viewRenderer properly or that I am applying the method function to the wrong type of object.

What is the correct way to set the doctype in the bootstrap file?
Try to use this
PHP Code:
// Set the Doctype to XHTML 1.0 TRANSITIONAL for purposes of view helpers
$viewRenderer Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
$viewRenderer->initView();
$viewRenderer->view->doctype('XHTML1_TRANSITIONAL'); 
Sorry for my english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:19 AM.