url('') function problem

Hi, url ('string') function and $url->setBaseUri('url') working perfectly concat url and string but, url('string') if have ":" character dont working return only string

example: http://paste.ubuntu.com/11922749/

I working with multi module application and active volt engine (centos 6)

edited Jul '15

Hi there :) First i need to question - what is that? ":"

I think u want to use router assignment? To do that, u must name what u use from router. For example

$router->add("/posts/{year}/{title}", "Posts::show")->setName("show-posts");


- so important part here is ->setName("show-posts"); ...to use that in url function (in volt), now u can do something like this:

<a href="{{ url(['for' : 'show-posts', 'year': '2015', 'title' : 'test']) }}">Here</a>

Check documentation for more details: https://docs.phalconphp.com/en/latest/reference/routing.html and https://docs.phalconphp.com/en/latest/api/Phalcon%5Mvc%5Url.html

And good luck :)

PS: sorry for my English skills



1.8k

hi no ı dont want use any router :) I use baseUri because working with subdirectory. and {{url('someting')}} working perfect is return "baseUri/someting" but {{url('someting/example:example')}} return only "something/example:example". If have : character dont prepend baseUri

sorry for english and spelling ı use mobile now

Hm... i try and didnt have this issue.... what is your base uri? $url->setBaseUri(???);



1.8k

It's not important http://paste.ubuntu.com/11922749/

ı try other and real baseUri but problem is not solved

So, i got u.. :)

        <a href="{{ url('aaa/bbb') }}">TES</a>
        <a href="{{ url('aaa/bbb:ccc'|url_encode) }}">TES2</a>

Now works fine. Good luck.



1.8k
edited Jul '15

url encode replace ':' to '%' its not working with phalcon dispatcher parameters. maybe change ':' to '%' or other character solved problem. but this problem not have 1.x version. thanks for answer