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 get the post parameters in before dispatch loop phalcon

We can access post data in controller something like this: $request = $this->di->get("request"); $data = $request->getJsonRawBody(); But is there any way to access POST data in services.php. I wanted to access it in an event: if ($event->getType()…
user1740757
  • 87
  • 1
  • 10
0
votes
3 answers

I need some understanding of the routing of a multi module Phalcon application

I need some help with a multi module Phalcon application. I followed the instructions as per https://github.com/phalcon/mvc/tree/master/multiple but cannot get the variable routing working for the non default module. $router = new…
Alvin Bakker
  • 1,456
  • 21
  • 40
0
votes
0 answers

Phalcon: Cookie-> set not working when calling a route using file_get_contents?

Setting cookie functionality is not working when I'm calling a route fro PHP filegetcontents method? and It's working with jQuery $.ajax. What is the mistake i've done? Please help me to solve this. Route: $api->addGet('/setmycookie/{cookievalue}',…
0
votes
1 answer

How to create dynamic routing in phalcon?

I have read the documentation of phalcon routing and cannot find the one like i needed. /{param1}/{param2}/{param3}/controllerName/actionName/{param4} Help me guys.
0
votes
1 answer

Controller usage get crash on Phalcon 2.0.9

So now, I code on my project using micro phalcon. It seems work without using controllers. By the time my code get bigger and bigger for increasing number of API routes. I put all of my codes in app.php. Is there any chance of me to get better…
0
votes
1 answer

Phalcon PhpFramework - Routing

Have an application using phalcon and I wants routes URLs like this : http://localhost/my-website/admin/cat -> use the "cat" controller and not the "admin" controller Have done this and its works $router = new Phalcon\Mvc\Router(); …
Guillaume
  • 13
  • 5
0
votes
1 answer

Is it possible to dynamically change view name or create a view that does not exist yet in phalcon?

I would like to know how can i do this in phalcon. I have a web site build with phalcon. All is working great now i stumbled upon a problem, here is what i need. When a user clicks on a post that was created by another user. It takes him to this…
mpotoc
  • 87
  • 5
0
votes
2 answers

Phalcon: why router's routes are not being called?

I have the following index.php:
AngryChicken
  • 360
  • 2
  • 16
0
votes
1 answer

Correct regex for param after an optional forward slash

What is the correct way on PHP, Phalcon Framework on how to optionally escape a forward slash "/" that has optional parameter at the end. I want to…
Louie Miranda
  • 1,071
  • 1
  • 20
  • 36
0
votes
1 answer

Phalcon dispatcher getParam default value is not set as expected

I'm trying to make pagination for a listing page, and I'm having problems setting default value for $page with getParam method from dispatcher. The URL is like this : (http://www.example.com/category/subcategory/page_number_here) This is how I get…
0
votes
1 answer

How to make the user manually select either english/japanese language for an existing project

I have developed a small project using phalcon, in which the default language is japanese, but now the requirement is like a user should manually select either english or japanese language by clicking any of these two links from the homepage. How to…
0
votes
2 answers

Cannot extends Model

I want to create a class which extends Model :
pheromix
  • 18,213
  • 29
  • 88
  • 158
0
votes
1 answer

PhalconPHP - Groups of Routes

I am using Phalcon Framework and would like to learn how to group routes. The official documentation did not help me that much. This is how my routes look like: $app->get('/users', function() { // do something }); $app->get('/users/{id}',…
daryqsyro
  • 157
  • 2
  • 9
0
votes
2 answers

Phalcon subdomain routing

How to connect to the subdomains Phalcon: city1.site.com city2.site.com city3.site.com ... cityN.site.com city - in the database I am trying to do so $router->add('{subdomain:\w+}.{domain:.+}', array( 'controller' => 'category', 'action' =>…
0
votes
1 answer

How to add .html end of URL

I'm new with Phalcon PHP. I can't figure out how can I add .html to end of url for every page. I already looked up docs. Nothing related to this isn't in docs Thanks,
user2678561