本文整理汇总了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;
}
示例2: testEscapeShouldAllowAndUseMoreThanOneArgument
/**
* @group ZF-9595
*/
public function testEscapeShouldAllowAndUseMoreThanOneArgument()
{
$view = new Zend_View();
$view->setEscape(array($this, 'escape'));
$this->assertEquals('foobar', $view->escape('foo', 'bar'));
}
示例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);
}
示例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'));
}