本文整理汇总了PHP中Zend_View::strictVars方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View::strictVars方法的具体用法?PHP Zend_View::strictVars怎么用?PHP Zend_View::strictVars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_View
的用法示例。
在下文中一共展示了Zend_View::strictVars方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
$view = new Zend_View();
$base = str_replace('/', DIRECTORY_SEPARATOR, '/../_templates');
$view->setScriptPath(dirname(__FILE__) . $base);
$view->strictVars(true);
$this->view = $view;
}
示例2: testStrictVars
public function testStrictVars()
{
$view = new Zend_View();
$view->setScriptPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'View' . DIRECTORY_SEPARATOR . '_templates');
$view->strictVars(true);
set_error_handler(array($this, 'handleNotices'), E_USER_NOTICE);
$content = $view->render('testStrictVars.phtml');
restore_error_handler();
foreach (array('foo', 'bar') as $key) {
$this->assertContains('Key "' . $key . '" does not exist', $this->notices);
}
}
示例3: unset
$s .= 'The private policy can be found at <a href="' . $policy . '">' . $policy . '</a>.<br>';
}
}
return $s;
}
$session = new Zend_Session_Namespace("opeinid.server");
Zend_Session::start();
$ret = false;
if ($_SERVER["REQUEST_METHOD"] == "GET") {
if (!isset($_GET['openid_action']) && isset($_GET['openid_mode'])) {
$ret = $server->handle($_GET, new Zend_OpenId_Extension_Sreg());
} else {
require_once 'Zend/View.php';
$view = new Zend_View();
$view->setScriptPath(__DIR__ . '/templates');
$view->strictVars(true);
if (isset($session->id)) {
$view->id = $session->id;
}
if (isset($session->error)) {
$view->error = $session->error;
unset($session->error);
}
if (isset($_GET['openid_action'])) {
if ($_GET['openid_action'] == 'register') {
$ret = $view->render('register.phtml');
} else {
if ($_GET['openid_action'] == 'registration_complete' && isset($_GET['openid_name'])) {
$view->name = $_GET['openid_name'];
$view->url = Zend_OpenId::selfURL() . '?openid=' . $view->name;
if ($server->hasUser($view->url)) {
示例4: testStrictVars
public function testStrictVars()
{
$view = new Zend_View();
$view->setScriptPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'View' . DIRECTORY_SEPARATOR . '_templates');
$view->strictVars(true);
$content = $view->render('testStrictVars.phtml');
$this->assertContains('Key "foo" does not exist', $content, $content);
$this->assertContains('Key "bar" does not exist', $content);
}