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

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

问题描述

我是新的zend框架。我正在后台工作(网站的管理区域),并希望使用escape,但我的视图页面不支持这一点。当我在视图页面中使用escape方法时,查看页面不显示任何内容。为此,我可以这样做,我可以在管理区域的视图页面中使用escape方法。这是我在控制器中的代码: -

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

我在这个视图页面中使用这个assign变量: -

 < td id =userloginalign =leftwidth =30%><?php echo escape($ this-> username ?);>:其中; / TD> 

但是我的管理区域中的查看页面不支持转义方法。请给我一个窍门...

解决方案

我想你的意思是

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

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


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...

解决方案

I think you mean

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

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

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

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