|
|
|
Andre Fernandes
|
Hi,
I am trying to set the page encoding to UTF-8 using the following line at application.ini: resources.view.encoding = "UTF-8" ,my Bootstrap.php is the following: class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { public function _initAutoload() { $autoloader = new Zend_Application_Module_Autoloader( array( 'namespace' => '', 'basePath' => APPLICATION_PATH ) ); return $autoloader; } public function _initLayouts() { Zend_Layout::startMvc(); $this->getPluginResource('frontController') ->getFrontController() ->registerPlugin(new Plugin_ModuleLayout()); } protected function _initDoctype() { $this->bootstrap('view'); $view = $this->getResource('view'); $view->doctype('XHTML1_STRICT'); } } And my layout.phtml is the following: <?php echo $this->docType(); ?> <html> <head> <?php echo $this->headMeta(); ?> <?php echo $this->headTitle(); ?> <?php echo $this->headLink(); ?> <?php echo $this->headStyle(); ?> <?php echo $this->headScript(); ?> <?php echo $this->headLink()->appendStylesheet('/css/global.css') ?> </head> <body> <?php echo $this->layout()->content ?> </body> </html> But the encoding is not being setted at the HTML page generated. I guess there´s something I am missing that is needed to use the encoding setted at application.ini, but I can not find out what. Any help would be great. Thanks in advance, -- André de Camargo Fernandes |
||||||||||||||||
|
Hector Virgen
|
That setting is used by the escape view helper. Where are you seeing that the encoding is not UTF-8?
-- Hector On Thu, Oct 22, 2009 at 11:21 AM, Andre Fernandes <[hidden email]> wrote: Hi, |
|
Hector Virgen
|
Setting the view's encoding does not automatically create a meta tag.
I've created a simple "meta" bootstrap resource that lets you define your default meta tags in application.ini.
resources.meta.meta.httpEquiv.Content-Type: "text/html; charset=UTF-8" Let me know if that works.. not sure if application.ini can accept hyphens in the key name (Content-Type)
-- Hector On Thu, Oct 22, 2009 at 11:42 AM, Andre Fernandes <[hidden email]> wrote: The HTML generated is the following:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html>........... |
||||||||||||||||
|
Hector Virgen
|
Sorry, it should look like this: resources.meta.httpEquiv.Content-Type = "text/html; charset=UTF-8" Also, you need to add this line to the top of your application.ini to load custom bootstrap resources:
pluginPaths.Default_Resource = APPLICATION_PATH "/resources" Place the class I sent you in the file application/resources/Meta.php.
I hope that helps!
BTW don't forget to click "reply to all" when responding to messages in this mailing list :) -- Hector On Thu, Oct 22, 2009 at 1:29 PM, Andre Fernandes <[hidden email]> wrote:
|
||||||||||||||||
|
Andre Fernandes
|
Ok, I will try that, thanks a lot.
I am sorry for doing a Reply only, I will not do that again. And the class meta.php I could not see, was an attachment? Thanks again.
2009/10/22 Hector Virgen <[hidden email]>
-- André de Camargo Fernandes |
||||||||||||||||
|
Hector Virgen
|
No I pasted it on pastie: -- Hector On Thu, Oct 22, 2009 at 2:17 PM, Andre Fernandes <[hidden email]> wrote: Ok, I will try that, thanks a lot. |
||||||||||||||||
|
Andre Fernandes
|
Problem solved! Your answer saved my work!
Thanks a lot! 2009/10/22 Hector Virgen <[hidden email]>
-- André de Camargo Fernandes |
||||||||||||||||
| Free Embeddable Forum Powered by Nabble | Help |