Zend Framework动作助手Url用法详解

时间:2021-05-25

本文实例讲述了Zend Framework动作助手Url用法。分享给大家供大家参考,具体如下:

Url主要用于创建url;

public function simple($action, $controller = null, $module = null, array $params = null)public function url($urlOptions = array(), $name = null, $reset = false, $encode = true)public function direct($action, $controller = null, $module = null, array $params = null)<?phpclass IndexController extends Zend_Controller_Action{ public function init() { } public function indexAction() { //$urlParser = $this->_helper->getHelper('UrlParser'); //var_dump($urlParser->parse('https://plex operations, as it * ties into the route objects registered with the router. * * @param array $urlOptions Options passed to the assemble method of the Route object. * @param mixed $name The name of a Route to use. If null it will use the current Route * @param boolean $reset * @param boolean $encode * @return string Url for the link href attribute. */ public function url($urlOptions = array(), $name = null, $reset = false, $encode = true) { $router = $this->getFrontController()->getRouter(); return $router->assemble($urlOptions, $name, $reset, $encode); } /** * Perform helper when called as $this->_helper->url() from an action controller * * Proxies to {@link simple()} * * @param string $action * @param string $controller * @param string $module * @param array $params * @return string */ public function direct($action, $controller = null, $module = null, array $params = null) { return $this->simple($action, $controller, $module, $params); }}

更多关于zend相关内容感兴趣的读者可查看本站专题:《Zend FrameWork框架入门教程》、《php优秀开发框架总结》、《Yii框架入门及常用技巧总结》、《ThinkPHP入门教程》、《php面向对象程序设计入门教程》、《php+mysql数据库操作入门教程》及《php常见数据库操作技巧汇总》

希望本文所述对大家PHP程序设计有所帮助。

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章