在 zend 的 url 中传递一个变量 [英] pass a variable in the url in zend

查看:30
本文介绍了在 zend 的 url 中传递一个变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在 Zend 的 URL 中传递变量值.

I am not able to a pass a variable value in the URL in Zend.

echo '<a href="/page/page-info/page_id/"' .$this->hidden_page_id. '"/">Back</a>';

如果我简单 echo $this->hidden_​​page_id 我得到上面页面上的值.但是当我通过链接在上面传递它时,它没有显示值.我是否必须将其存储在会话中?

if I simple echo $this->hidden_page_id I get the value on the above page. But When I pass it above through a link it does not show the value. Do I have to store it in a session or something?

推荐答案

执行 var_dump 会得到什么?

What you get when do a var_dump?

var_dump($this->hidden_page_id);

建议,使用视图助手:

echo '<a href="' . $this->url(array('controller' => 'page', 'action' => 'page-info', 'page_id' => $this->hidden_page_id)) . '">Back</a>';

这篇关于在 zend 的 url 中传递一个变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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