Questions tagged [phalcon]

Phalcon is an open source, full stack framework for PHP. Functionality is exposed as PHP classes ready to be used. Written as a C extension, it is optimized for extremely high performance, being the fastest possible framework available for PHP developers.

Filter by
Sorted by
Tagged with
0 votes
1 answer
268 views

Phalcon 3.4: Inject a component in a controller action without using dispatcher events

I am trying to use laravel way to inject a component in a controller action, see this example from laravel: class UserController extends Controller { /** * Store a new user. * * @...
wajdi_jurry's user avatar
0 votes
1 answer
255 views

How to Force Phalcon to pick view from another module instead of defined?

Currently I am loading all users on URL/Route /admin/config/users which is picking this view ( private/apps/Admin/Views/user/users.volt ) from Admin module. Now I have set a flag for custom layout. ...
Iftikhar uddin's user avatar
2 votes
1 answer
1k views

Phinx migration error, "Could not find class" but looking in the correct file?

I'm trying to run database migrations using the phinx library for a Phalcon framework example project called 'Vokuro' and I'm getting this error. The file directory is correct so I'm clueless as to ...
Thomas Parfitt's user avatar
0 votes
1 answer
850 views

PHP issue with Chinese characters

I have tried all the possible solutions listed on SOF, but not a single solution works for me (Maybe am doing something not appropriate). Recently I have upgraded my infra, upgraded from PHP 5 to PHP ...
Syed Zeeshan Ali's user avatar
1 vote
1 answer
209 views

Where to create a file for custom filter css code in phalcon 4?

Where to add filter code to minify CSS code? Do I need to register a directory, etc.? Customer Filters Documentation - everything is clear in the documentation, except where to create these custom ...
bhairava's user avatar
0 votes
1 answer
918 views

How do I add a condition to ElasticSearch Aggregation (min/max)?

I want to query to my Elastic-Search to get minimum price of values which have only positive value. My prices can also be zero and -1; so I don't want my min-aggregation to return 0 or -1. I know that ...
Matin Hajatdoost's user avatar
0 votes
1 answer
119 views

Phalcon 4.x creates multiple folders to store cached data. What is the benefit of having recursive and multiple folders?

$hash = '123456789'; $fileName = "test.{$hash}.html"; the final directory structure will be like following. te/st/.1/23/45/67/test.123456789.html it simply breaks down the file name in to ...
user3872505's user avatar
0 votes
1 answer
896 views

PHP can't display Chinese character

I just migrated my codebase to a new server. Previously, the user saves Chinese characters to the MariaDB database. In the database it saves as below: This is the text when I copy the content from ...
ahmadruhaifi's user avatar
0 votes
1 answer
81 views

Xdebug trace Phalcon can not save trace file

I am using Xdebug to trace PHP. With Laravel project it works well. php.ini set is like that: zend_extension="/opt/bitnami/php/lib/php/extensions/xdebug.so" xdebug.default_enable = On xdebug....
孟庆超's user avatar
1 vote
2 answers
276 views

Calling $this inside Model in Phalcon

I need reanimate an old site, that was made by another programmer a long time ago. The site is built on Phalcon and I don't know which versions of PHP are supported. I'm seeing many errors like: ...
raskalbass's user avatar
1 vote
0 answers
464 views

Phalcon Backend Controller Not Loading

I'm New in Phalcon framework. I'm testing my first multi module phalcon project with : Phalcon-4.0.3, i have install psr and i'm following example from phalcon documentation. everything is normal ...
ANIKA MACHINERY's user avatar
0 votes
2 answers
125 views

Cannot load custom routes in Phalcon PHP

Until yesterday my Phalcon PHP application was running perfectly on PROD and today is working only on DEV and LOCAL environments... and I don't have a clue what is going on there! The codebase is ...
NitroGlyzerina's user avatar
2 votes
2 answers
520 views

Phalcon 4 multi module backend not loading

I'm in windows using php-7.4.1 Architecture-x64, phalcon - 4.0.2, psr - 0.7.0 and follow instruction from 'https://docs.phalcon.io/4.0/en/application' but the problem is its always render frontend ...
munaz's user avatar
  • 166
0 votes
1 answer
63 views

How to check in view if my environment is production?

How to check in view if my environment is production? I am new to Phalcon so sorry if my question is dumb.
Nikolay Sobyanin's user avatar
-1 votes
1 answer
68 views

How to change the offset based on the result

In MYSQL (where also php is allowed) assume we have the items table that consists of id, name, status. And you want to get the item before the last, the following query would work perfectly SELECT *...
Kareem Essawy's user avatar
1 vote
1 answer
80 views

Getting the weird hexadecimal code on the top of the page of the sitemap

I have been struggling with this weird issue. I have created the sitemap of a website. The sitemap is dynamic and has a huge set of URLs. The problem I'm facing is that google is not accepting it. ...
Zeeshan Faiz's user avatar
1 vote
1 answer
460 views

PhalconRest\Http\Response::setJsonContent declaration fatal error

Initially used PHP 7.1.1 and Phalcon 3.4 to support API end. Once upgraded the PHP 7.2.24 and Phalcon 4.0.0 we faced the Phalcon response issue when calling the API. We mainly used Phalcon-rest to ...
RmR Mohan's user avatar
0 votes
1 answer
523 views

How to replace class with mock in DI? Phalcon + Codeception

I try writing functional tests for my controllers using Codeception testing framework. I want to replace real service in DI with fake one. Controller code example: <?php namespace App\...
Denys Kurbatov's user avatar
2 votes
1 answer
674 views

Form GET request is firing twice

I have two search boxes one for desktop and another for mobile version. On form submit the GET request is firing twice! I thought it was the issue of two same form on the same page BUT I removed the ...
Iftikhar uddin's user avatar
2 votes
1 answer
636 views

installation error phalcon on MAMP or XAMPP on macOS

I'm trying to install phalcon on xampp or MAMP on macOS please tell me how to install correctly phalcon on MAMP(I get the same errors during installation on XAMPP) i use this tutorial https://...
Denys Maksiura's user avatar
1 vote
0 answers
55 views

Cannot assign databases to 2 different users

So I'm using hostinger as my webhost as they supprt phalcon framework, But the way my site was developed it doesn't support the user of 2 users for 2 different databases, its use to 1 use per 2 ...
lowkeydude's user avatar
0 votes
1 answer
844 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 ...
jones's user avatar
  • 759
0 votes
0 answers
1k views

Why does Docker container exited with code 0 and does not expose 9000 port for connection

Can anyone help me to understand why my Docker container exited with status 0 or debug this further. I'm trying to run Phalcon framework on CentOS7 with no luck: php-phalcon exited with code 0 ...
Aleksandr Popov's user avatar
0 votes
0 answers
440 views

POST and PUT Requests not working from Phalcon website to Prestashop web service

I'm facing an issue since a while now while trying to send POST or PUT request to Prestashop Webservice from another website developed with PHP framework Phalcon. Here is the code i'm using to ...
Mavoli's user avatar
  • 31
1 vote
1 answer
1k views

not able to install phalcon ubuntu 19.10 with php7

I am trying to install phalcon on ubuntu 19.10 where php version is php7.3, php7.1 and php7.0. When I try to install php-phalcon sudo apt-get install php7.0-phalcon Reading package lists... ...
urfusion's user avatar
  • 5,526
0 votes
3 answers
586 views

How can I optimise COUNT with GROUPBY mysql query?

I have 5M records in eus table and 121 records in es table. I am doing a left join but the COUNT query is making my query very slow. How can I optimize this? public static function ...
Iftikhar uddin's user avatar
0 votes
1 answer
369 views

How can I add dismiss icon to phalcon session flash message with bootstrap

My service configuration is as below; $di->set('flashSession', function () { return new FlashSession([ 'error' => 'alert alert-danger', 'success' => 'alert alert-success',...
Phalconer's user avatar
0 votes
1 answer
351 views

Access to undefined property in SETTER function while calling findFirst model function with Phalcon 3.4.4/PHP 7.3

Access to undefined property exception thrown in setter function when I fetch record by Example::findFirst($id) E_USER_NOTICE: Access to undefined property Example::property_five in /path/to/Example....
Manoj's user avatar
  • 65
0 votes
0 answers
116 views

Phalcon 3.4.0 does not bootstrap with PHP 5.6.33-0+deb8u1

502 Bad Gateway on loading the page with PHP 5.6 but it loads with PHP 7.3, It returns 502 bad gateway on this line echo $application->handle()->getContent() PHP Version : 5.6.33-0+deb8u1 Loaded ...
Manoj's user avatar
  • 65
0 votes
1 answer
546 views

SQL injection in PHP Phalcon

I just learning SQL injection and try to inject my PHP based code (with PHP Phalcon framework). I try to do SQL injection in my login. However, when I try to do the injection, I cannot do it and I do ...
alcantula's user avatar
  • 169
0 votes
1 answer
565 views

Phalcon cannot find controller. Error 404 Not found

I started with a phalcon project and used this tutorial (https://docs.phalcon.io/3.4/en/tutorial-base#basic). But i've got a problem with my controllers. In my index controller i have: echo $this-&...
Per Slegt's user avatar
1 vote
1 answer
417 views

Phalcon Migration - How to remove database columns?

I am looking at creating a phalcon migration that will remove some columns from a table within my database, however I am struggling to understand how we remove the columns and the documentation doesn'...
lky's user avatar
  • 1,071
0 votes
1 answer
581 views

Response data in json fromat of two tables with mapping using phalcon

I am trying to get response of the data in json format of two tables user and project where they are related in hasMany(users) and belongsto(project).I want json response in the same object according ...
Gautam Gounze's user avatar
0 votes
1 answer
1k views

Get DateTime object from Phalcon Model for DateTime column in PHP

In the database table there are some columns with DATETIME type. Is there any way I can get Phalcon Model to convert them automatically from string to DateTime object in PHP and vice versa without ...
Tom Truong's user avatar
2 votes
0 answers
436 views

Stripe payment SCA

My current Stripe code is as below: as I pass to stripe. Had been using following Stripe Library: https://github.com/stripe/stripe-php Its working fine as of now. Now I need to change code according ...
Paul P Jose's user avatar
1 vote
1 answer
3k views

Access denied for 'user'@'localhost'

I'm trying to create model using phalcon. But when I type phalcon model polls I get an error as ERROR: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES). I can ...
aabdugaliyev's user avatar
1 vote
2 answers
429 views

PHP Phalcon. Use postgres nextval(sequence) in model

I have a table in Postgres with DDL like this one: CREATE TABLE robots( robot_id INTEGER NOT NULL CONSTRAINT robot_id_pkey PRIMARY KEY, name TEXT ); I know I can insert a record with ...
Alexey Chuhrov's user avatar
0 votes
0 answers
47 views

Why it return error when I indicate a params with the type on initialize method?

I indicate params with type on initialize method: class ContactForm extends Form { public function initialize($entity = null, array $options = []) { } } When try to create object of the ...
Turarbek Boytov's user avatar
0 votes
1 answer
398 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 /** * ...
Iftikhar uddin's user avatar
1 vote
1 answer
521 views

How to fix `Undefined index: db_host ` in phalcon config

I have configured server. At last I am getting this issue to make connection. This is New Linux server as per http://157.245.105.194/test.php Let me know what is wrong in the code given at : https://...
Om Vir's user avatar
  • 13
0 votes
1 answer
346 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 ...
Furtim's user avatar
  • 23
2 votes
2 answers
4k views

Php can not load module phalcon

I successfuly installed phalcon 4.0 framework. Also I check phpinfo() on browser and there is phalcon, but if check php modules, there is not the palcon. Also if I check php module by this command, ...
Турарбек Боютов's user avatar
1 vote
2 answers
2k views

Performance MySQL query with for loop

In this method, first I have to get sundays dates between two dates, in this case about 1 year. Then I go through the dates in a for loop and set them to the query. I use prepared statements to make ...
Fabian Sierra's user avatar
0 votes
1 answer
74 views

Compiling phalcon - needs 2GB, I have 0.5GB, is there a workaround for the small vps?

As subject - I have a 500MB vps with Centos 7, I want to put phalcon on it for its low resource demands. But it needs 2GB to compile. I can't increase any storage. Is there a workaround?
gedq's user avatar
  • 609
-1 votes
4 answers
777 views

PHP increment booking number according to the last booking number in database

I'm using PHP 7 with Phalcon PHP and I'm trying to create a method to generate a booking number. Here is my current method : public function generateNumber($company_code) { // Build the prefix : ...
John's user avatar
  • 4,731
5 votes
1 answer
4k views

Why I'm getting Swift_TransportException: Unable to connect with TLS encryption in Server?

I have migrated to new server from old server. There are quite changes in new server. Old server was using PHP 5.6 and phalcon 3.2 and new server is using PHP 7.3 & phalcon 3.4.4. In old server ...
Iftikhar uddin's user avatar
0 votes
2 answers
483 views

Phalcon moveTo function is not moving files to target directory in server?

I'm trying to upload an image to a specific directory but the function moveTo is not moving the image. public function uploadRecipeImageAction() { if ($this->request->hasFiles() == true) { ...
Iftikhar uddin's user avatar
0 votes
1 answer
99 views

Autloading Phalcon Incubator - MongoDB

I have a question about autoloading. I need to use the MongoDB adapter that comes inside the Incubator and I am seeing that in the documentation it says register the namespace Phalcon <?php $...
Infobuscador's user avatar
0 votes
2 answers
219 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', ...
WatsMyName's user avatar
  • 4,240
0 votes
0 answers
190 views

Phalcon: rendering output to variable returns empty string in prod server

I have phalcon 3.4.4 installed on windows 01 with php 7.3.7 in my local machine. i have following code <?php $view = $this->view; $view->setRenderLevel(\Phalcon\Mvc\View::...
WatsMyName's user avatar
  • 4,240

1 2 3
4
5
41