Questions tagged [phalcon-routing]

Routing in Phalcon Framework's MVC implementation. Phalcon is an open source PHP web application framework, and it is released under the BSD license.

phalcon-routing provides advanced routing capabilities. In MVC mode, you can define routes and map them to controllers/actions that you require.

The router component allows defining routes that are mapped to controllers or handlers that should receive the request. A router simply parses a URI to determine this information. The router has two modes: MVC mode and match-only mode. The first mode is ideal for working with MVC applications.

109 questions
1
vote
0 answers

Phalcon .htaccess file not working on linux server

I have made a web API using the PHP phalcon framework which is running perfectly on localhost. But when I upload it to a Linux server it's not working. I think it's because of my .htaccess file. Can you take look? My .htaccess file looks like…
1
vote
1 answer

Want to start using Phalcon instead of .htaccess on existing site

Im new to the forum and hopefully Im posting as I should! I have an site already but I want to start using Phalcon PHP framework for better and, hopefully, easier URL rewriting. I have been experimenting with Phalcon using the tutorials but I dont…
ihet
  • 47
  • 7
1
vote
1 answer

Phalcon PhP - how to use named routes inside a controller

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' =>…
André Luiz
  • 6,642
  • 9
  • 55
  • 105
1
vote
1 answer

Redirecting to 404 route in PhalconPHP results in Blank Page

I have setup a router, and in it, defined a route for 404s: removeExtraSlashes(true); $route = $router->add('/', ['controller' => 'index', 'action' =>…
Thom Porter
  • 2,604
  • 2
  • 19
  • 23
1
vote
2 answers

Phalcon router doesn't seem to be set

I have set a custom route, my routes.php currently looks like this: add('athlete/{username}', array( 'controller' => 'athlete', 'action' => 'index', )); return $router; In my services.php…
Patrick Manser
  • 1,133
  • 2
  • 12
  • 31
1
vote
1 answer

Want to change phalcon default route

I want to change the default route in phalcon, which is an index action of indexcontroller. My routes.php: $router = new \Phalcon\Mvc\Router(); //Define a route $router->add( "/", array( "controller" => "admin", //previously it was…
Mr. Engineer
  • 3,522
  • 4
  • 17
  • 34
1
vote
2 answers

Phalcon Routing for Admin controllers

I'm a newbie at Phalcon programming, I have admin/backend and frontend controllers Admin will be served at '/admin/:controller/:action' and frontend will be served at '/:controller/:action' Admin controllers (KalkuRitel\Controllers\Admin namespace)…
ir1keren
  • 37
  • 9
1
vote
0 answers

Phalcon Micro Collection - action not running in controller

I'm having a problem setting up Micro collections with Phalcon. I want controllers to handle the requests but, when I use setHandler() on the micro collection, and then map the route, nothing happens when making a request. Code in public/index.php…
1
vote
1 answer

Routing not working in phalcon framework

I have many modules and depending upon modules routes are generated dynamically. For explaining purpose I m adding route for just one module. Following are the routes for the users module. add('/users',array( 'module'…
WatsMyName
  • 4,240
  • 5
  • 42
  • 73
1
vote
0 answers

Phalcon2 module app routing

just installed Phalcon2 and working around multi-module app. I've have such structure. And my index file http://pastebin.com/zqaRKCdC When navigating to / , see the front-module index controller, but if I go to /admin, see the same. Maybe anyone…
Cawa
  • 1,269
  • 3
  • 25
  • 44
1
vote
0 answers

Phalcon PHP framework not passing parameters to controller

Just started development in the Phalcon PHP framework and am also pretty new to PHP in general. My question is on how to create a request with a route, which I believe I have done, and pass the parameters of the route to the controller action that…
ChristopherW
  • 993
  • 1
  • 12
  • 25
1
vote
2 answers

Phalconphp: Getting router parameters outside of Controller

I have a router defined like this $router->add("/api/:controller/:action/:params", array( 'controller' => 1, 'action' => 2, 'params' => 3, 'myParameter' => 'test' )); So, I can get that "myParameter" parameter inside of controller…
ahmetunal
  • 3,930
  • 1
  • 23
  • 26
1
vote
1 answer

How to add new view to Phalcon app?

I'm completely confused on how Phalcon PHP renders its views. I want to create a new page called "manager". From my understanding by creating a controller I can link it to a view. I create a controller called ManagerController.php and then added a…
GNov
  • 105
  • 1
  • 13
1
vote
1 answer

Phalcon URL generator mixes parameters in custom route

I'm trying to get the following route to work: $router->add('/([a-z]{2})/:namespace/:controller/:action/([^\/]+)', array( 'language' => 1, 'namespace' => 2, 'controller' => 3, 'action' => 4, 'location' =>…
Hinrich
  • 60
  • 10
1
vote
1 answer

Shared base controller between modules

I am setting up a multi-module application, so far I have it setup like this example http://docs.phalconphp.com/en/latest/reference/applications.html. But I was wandering if its possible to have shared base controller that both the backend and…
user794846
  • 1,881
  • 5
  • 29
  • 72