如何添加.html URL的结尾

时间:2015-04-11 14:25:24

标签: phalcon phalcon-routing

我是Phalcon PHP的新手。我无法弄清楚如何在每个页面的url末尾添加.html。我已经查找了文档。与此无关的任何内容都不在文档中

谢谢,

1 个答案:

答案 0 :(得分:1)

您可以自定义路由参数,例如:

$router->add(
    "/documentation/{name}.{type:[a-z]+}\.html",
    array(
        "controller" => "documentation",
        "action"     => "show"
    )
);

将使用params /documentation/color.doc.html$this->dispatcher->getParam("name") === "color"

$this->dispatcher->getParam("type") === "doc"路由到DocumentationController中的showAction

有关详细信息,请阅读http://docs.phalconphp.com/en/latest/reference/routing.html

中的文档
相关问题