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
0
votes
1 answer

How to subclass Phalcon\Mvc\Router\Route?

In Phalcon 1.3 I can return My\Mvc\Router that extends Phalcon\Mvc\Router. Question: how can I swap in a custom matched route of My\Mvc\Router\Route type ? Thanks!
temuri
  • 2,767
  • 5
  • 41
  • 63
0
votes
1 answer

Pass phalcon route value to angularjs

Not able to pass phalcon route key to angularjs Route: //Define a route $router->add( "userList", array( "controller" => "user", "action" => "get", ) ); With in AngularJs: …
khanz
  • 205
  • 1
  • 9
0
votes
2 answers

PhalconPHP - redirection to home page always adds /index in the URI

I'm working on my first app in PhalconPHP so I'm deep in the documentation while working, but this doesn't seem to be covered. Let's say that my app is running on www.myapp.tld. In some situations I need to redirect the user back to the home page…
Vorta
  • 91
  • 13
0
votes
1 answer

Controller handler class cannot be loaded

I ran a scaffold "phalcon scaffold beauties" Loaded up localhost:8000/beauties and it loads fine, however when I click Create beauties link I receive the following error: BeautifyController handler class cannot be loaded I run Phalcon using…
Toothfairy
  • 383
  • 1
  • 6
  • 24
0
votes
1 answer

Phalcon router addGet error

I'm developing a website using the PHP Phalcon Framework and I am really stuck in a problem with the router, here I go. In order to restrict the HTTP Method for your route to match, I use this declaration: $router->addGet('/admin/paginas', array( …
0
votes
1 answer

PhalconPHP set default controller and default action

How do I set default controller and default action in PhalconPHP? I have used this code without success: $di->set('router', function () { $router = new \Phalcon\Mvc\Router(); $router->notFound(['controller' => 'Index', 'action'=>…
Tuyen Nguyen
  • 4,389
  • 7
  • 51
  • 77
0
votes
1 answer

routing aliases in micro phalconphp

I'm building an api using the micro framework. I have the following routes: /users/{user_id} /users/{user_id}/friends /users/{user_id}/pictures Whats the cleanest way to create the following aliases? /me /me/friends /me/pictures
Boedy
  • 6,647
  • 1
  • 21
  • 24
0
votes
1 answer

Phalcon + Nginx Routes / Rewrites not working

I finally got Phalcon+phpfpm+nginx on a Osx to work... trying to setup a quick REST application I am stuck, I believe with an nginx rewrite. I am always getting a Route not matched error. File Structure: /myapp/ public/ index.php app/ …
smorhaim
  • 778
  • 1
  • 9
  • 24
0
votes
1 answer

phalcon - insert data through loop is not working

I'm trying to save data in phalcon framework using model. My actual goal to loop through the array and insert them using that loop. But problem is it's always inserting the last value of the array. Example: $tags = [1,2,3,4] But when I execute the…
nixon1333
  • 531
  • 1
  • 9
  • 23
0
votes
1 answer

Micro Collection of Routes with handler not matched

What I am trying to accomplish is the following $collection = new Phalcon\Mvc\Micro(); $collection->setHandler(new…
Joel Hernandez
  • 1,817
  • 4
  • 18
  • 27
0
votes
1 answer

Sub-routes with Phalcon

I'm having some trouble extending some of the URLs that I want to access with Phalcon. Right now I'm using a single module setup (as referenced here). This works great if I want to access something…
0
votes
3 answers

Phalcon unable to find class

Hello all im trying to load multiple libraries which is in different folders in library folder using namespaces but i keep getting not found My directory structure is like this app/ controllers/ models/ library/ views/ My…
mega-crazy
  • 838
  • 2
  • 17
  • 36
0
votes
1 answer

How to add prefix to a controller in Phalcon PHP

I'm working on a website using Phalcon PHP that has an admin section mywebsite.com/admin I have created two different controller folders (frontend-controllers & backend-controllers) an depending on the URL, I'm loading the right folder. I would like…
RPDeshaies
  • 1,826
  • 1
  • 24
  • 29
0
votes
1 answer

Unable to unset Phalcon aliases

I am using INVO example app from here: https://github.com/phalcon/invo I have copied all the files and set the db and base url. It works, I can login etc. however, I wanted to learn how to use redirects e.g. I would like to use contact-us instead…
user3797244
  • 53
  • 1
  • 5
0
votes
1 answer

Unable to register route in $di Phalcon

I am unable to register custom routes in phalcon. I have no idea what is the problem. $di['router'] = function () { return require __DIR__ . '/config/routes.php'; }; in routes file i have $router = new…
User707
  • 182
  • 2
  • 8