doulian7305 2016-07-18 19:48
浏览 44
已采纳

Phalcon PhP - 如何在控制器内使用命名路由

I'm having trouble finding how to get the Urls from named routes inside a Phalcon PhP controller. This is my route:

$router->add(
    '/admin/application/{formUrl:[A-Za-z0-9\-]+}/{id:[A-Za-z0-9\-]+}/detail',
    [
        'controller' => 'AdminApplication',
        'action' => 'detail' 
    ]
)->setName("application-details");

I want to get just the Url, example: domain.com/admin/application/form-test/10/detail . With the code below I can get the html to create a link, the same result of the link_to.

$url = $this->tag->linkTo(
    array(
        array(
            'for' => 'application-details',
            'formUrl' => $form->url,
            'id' => $id
        ), 
        'Show'
    )
);

The result I want is just the Url. I'm inside a controller action. I know it must be really simple, I just can't find an example. Can you help me?

Thanks for any help!

  • 写回答

1条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥20 python跨服务器实现复制 ,剪切的功能需求
      • ¥15 R语言,单因素cox检验,时间分层后,使用coz.zph()函数再次ph假设检验时报错,如何解决?
      • ¥15 关于#C语言冒泡排序型#的问题,如何解决?
      • ¥15 如何预处理存在负值的样本数据,使其能够全都成为正的
      • ¥15 SW画图拖影,平滑处理如何关闭
      • ¥15 请问怎么通过css改变图片颜色
      • ¥15 c语言文件读取到结构体以及写入
      • ¥15 Blender: auto rig pro骨骼动画导出后变形穿模
      • ¥15 C51单片机的设计思路哈
      • ¥15 Linux脏牛提权漏洞