Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

URL problem

hi, i have some problem about my URL, because everytime i jump to the index of my view the URL look something like this


what i want to do is that in every index on my view the


on URL will not show.

thnk you in advance


Have you built any your own routes? What I think is that you need to define your own route.

My proposition for your router:

  'module' => 'yourmodulename', //delete this line if your app is single module
  'action' => 'index',
  'controller' => 1,

With the above code:

  • if you visit page Phalcon will fire indexAction in LoginController
  • if you visit page Phalcon will fire indexAction in HomeController

Then in your views you can build URLs like this:

echo $this->url->get(array(
  "for" => "your_route_name",
  "controller" => "login",
)); //it will return "/login"

echo $this->url->get(array(
  "for" => "your_route_name",
  "controller" => "home",
)); //it will return "/home"

I am quite a beginner so there might be some other better solutions.