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


PHP Zend_View::setEscape方法代码示例

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


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

示例1: _initView

 protected function _initView()
 {
     $theme = 'default';
     $templatePath = APPLICATION_PATH . '/../public/themes/' . $theme . '/templates';
     Zend_Registry::set('user_date_format', 'm-d-Y');
     Zend_Registry::set('calendar_date_format', 'mm-dd-yy');
     Zend_Registry::set('db_date_format', 'Y-m-d');
     Zend_Registry::set('perpage', 10);
     Zend_Registry::set('menu', 'home');
     Zend_Registry::set('eventid', '');
     $dir_name = $_SERVER['DOCUMENT_ROOT'] . rtrim(str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']), '/');
     Zend_Registry::set('acess_file_path', $dir_name . SEPARATOR . "application" . SEPARATOR . "modules" . SEPARATOR . "default" . SEPARATOR . "plugins" . SEPARATOR . "AccessControl.php");
     Zend_Registry::set('siteconstant_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "site_constants.php");
     Zend_Registry::set('emailconstant_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "email_constants.php");
     Zend_Registry::set('emptab_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "emptabconfigure.php");
     Zend_Registry::set('emailconfig_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "mail_settings_constants.php");
     Zend_Registry::set('application_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "application_constants.php");
     $date = new Zend_Date();
     Zend_Registry::set('currentdate', $date->get('yyyy-MM-dd HH:mm:ss'));
     Zend_Registry::set('currenttime', $date->get('HH:mm:ss'));
     Zend_Registry::set('logo_url', '/public/images/landing_header.jpg');
     $view = new Zend_View();
     $view->setEscape('stripslashes');
     $view->setBasePath($templatePath);
     $view->setScriptPath(APPLICATION_PATH);
     $view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper');
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
     $viewRenderer->setView($view);
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
     return $this;
 }
开发者ID:uskumar33,项目名称:DeltaONE,代码行数:31,代码来源:Bootstrap.php

示例2: testEscapeShouldAllowAndUseMoreThanOneArgument

 /**
  * @group ZF-9595
  */
 public function testEscapeShouldAllowAndUseMoreThanOneArgument()
 {
     $view = new Zend_View();
     $view->setEscape(array($this, 'escape'));
     $this->assertEquals('foobar', $view->escape('foo', 'bar'));
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:9,代码来源:ViewTest.php

示例3: testCustomEscape

 public function testCustomEscape()
 {
     $view = new Zend_View();
     $view->setEscape('strip_tags');
     $original = "<p>Some text</p>";
     $escaped  = $view->escape($original);
     $this->assertNotEquals($original, $escaped);
     $this->assertEquals("Some text", $escaped);
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:9,代码来源:ViewTest.php

示例4: setupView

 private static function setupView()
 {
     $view = new Zend_View();
     $view->setEncoding('ISO-8859-1');
     $view->setEscape('htmlentities');
     $view->setBasePath('./application/views/');
     /** Define o diretório onde estarão as visões */
     $view->addHelperPath('./application/views/helpers', 'View_Helper');
     Zend_Registry::set('view', $view);
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
     Zend_Layout::startMvc(array('layoutPath' => './application/layouts'));
 }
开发者ID:Ogwang,项目名称:sainp,代码行数:13,代码来源:Bootstrap.php


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