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.
106
questions
0
votes
1
answer
145
views
Phalcon 4.0 PHP - Controller handler class cannot be loaded
I am trying to create a basic application with Phalcon locally. I followed the documentation (https://docs.phalcon.io/4.0/en/tutorial-basic) and I created the same file structure and I copied the code ...
2
votes
0
answers
101
views
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 ...
0
votes
3
answers
504
views
Phalcon 4 documentation controller handler issue
I'm Using Phalcon 4.0.6 on windows 10,x64bit with psr & php version is 7.4.7. I follow basic tutorial example from "https://docs.phalcon.io/4.0/en/tutorial-basic" but I'm getting error like: "...
0
votes
1
answer
532
views
How to connect to database in Phalcon Framework 3.2.4 using SSL
I am trying to connect to the database in Phalcon Framework 3.2.4 using SSL.
Getting error:
SQLSTATE[HY000] [1045] Access denied for user 'dev_user'@'XXX.XX.XX.XXX' (using password: YES)
My ...
0
votes
1
answer
299
views
Phalcon\Mvc\View\Exception: Macro 'baseImagesURL' does not exist
I have defined a shared service baseImagesURL in my configuration Class but when I try to use it in volt it throws this error Phalcon\Mvc\View\Exception: Macro 'baseImagesURL' does not exist
/**
* ...
0
votes
1
answer
276
views
How to work around with routers? I want to check if the URI is exisiting like it's controller and action
I am a newbie in Phalcon PHP and I'm currently developing a CMS.
I am trying to create a blog module where the user can post blog with custom slug like with URL structure.
I am having a problem on ...
0
votes
2
answers
171
views
Phalcon Routing: Url not matching the route definition
I have following routes defined in Phalcon:
$router->add('/products', array(
'module' => 'products',
'namespace'=>'MyNameSpace\Products\Controllers\\',
'controller'=>'index',
...
0
votes
1
answer
139
views
Is there a way to use hash mark in Phalcon route pattern?
Is there a way to use hash mark in route pattern? I tried to use backslash before hash mark \#, but no result.
My code:
use Phalcon\Mvc\Router\Group;
$gr = new Group([
'module' => 'home',
]);
...
0
votes
1
answer
57
views
phalcon router not despatching
I have this in the top of my index.php:
<?php
use Phalcon\Loader;
use Phalcon\Di\FactoryDefault;
use Phalcon\Mvc\View;
use Phalcon\Mvc\Application;
use Phalcon\Mvc\Url as UrlProvider;
use Phalcon\...
0
votes
1
answer
164
views
Undefined variable: user in view on line 60 NULL Phalcon
I'm trying to pass an array in redirect to another page but it say undefined variable user
return $this->response->redirect($this->MyHelper->Route('eb-user-verify-reset-password-code'), $...
1
vote
1
answer
324
views
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' =...
0
votes
2
answers
231
views
Phalcon Routing exclude Routing to Controllers when File Exists
I have some css .map files directly under assets folder, however for some reason they failed to load and i get a 404 error in the dispatcher and router. Any solution on how to fix this issue ? i added ...
2
votes
1
answer
1k
views
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 ...
0
votes
2
answers
313
views
Phalcon PHP: Dispatcher's `forward` function does not work
Within the reentryAction in my CustomerclientController I want to forward into the indexAction in case of successful validity check of the post parameters.
Unfortunately, the forward doesn't work. ...
0
votes
1
answer
377
views
Phalcon installation on ubuntu 16.04 LTS with XAMPP server
I hope you have a good day, I need your help.
I do not know how to install Phalcon 3 in my version of ubuntu. I would like you to indicate to me every step I have to take, thank you very much!
...
1
vote
1
answer
156
views
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(
[
'...
1
vote
1
answer
167
views
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]*}
...
1
vote
1
answer
760
views
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:
$...
0
votes
1
answer
91
views
Micro app router map->via with collections?
I'm setting up a Phalcon app using the Micro class. I'm setting up my router to use the Collection class so that I can use a controller to split up the functionality and keep it fairly contained.
...
0
votes
2
answers
320
views
Define dynamic actions/slugs with Routers in PhalconPHP
I have a website made in PHP Phalcon, and it has several controllers.
Now I need this website to receive words in the URL (example.com/WORD) and check if they exist in the database, but I must ...
1
vote
2
answers
176
views
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\...
1
vote
2
answers
8k
views
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 ...
0
votes
1
answer
754
views
How to define route in phalcon
I have controller named GlossaryController with 2 actions indexAction and anotherAction in view i have a directory glossary and index.volt file
i want to define a route with parameters for example
...
1
vote
2
answers
376
views
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
...
0
votes
1
answer
322
views
Phalcon PHP not routing for subdomain
I have one website, let's call it www.main.com, which is located on the server at /home4/username/public_html/main. This site is running Phalcon PHP with no issues at all.
Now I have made a subdomain,...
1
vote
1
answer
136
views
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 ...
0
votes
1
answer
592
views
Phalcon\Micro: Execute another controller action in action
I have a controller action which gets executed on one server. This action has to trigger two other services which can be on the same or other server (depending on the configured routes). Currently I ...
2
votes
1
answer
436
views
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 ...
0
votes
1
answer
389
views
Phalcon route not working, all urls access index
I use phalcon-dev-tools-v2.0.13 create a project named test,I accessed root url "/",it worked!then,I change some code like this:
it worked!
but:
i add another url ,it didn't work!
what's the ...
1
vote
2
answers
218
views
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 ...
1
vote
1
answer
1k
views
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 ...
0
votes
0
answers
180
views
Controllers do not work
I've recently started to use Phalcon framework. It looks very good with one minor exception - I cannot make controllers work. This is what I have:
//IndexController.php
namespace MyNamespace\...
1
vote
1
answer
110
views
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 ....
2
votes
1
answer
91
views
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 ...
0
votes
1
answer
168
views
Phalcon 3.0 to Phalcon 2.0 compatibilty
I had created a barebone Phalcon 3.0 project with Devtools 3.0, it worked fine on my machine
Then I uploaded to my web host service, and it reproduced error message:
Argument 1 passed to Phalcon\Di\...
-6
votes
1
answer
97
views
Email Error in Phalcon
I am new user of phalcon php I face a problem when try to send email using Phalcon Php Screen Shot of Error is Given Below
0
votes
0
answers
261
views
PHP Phalcon Routing with file extension
In my PHP Phalcon 3 Application I have a custom route:
$router->add("/{chapter}/{name}.{type:[a-z]+}", array(
"controller" => 'images',
"action" => 'getFile',
));
I test ...
2
votes
2
answers
181
views
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 ...
1
vote
1
answer
1k
views
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 ...
2
votes
1
answer
2k
views
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:
$...
0
votes
1
answer
1k
views
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....
0
votes
3
answers
97
views
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 ...
1
vote
0
answers
371
views
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 ...
1
vote
1
answer
80
views
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 ...
1
vote
1
answer
408
views
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\-]+...
0
votes
0
answers
313
views
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.
...
2
votes
1
answer
431
views
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(
...
0
votes
1
answer
387
views
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.
3
votes
1
answer
112
views
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(...
1
vote
1
answer
2k
views
Redirecting to 404 route in PhalconPHP results in Blank Page
I have setup a router, and in it, defined a route for 404s:
<?php
use Phalcon\Mvc\Router;
$router = new Router(FALSE);
$router->removeExtraSlashes(true);
$route = $router->add('/', ['...