当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_View::setEncoding方法代码示例

本文整理汇总了PHP中Zend_View::setEncoding方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View::setEncoding方法的具体用法?PHP Zend_View::setEncoding怎么用?PHP Zend_View::setEncoding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_View的用法示例。


在下文中一共展示了Zend_View::setEncoding方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _initView

 protected function _initView()
 {
     $this->bootstrap(array('request'));
     // Initialize view
     $view = new Zend_View();
     $view->setEncoding('UTF-8');
     $view->doctype('XHTML1_STRICT');
     $view->headTitle()->setSeparator(' » ');
     // Save the base URL
     $view->baseUrl = $this->getResource('request')->getBaseUrl();
     // Add it to the ViewRenderer
     $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
     $viewRenderer->setView($view);
     // Add some stylesheet
     $view->headLink()->appendStylesheet($view->baseUrl . '/css/default.css');
     // Set user info
     /*
     $session = $this->getResource('session');
     $view->userLoggedIn = $session->logged_in;
     $view->userInfo = $session->user;
     */
     $view->addHelperPath(APPLICATION_PATH . '/views/helpers', 'SimpleCal_View_Helper_');
     Zend_Dojo::enableView($view);
     // Return it, so that it can be stored by the bootstrap
     return $view;
 }
开发者ID:shevron,项目名称:zend-simplecal,代码行数:26,代码来源:Bootstrap.php

示例2: _initView

 protected function _initView()
 {
     //INICIAR PLUGIN PARA CADA MODULE TER SEU LAYOUT
     $view = new Zend_View();
     $view->setEncoding('UTF-8');
     Zend_Layout::startMvc(array('layoutPath' => APPLICATION_PATH . '/modules/default/layouts/scripts', 'layout' => 'default', 'pluginClass' => 'App_Plugins_SetLayout'));
 }
开发者ID:pccnf,项目名称:proj_instag,代码行数:7,代码来源:Bootstrap.php

示例3: testGravatar

 /**
  * @covers Robo47_View_Helper_Gravatar::Gravatar
  * @dataProvider gravatarProvider
  */
 public function testGravatar($email, $size, $rating, $default, $ssl, $separator, $params)
 {
     $view = new Zend_View();
     $view->setEncoding('utf-8');
     $view->Doctype(Zend_View_Helper_Doctype::XHTML1_STRICT);
     $service = new Robo47_Service_Gravatar();
     $helper = new Robo47_View_Helper_Gravatar($service);
     $helper->setView($view);
     $gravatarImageTag = $helper->Gravatar($email, $size, $rating, $default, $ssl, $separator, $params);
     $src = $service->getUri($email, $size, $rating, $default, $ssl, $separator);
     $alt = 'Gravatar ' . $service->getGravatarHash($email);
     libxml_use_internal_errors(true);
     $dom = new DOMDocument();
     $dom->loadHTML('<html><head><title></title></head><body>' . $gravatarImageTag . '</body></html>');
     libxml_use_internal_errors(false);
     $nodes = $dom->getElementsByTagName('img');
     $this->assertEquals(1, $nodes->length);
     $image = $nodes->item(0);
     $this->assertTrue($image->hasAttribute('src'), 'Image has no attribute "href"');
     $this->assertTrue($image->hasAttribute('alt'), 'Image has no alt');
     foreach ($params as $param => $value) {
         $this->assertTrue($image->hasAttribute($param), 'Image has no attribute "' . $param . '"');
         $this->assertEquals($value, $image->getAttribute($param), 'Image attribute "' . $param . '" has wrong value');
     }
     $srcAttribute = $image->getAttribute('src');
     $this->assertEquals($src, $srcAttribute, 'Image attribute "src" has wrong value');
     if (isset($params['alt'])) {
         $altAttribute = $image->getAttribute('alt');
         $this->assertEquals($params['alt'], $altAttribute, 'Image attribute "alt" has wrong value');
     } else {
         $altAttribute = $image->getAttribute('alt');
         $this->assertEquals($alt, $altAttribute, 'Image attribute "alt" has wrong value');
     }
 }
开发者ID:robo47,项目名称:robo47-components,代码行数:38,代码来源:GravatarTest.php

示例4: _sendNewCommentEmail

 /**
  * Send email notification to moderators when a new comment is posted
  * 
  * @todo move logic to model / library class
  * 
  * @param HumanHelp_Model_Comment $comment
  * @param HumanHelp_Model_Page $page
  */
 public function _sendNewCommentEmail(HumanHelp_Model_Comment $comment, HumanHelp_Model_Page $page)
 {
     $config = Zend_Registry::get('config');
     $emailTemplate = new Zend_View();
     $emailTemplate->setScriptPath(APPLICATION_PATH . '/views/emails');
     $emailTemplate->addHelperPath(APPLICATION_PATH . '/views/helpers', 'HumanHelp_View_Helper_');
     $emailTemplate->setEncoding('UTF-8');
     $emailTemplate->comment = $comment;
     $emailTemplate->page = $page;
     $emailTemplate->baseUrl = 'http://' . $_SERVER['HTTP_HOST'] . $this->view->baseUrl;
     $bodyHtml = $emailTemplate->render('newComment.phtml');
     $bodyText = $emailTemplate->render('newComment.ptxt');
     $mail = new Zend_Mail();
     $mail->setType(Zend_Mime::MULTIPART_ALTERNATIVE)->setBodyHtml($bodyHtml, 'UTF-8')->setBodyText($bodyText, 'UTF-8')->setSubject("New comment on '{$page->getTitle()}' in '{$page->getBook()->getTitle()}'")->setFrom($config->fromAddress, $config->fromName);
     if (is_object($config->notifyComments)) {
         foreach ($config->notifyComments->toArray() as $rcpt) {
             $mail->addTo($rcpt);
         }
     } else {
         $mail->addTo($config->notifyComments);
     }
     if ($config->smtpServer) {
         $transport = new Zend_Mail_Transport_Smtp($config->smtpServer, $config->smtpOptions->toArray());
     } else {
         $transport = new Zend_Mail_Transport_Sendmail();
     }
     $mail->send($transport);
 }
开发者ID:shevron,项目名称:HumanHelp,代码行数:36,代码来源:IndexController.php

示例5: _initView

 protected function _initView()
 {
     $view = new Zend_View();
     // snip...
     $view->setEncoding('win-1251');
     // snip...
     return $view;
 }
开发者ID:xent1986,项目名称:ychebgit,代码行数:8,代码来源:Bootstrap.php

示例6: setupView

 public static function setupView()
 {
     $view = new Zend_View();
     $view->setEncoding('UTF-8');
     Zend_Layout::startMvc(array('layoutPath' => self::$root . 'application/default/views/layouts', 'layout' => 'layout'));
     $registry = Zend_Registry::getInstance();
     $registry->set('view', $view);
 }
开发者ID:uester,项目名称:escolaonline,代码行数:8,代码来源:Bootstrap.php

示例7: _initView

 protected function _initView()
 {
     $view = new Zend_View();
     $view->setEncoding('UTF-8');
     $view->doctype(Zend_View_Helper_Doctype::XHTML11);
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
     Zend_Registry::set('view', $view);
 }
开发者ID:rocknoon,项目名称:Stack,代码行数:9,代码来源:Bootstrap.php

示例8: _initView

 protected function _initView()
 {
     ini_set('default_charset', 'UTF-8');
     $view = new Zend_View();
     // snip...
     $view->setEncoding('utf-8');
     // snip...
     return $view;
 }
开发者ID:andrelsguerra,项目名称:pequiambiental,代码行数:9,代码来源:Bootstrap.php

示例9: setupView

 public function setupView($crt_theme)
 {
     $view = new Zend_View();
     $view->setEncoding('UTF-8');
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
     $view->setScriptPath($this->root . '/application/' . $crt_theme . '/scripts/');
     $view->setHelperPath($this->root . '/application/' . $crt_theme . '/helpers');
     $this->layout = Zend_Layout::startMvc(array('layoutPath' => $this->root . '/application/' . $crt_theme . '/layouts', 'layout' => 'layout'));
 }
开发者ID:aliinfotech,项目名称:netefct,代码行数:10,代码来源:Bootstrap.php

示例10: _initView

 /**
  *   the doctype is now also declared in the bootstrap...
  *
  */
 protected function _initView()
 {
     //$this->bootstrap('view');
     //$view = $this->getResource('view');
     //$view->doctype('XHTML11');
     $view = new Zend_View();
     $view->setEncoding('UTF-8');
     $view->doctype('XHTML11');
     return $view;
 }
开发者ID:jaakkop,项目名称:site,代码行数:14,代码来源:Bootstrap.php

示例11: _initView

 protected function _initView()
 {
     $view = new Zend_View();
     $view->doctype('XHTML1_TRANSITIONAL');
     $view->setEncoding('UTF-8');
     $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')->appendHttpEquiv('Content-Language', 'en-US');
     $view->headTitle('Chargify Sample App')->setSeparator(' | ');
     $view->addHelperPath('Crucial/View/Helper/', 'Crucial_View_Helper');
     $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
     $viewRenderer->setView($view);
 }
开发者ID:RealTimeApps,项目名称:chargify-sample-app,代码行数:11,代码来源:Bootstrap.php

示例12: render

 public function render(Zend_View_Interface $view = null)
 {
     if (!$this->_template) {
         return parent::render($view);
     } else {
         $root = Zend_Registry::get('root');
         $view = new Zend_View();
         $view->setEncoding('UTF-8');
         $view->setScriptPath("{$root}/application/pages/views/forms/");
         $view->form = $this;
         return $view->render($this->_template);
     }
 }
开发者ID:kreativmind,项目名称:storytlr,代码行数:13,代码来源:PageForm.php

示例13: _initView

 protected function _initView()
 {
     $path = APPLICATION_PATH . '/modules/' . MODULE_NAME . '/views';
     $view = new Zend_View();
     $view->setUseStreamWrapper(true);
     $view->setEncoding('UTF-8');
     $view->addScriptPath($path . '/partials');
     $view->addScriptPath($path . '/scripts');
     $view->addHelperPath(APPLICATION_PATH . '/../library/Bbx/View/Helper', 'Bbx_View_Helper');
     $view->addHelperPath($path . '/helpers', 'ViewHelper');
     $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
     $viewRenderer->setView($view);
     Zend_Registry::set('view', $view);
 }
开发者ID:rdallasgray,项目名称:bbx,代码行数:14,代码来源:ContextDependencies.php

示例14: _initView

 protected function _initView()
 {
     // Initialize view
     $view = new Zend_View();
     $view->doctype('XHTML1_STRICT');
     $view->setEncoding('utf-8');
     $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=utf-8');
     // Add it to the ViewRenderer
     $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
     $viewRenderer->setView($view);
     Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH . '/controllers/helpers');
     // Return it, so that it can be stored by the bootstrap
     return $view;
 }
开发者ID:neekfenwick,项目名称:dojo-sandbox,代码行数:14,代码来源:Bootstrap.php

示例15: initView

 function initView()
 {
     $view = new Zend_View();
     $view->setEncoding('UTF-8');
     $fc = Zend_Controller_Front::getInstance();
     $cs = $fc->getControllerDirectory();
     $prefixes = array_keys($cs);
     foreach ($prefixes as $prefix) {
         $viewdir = dirname(dirname(__FILE__)) . '/Views/';
         $view->addScriptPath($viewdir . 'Scripts');
         $view->addHelperPath($viewdir . 'Helpers', $prefix . '_View_Helper_');
     }
     $page = new Strass_Page(new Wtk_Metas(array('DC.Title' => 'Installation', 'DC.Language' => 'fr', 'site' => 'Installation')));
     Zend_Registry::set('page', $page);
     return $view;
 }
开发者ID:bersace,项目名称:strass,代码行数:16,代码来源:Action.php


注:本文中的Zend_View::setEncoding方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。