管理区域中的视图页面或 Zend 框架中的站点后端不支持转义方法吗? [英] escape method is not supported by view page in admin area or backend of site in zend framework?

查看:11
本文介绍了管理区域中的视图页面或 Zend 框架中的站点后端不支持转义方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Zend 框架的新手.我在后端(网站的管理区域)工作并希望使用转义,但我的视图页面不支持此功能.当我在查看页面中使用转义方法时,查看页面不显示任何内容.为此,我可以在管理区域的视图页面中使用转义方法.这是我在控制器中的代码:-

I am new with zend framework. I am working in backend(the admin area of website) and want ot use escape but my view page is not supporting this. when I use escape method in view page, view page does not show anything. For this what I can do so I can use escape method in view page in admin area. Here is my code in controller:-

$this->view->assign('username', 'Username');    
$this->view->assign('password', 'Password');
$this->view->assign('rememberMe', 'Remember Me');

我在这样的视图页面中使用这个分配变量:-

I am using this assign variable in view page like this:-

<td id="userlogin" align="left" width="30%"><?php echo escape($this->username);?>:</td>

但是我在管理区域的视图页面不支持转义方法.请给我建议一个技巧...

But escape method is not supported by my view page in admin area. Please suggest me a trick for this...

推荐答案

我想你是说

<?php echo $this->escape($this->username);?>

escape 是 Zend_View 类(模板上下文中的 $this)的函数,而不是全局 PHP 函数.

escape is a function of the Zend_View class ($this in the context of templates) rather than a global PHP function.

这篇关于管理区域中的视图页面或 Zend 框架中的站点后端不支持转义方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆