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
2
votes
3 answers

Phalcon php router notFound not working

I'm just bashing about with Phalcon right now, trying to get my head around it as I'm thinking of porting a big project from CodeIgniter to Phalcon or another framework before development continues any further. I'm using the router to try and catch…
Ally
  • 955
  • 1
  • 15
  • 33
2
votes
1 answer

Phalcon PHP - How to make friendly url?

I made routing pattern as following: $router->add('/album/view/{slug}-:int', array( 'controller' => 'album', 'action' => 'view', 'id' => 2,))->setName('album-view'); But it didnt work, so I changed the pattern…
Kevin
  • 1,403
  • 4
  • 18
  • 34
2
votes
3 answers

phalcon router not working

I try to use a router with phalcon. This is how it is included in index.php right after registering the 'events manager': $di->set('router', function(){ require __DIR__.'/../app/config/routes.php'; return $router; }); and this is how the…
haheute
  • 2,129
  • 3
  • 32
  • 49
1
vote
1 answer

Route not working when parameter passed to default action

I have the following route setup. $router->add('/schools', array( 'module' => 'schools', 'namespace'=>'MyNameSpace\Schools\Controllers\\', 'controller'=>'index', 'action' => 'index' )); $router->add('/schools/:params",array( …
WatsMyName
  • 4,240
  • 5
  • 42
  • 73
1
vote
1 answer

Phalcon validation - how to display only the first error message per field

Please don't recommend 'cancelOnFail' because it doesn't work properly if I'm validating more than one field $this->add( 'email', new PresenceOf( [ 'message' => 'The e-mail is required', ] …
Zwivhu
  • 11
  • 2
1
vote
1 answer

Pass regex flags to route in Phalcon micro app

I'm trying to define a route in a Phalcon Micro App, but can't figure out how to pass the global flag to the regular expression. Here is my route /api/v1/product/detail/{sku:([\w\d]+-?)*[\w\d]*} Expecting both of these to match, however the later…
quickshiftin
  • 66,362
  • 10
  • 68
  • 89
1
vote
1 answer

getParam() always returns null

I'm trying to get the project id from the url using the router. Let's say this is my URL: http://boardash.test/tasks/all/7 and I want to get the 7 in my controller. I created a router using this: $router->add( '/tasks/:action/{project}', [ …
joostdelange
  • 113
  • 11
1
vote
2 answers

Path '' is not a valid target path (1) when using Assetsmanager in phalcon

This the error i get : Path '' is not a valid target path (1) #0 [internal function]: Phalcon\Assets\Manager->output(Object(Phalcon \Assets\Collection), Array, 'css') #1 C:\xampp\htdocs\PVO\app\views\index.phtml(17):…
Marcel
  • 11
  • 2
1
vote
3 answers

PhalconException: NameController handler class cannot be loaded

Tried with the question but it didn't fix my issue. : Phalcon tutorial error PhalconException: TestController handler class cannot be loaded My application is in AWS ubuntu 14.0 and some pages are working fine but for few pages, I'm getting this…
Mr world wide
  • 4,696
  • 7
  • 43
  • 97
1
vote
2 answers

Phalcon router sends the wrong parameters

I have a problem with my router in Phalcon. I have an action in my controller which ether takes a date parameter or not. So when I access an URL: http://example.com/sl/slots/index/2017-06-27 everything works ok. But when I go to:…
AlesSvetina
  • 403
  • 3
  • 6
  • 19
1
vote
1 answer

Phalcon Micro "handle()" method decodes URI

My Phalcon Micro application receives URI parts with encoded slashes (%2F). For example, before calling $app->handle(): echo $app->request->getURI(); // -> /resources/res%2F01/all But it looks like the $app->handle() method is decoding my URI,…
kagmole
  • 2,005
  • 2
  • 12
  • 27
1
vote
2 answers

Phalcon Micro - Secure Routes

I've just started trying out Phalcon Micro for my RestAPI's. Everything is working well, however I can't seem to figure out how to secure some routes, but not others. Has anyone had any experience in this area? - I've come from Slim where I can just…
Ben Kilah
  • 3,445
  • 9
  • 44
  • 56
1
vote
1 answer

Phalcon 3.04 IndexController handler class cannot be loaded

I made a project with modules type with this command phalcon project simkontrolprogja --type=modules When i am adding new module in my project called administrator by use this command phalcon module administrator i have add the module on…
Maulana Yusuf
  • 337
  • 2
  • 4
  • 16
1
vote
1 answer

Phalcon 2.x and 3.x routing breaks using regex or placeholder

Had to do a local dev system rebuild on my laptop running OSX, installed same Apache/2.4, PHP/5.6.27, and Phalcon/2.0.7 packages. Server code appears to be working correctly aside from routing (and .htaccess code is correct and adding to _url…
Doc Brown
  • 11
  • 2
1
vote
1 answer

How to append a GET parameter to all urls using Phalcon

Given a page retrieved at for example: http://myapp.dev/path/subfolder?param=abc Whenever the additional GET parameter called param is present it should be added automatically to all subsequent links in my navigation as constructed in the .volt…
Johan van den Broek
  • 384
  • 2
  • 5
  • 18