您好,欢迎访问一九零五行业门户网

zend framework怎么实现像 微博一样的 action

zend framework如何实现像 微博一样的 action?
zend framework如何实现像 微博一样的 action?
比如腾讯微博的 t.qq.com/ yourname
这个 yourname 是存放在数据库用户表中的 username一列。 那么zend framework如何实现这个功能呢。
像其它静态的action都是可以直接写好 controllers.但是动态的我就不懂了。
我是个初学者,很多不懂。知者望能详细指点。。用纯粹的php也行,但别用别的框架,我研究zf蛋都碎了。不想再又去搞另一个框架。
谢谢。。
------解决方案--------------------
zend有router,看这里即可
http://framework.zend.com/manual/1.11/en/zend.controller.router.html
------解决方案--------------------
../public/index.php部分代码如下
$ctrl = zend_controller_front::getinstance();
$router = $ctrl->getrouter();
//:username 是变量 ,module->设置模块
$route = new zend_controller_router_route ( ':username', array ('module'=>'rout','controller' => 'index', 'action' => 'info' ) );
$router->addroute ( 'user', $route );
rout 模块下 indexcontroller.php 部分代码
public function infoaction() {
$username = $this->_getparam('username');
print_r($username);
exit ();
}
呵呵 结贴吧,这样就可以实现了,楼主还有什么问题 可以随时沟通 呵呵
其它类似信息

推荐信息