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.
628
questions with no upvoted or accepted answers
6
votes
1
answer
1k
views
Combining and and or operators in Phalcon\Mvc\Model\Criteria
I'm just writing my first phalcon application and have a question for filtering a query using Phalcon\Mvc\Model\Criteria.
Finally I want a query like this
SELECT *
FROM table
WHERE
status = 'A' ...
5
votes
0
answers
290
views
Restangular send 403 forbidden error or XMLHttpRequest error from dirrenet host
I wrote this easy comet implementation
var app = angular.module('App', ['restangular', 'Comet']);
app.config(function(RestangularProvider) {
//RestangularProvider.setBaseUrl('http://...
5
votes
1
answer
2k
views
Check bcrypt passwords always fails Phalcon php
I have a little issue with checking bcrypted passwords with Phalcon php. What I have is :
Login script where I check the password
$username = $this->request->getPost('username', 'string');
...
5
votes
6
answers
3k
views
Can't call indexController's actions other than indexAction in Phalcon php
I have a simple project in my xampp/htdocs directory called phalcon and I have apache configured to point to that folder so that I can go to phalcon/ in my browser.
The problem occurs when I try to ...
4
votes
1
answer
735
views
Class not found, namespace, subfolder
I have cli app with a couple of classes which resides in /core/modules. Too much, so I want some of them to be in /core/modules/evaluate/ with Class Core\Modules\Evaluate\Something. On my local ...
4
votes
1
answer
2k
views
phalcon querybuilder total_items always returns 1
I make a query via createBuilder() and when executing it (getQuery()->execute()->toArray())
I got 10946 elements. I want to paginate it, so I pass it to:
$paginator = new \Phalcon\Paginator\...
3
votes
0
answers
415
views
Error installing phalcon 4.0.5 on php-fpm-alpine docker
When I try to make custom docker image with php:7.4.4-fpm-alpine and install phalcon 4.0.5 with pecl on it, there is an error on compiling phalcon
creating libtool
appending configuration tag "CXX" ...
3
votes
1
answer
1k
views
PHP Startup: Unable to load dynamic library 'phalcon.so'
I am trying to run phalcon in php but it seems from the errors that it cannot load it.
PHP Warning: PHP Startup: Unable to load dynamic library 'phalcon.so' (tried: /usr/lib64/php/modules/phalcon....
3
votes
1
answer
475
views
Phalcon PHP : Jquery Datatable Server Side individual column filtering only gives first pages selection options
Here is my Jquery Server Side DataTable set up, correctly returning data from my database and the filtering does actually work, but the problem is that the selection box for each column only shows ...
3
votes
0
answers
198
views
Class entry requested for an object without PHP class - segfault
We've recently began seeing segfaults occurring with the following crash message:
Class entry requested for an object without PHP class in
.../StatementTransformer.php on line 140
The error ...
3
votes
0
answers
433
views
Phalcon: Custom Access Control List not setting permissions
I am trying to follow an online tutorial in Phalcon PHP, and I'm at the stage where we are creating an ACL, and setting permissions based on the user's role (which is pulled from a session variable).
...
3
votes
1
answer
969
views
Phalcon - mock models for unit testing
I am trying to perform a Unit test in my Phalcon app. I have setup the Unit test environment according to the tutorial provided.
What I am trying to do is to mock database adapter only for several ...
3
votes
1
answer
220
views
How to autoload PayPal classes with Phalcon autoloader?
Phalcon autoloader is configured in the following way:
$loader = new Phalcon\Loader;
$loader->registerDirs(array(
'../app/4/controllers/',
'../app/models/',
'../app/services',
'../...
3
votes
1
answer
578
views
Phalcon PNG to JPG and remove transparent background image
I'm using Phalcon PHP Phalcon\Images\Adapter\GD and I have a problem with the PNG to JPG.
When I upload a PNG image on my server, I resize this image, I set the background color in white with the ...
3
votes
1
answer
137
views
PHP Namespace collision with Phalcon, Vagrant, Apache2
I have this strange problem that I can best describe as "namespace leakage". I have setup a vagrant box running Apache2 with VHosts setup to replicate the production server in terms of domains & ...
3
votes
1
answer
180
views
Phalcon url parameter missing but action still gets executed
I am using the latest phalcon version and i am finding it hard to find info on how to make the action not execute when the required parameters are missing as shown below
class TestController extends ...
3
votes
0
answers
263
views
Phalcon Application sending "No data received" on production, but not localhost
I am writing a Phalcon PHP website on windows and on my local server everything works as specified. When the base url is reached, it forwards to my public folder with .htaccess and loads index.php. ...
3
votes
0
answers
1k
views
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
...
3
votes
1
answer
4k
views
Related models with conditions in Phalcon
How to setup filtering on related model data using $this->hasMany() or $this->hasOne() in model?
For instance:
I have SomeData table which can be referenced to ModalA or ModelB.
In ModelA and ...
2
votes
0
answers
104
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 ...
2
votes
0
answers
399
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 ...
2
votes
0
answers
2k
views
How to optimize performance in many to many relation?
I have 3 tables (MySQL):
Students
Groups
StudentsToGroups
All tables presented like models and have their own classes.
So, I want to show in view list of students with their group's names. Very ...
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 ...
2
votes
1
answer
146
views
Phalcon route groups 404 not working
I have URL's:
site.com/sdfsdfsdfsd - 404 Working
site.com/ru/page/sdfasdfasfasdfsad - not working, I get redirect to main page
$router->add('/', array(
'module' => 'frontend',
'controller'...
2
votes
1
answer
271
views
Phalcon route conflict
I have a problem with routes on phalcon. I have code:
$router->add('/{aliascat:[0-9\-a-z\-]+}(/?)', array(
'module' => 'frontend',
'controller' => 'category',
'action' => 'view',
'...
2
votes
1
answer
444
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 ...
2
votes
1
answer
185
views
Insert array into postgresql error
I using Phalcon Framework and PostgreSQL
I try to insert an array to database column type: varchar[]:
array(4) { [0]=> string(1) "1" [1]=> string(1) "6" [2]=> string(1) "9" [3]=> string(...
2
votes
0
answers
429
views
Understanding the core dump after Segmentation Fault | Phalcon + Php + Apache
I have managed to get the Core dump after a segmentation fault caused in an env that has
Phalcon 1.3.1
Php 5.5.9
Apache 2.4.7
Running on
Ubuntu 14.04
Core dump : http://pastebin.com/KeWipxU9
...
2
votes
1
answer
1k
views
how to do php unit testing post data passing from javascript to controller?
I am using phalcon framework and i want to write a unit test.
In JS I am using Post Method and In my controller
public function controllerAction {
$this->view->disable();
$body = $...
2
votes
1
answer
2k
views
Dispatcher has detected a cyclic routing causing stability problems in phalcon
When i am trying to access any controller following error is coming.
My code is working fine in my local machine where Apache server is running.
When i am uploading same code in my server machine and ...
2
votes
1
answer
309
views
Phalcon REST - cmoore4/phalcon-rest
Good day!
I'm trying to create rest for angular using phalcon - https://github.com/cmoore4/phalcon-rest
Hello!
I have similar error https://github.com/cmoore4/phalcon-rest/issues/10
But i can't ...
2
votes
0
answers
471
views
Phalcon REST Api multi-module
I'm building a multi module using Phalcon. I have an Application named frontend and a REST API in micro application. But I have a question about the way to create my rest api. It's necessary to use a ...
2
votes
1
answer
797
views
PHP Authorization: Bearer header keeps changing names
I implemented JWT tokens in PHP/Phalcon, for which you need to send the JWT token in the Authorization header. I send the header as follows:
$.ajax({
url: URL,
dataType: 'text',
...
2
votes
0
answers
81
views
From XML to MySQL
I have loaded my XML file with PHP simpleXML but I have next situation ... My XML file looks like this:
<xml>
<status>1</status>
<market>
<shop>
&...
2
votes
1
answer
1k
views
Volt templating (Phalcon) - What is better between "partial" and "include" to use in a loop?
I see there are 2 options to include a "partial" template within a template (using Volt, Phalcon PHP framework) Documentation: https://docs.phalconphp.com/en/latest/reference/volt.html#view-...
2
votes
0
answers
119
views
A good practice to create phalcon 2.0 form decorators?
To created form decorators (for view rendering), I have created an abstract class BaseForm as follows:
abstract class BaseForm extends Form {
/**
* Render form field
* @param $name
* @param ...
2
votes
0
answers
951
views
MVC with Cordova/Phonegap?
Most MVC-frameworks (e.g. Phalcon or Laravel) use PHP, or some other script language that uses curly brackets, and placeholders in view-templates and connect them to models and controllers.
Each ...
2
votes
0
answers
112
views
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 ...
2
votes
1
answer
449
views
Phalcon: Cannot use alias column in where/having clause
I have to select some location points with a distance from given coordinates.
Presented query
$locations = Locations::query()->columns(['id','distance' => '(1+2)'])
->order(...
2
votes
1
answer
166
views
htaccess with Angular and Phalcon
I'm trying to switch the frontend of my Phalcon app to AngularJS. I'm having some troubles with the .htaccess file though. Below is what I currently have.
RewriteEngine On
RewriteBase /
RewriteCond %{...
2
votes
1
answer
4k
views
401 response doesn't return json
This is my api using phalcon:
$response = new Response();
$response->setStatusCode( 401, 'Unauthorized' );
$response->setContentType( 'application/json', 'UTF-8' );
$response->setJsonContent(...
2
votes
1
answer
2k
views
Fatal error: Class 'Phalcon\Http\Client\Request'
Error on request
Fatal error: Class 'Phalcon\Http\Client\Request' not found in ControllerBase.php on line 41
use Phalcon\Http\Client\Request as CRequest;
$provider = CRequest::getProvider();
...
2
votes
1
answer
96
views
Phalcon v.1.3. Model's onConstruct does not fire after unserialize
Phalcon 1.3 MVC Model docs say:
The initialize() method is only called once during the request, it’s intended to perform initializations that apply for all instances of the model created within the ...
2
votes
1
answer
2k
views
Phalcon routing, how to set default parameters?
I'm trying to create dynamic routes in Phalcon 1.3.4, but if a parameter is missing (like :action or :params) the route doesn't match.
Here is the (working) code :
$router = new Phalcon\Mvc\Router(...
2
votes
1
answer
300
views
Model Hierarchy In Php Phalcon - Can't Find Attribute of Parent Model When Accessing Child Model
I am working on Php Phalcon, Xampp server. My model classes form an heirarchy.
I have a UsersAbstract class which has some generic attributes like Full_Name, Email_ID etc.
Then I have derived class ...
2
votes
0
answers
124
views
Derived Classes in Php Phalcon
I am fairly new to php phalcon and the language itself. I am making a website that involves an abstract class and derived classes.
The Abstract Class:
<?php
abstract class UsersAbstract extends ...
2
votes
0
answers
280
views
Phalcon Micro Application(facing prob with finish middleware event)
I am facing a problem while implementing micro application in which i want a middle ware that is executed after response is send to browser. As mentioned in documentation of phalcon finish middle ware ...
2
votes
0
answers
1k
views
Memcached / Memcache Keys Not Expiring
It seems that data expires as expected with Memcached, but the keys themselves never expire. Why are the keys sticking around after the value has nulled? When I run this code:
$frontCache = new ...
2
votes
1
answer
2k
views
Phalcon, IIS 7.5 and URL Rewrite problems
So, I'm following the Phalcon php tutorial at this link http://docs.phalconphp.com/en/latest/reference/tutorial.html, but I'm trying to recreate the process using IIS 7.5 (as opposed to apache) and I'...
2
votes
0
answers
2k
views
AngularJS set cookies from $resource request and resend them in other requests
I'm consuming services from an API coded using Phalcon micro framework, eg api.mydomain.com
I'm consuming the API using AngularJS and I'm performing the requests using the next code:
Services....