Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 volt (Phalcon) 创建一个 URL。
我试过了:
{{ url("order/view/", ["id" :order.id]) }}
但是,这会产生如下 URL:
http://localhost/gateway-new/order/view/?id=7
而我希望网址看起来像:
http://localhost/gateway-new/order/view/id/7
知道如何正确执行此操作吗?
如果您定义了一条路线,例如
$router->add('order/view/id/:int', array( 'controller' => 'order', 'action' => 'view', 'id' => 1))->setName('order-view');
你可以使用
{{ url(['for': 'order-view', 'id': order.id]) }}
{{ url("order/view/id/" ~ order.id) }}