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

How to fallback to IndexController when Controller not exist in Phalcon?

When I enter url like: http://localhost/asdfasdfasdcxccarf Phalcon is giving me this message: PhalconException: AsdfasdfasdcxccarfController handler class cannot be loaded Which is logical, because this controller doesn't exist. However, how can I…
user3797244
  • 53
  • 1
  • 5
3
votes
1 answer

Forward anchor withing page in Phalcon

In Phalcon I finish one of my actions with forward response with parameters and I would need adding an anchor (e.g. to end the forwarded response with #blabla. return $this->dispatcher->forward(array( 'controller' => 'foo', 'action' =>…
Jan Drábek
  • 146
  • 6
3
votes
0 answers

PHP Phalcon Wild card routing in multi module application

UPDATE This is now fixed with this solution. foreach (array('core', 'backend' => array('alias' => 'admin'), 'api') as $module => $options) { // If an alias is set use that if (isset($options['alias']) &&…
Kal
  • 2,239
  • 6
  • 36
  • 74
2
votes
0 answers

Phalcon 4 namespace bug factor

I'm on windows 10 server edition x64 Architecture using Phalcon 4.0.6, php-7.4.7 with xampp & psr-1.0.0. Following example from: 'https://docs.phalcon.io/4.0/en/application'. I'm unable to load controller output / views output without any error…
Styled Bee
  • 141
  • 1
  • 12
2
votes
1 answer

Incorrect datetime value: '1540564519' for column 'date_updated' at row 1 On saving model Phalcon?

I'm trying to save data in a table but when i save it throws the below error: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '1540564519' for column 'date_updated' at row 1 On saving model …
Imad uddin
  • 147
  • 1
  • 2
  • 11
2
votes
1 answer

Phalcon REST API structure

I am developing REST API using Phalcon. The application will have multiple modules like Users, Company, Contacts and so on. Each of these modules have their own tables for storing data. Moreover each module have their own defination file which…
mary josh
  • 21
  • 4
2
votes
1 answer

url redirect in mvc . i want to redirect localhost/windshield-replacement.html to localhost/greenvalleyaz

My applications is now in phalcon php framework. I want to redirect a url which contain .html at the end. To redirect, I wrote the controller name as WindshieldReplacementHtmlController.php but because of the dot in between I could not redirect. How…
Abid
  • 344
  • 1
  • 4
  • 21
2
votes
2 answers

How to show the tab in phalcon

I have set of code of tutorial INVO as pre the Phanlcon Official documentation. I just want to customize the code as per my need, So I wrote some code to prepare a fresh Module. I created the below files that are needed to create the full…
Aman Garg
  • 3,122
  • 4
  • 24
  • 32
2
votes
1 answer

Phalcon view not loaded

I'm trying to load a template in PhalconPHP (v 2.0.13), but even the simplest example doesn't seem to work. I'm trying to access http://www.mysite.dev.fb/forms/ in this example. Here is my router: $router->add( '/forms/', [ …
Veselin Bakov
  • 103
  • 1
  • 11
2
votes
1 answer

Routing in Phalcon - parameter before the end of the route

I'm trying to set up routing in Phalcon, following this URL structure: www.example.com/language/register/ This is my routes.php: use Phalcon\Mvc\Router; $router = new Router(); $router->add( '/[a-z]{2}/register/', array( …
mpdc
  • 3,550
  • 5
  • 25
  • 48
2
votes
0 answers

Phalcon does not receive GET URI with escaped html characters

I have a GET URI /phalcon-dash/change/action/get/c123h%23516466 In ChangeController, I only have this $params = array('get', 'c123h') It looks like Phalcon omits everything after # (%23 is the encoded of #) Do I need to do anything to make Phalcon…
lightbringer
  • 835
  • 2
  • 12
  • 24
2
votes
1 answer

Phalcon 2.x skeleton app with modules doesn't produce 404 Not Found if path is not found

I've generated a skeleton app using dev tools that has a single module. The problem I have is that whatever URL I type in the browser - it always returns the content in apps/frontend/views/index.volt (frontend is the module name). Here is my…
intellion
  • 1,397
  • 12
  • 27
2
votes
1 answer

Phalcon PHP: Modify a request URL before it gets dispatched

I'm looking for a way to modify a request URL before it gets dispatched. For instance, the following URLs should be handled by the same controller/action: /en/paris /de/paris /paris I would like to capture the country code if it is present, then…
olvlvl
  • 2,396
  • 1
  • 22
  • 22
2
votes
2 answers

Phalcon ActionFilters

I'm learning Phalcon (trying REST API in multi-module application template), and I did simple checking for each request, "does this request contain specific header" for example x-api-key (something like ActionFilters in ASP.NET MVC). I tried doing…
user2987281
  • 200
  • 1
  • 14
2
votes
1 answer

Phalcon Multi module - Dynamic Module registration

Hi guys Im using the following structure for a multi-module project in Phalcon [modules] [module1] [controllers] [models] [views] [module2] [controllers] [models] …
Madhukumar
  • 21
  • 1
1
2 3 4 5 6 7 8