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.
1,984
questions
-2
votes
1
answer
428
views
Phalcon - Composer install of Dev-Tools error: requested PHP extension -
composer install with file compose.json
{
"require-dev": {
"phalcon/devtools": "~3.4"
}
}
should install Phalcon Dev-Tools.
Actual Behavior
Instead, it ...
0
votes
1
answer
153
views
Phalcon Devtools error: generate controllers, models and scaffold not working (404 not found page)
(this text is automatically translated from Spanish to English.)
Hello, I would like to ask about this error that Phalcon devtools shows when generating a controller, model or scaffold:
my ...
-1
votes
1
answer
176
views
Composer won't install due to strange syntax in composer.json: "package/package": "other-package as x.xx.x"
This composer.json file won't install due to an inline alias. This line appears to be the culprit:
"jms/serializer": "xsd2php-dev as 0.18.0",
I'm not sure what this is trying to do....
0
votes
1
answer
152
views
Insert array PHALCON
I am trying to insert several data from an array but at the time of inserting it only inserts the last one I type.
This is my front-end code where I send the data
let payload = new FormData();
...
0
votes
1
answer
117
views
How do i use namespaces in phalcon framework?
So everything works fine if i use $loader->registerDirs() function, but if i use registerNamespaces function i get dispatcher error, that says: "IndexController handler class cannot be loaded&...
0
votes
1
answer
202
views
php phalcon use composer autoload.php not working
I want to use a class that installs by composer, but I don't get an error that the class does not exist.
use the file_exists to check if the file is being loaded but I always get false.
apparently ...
0
votes
1
answer
60
views
Phalcon: setStatusCode returns empty response
I'm trying to write error handling for one of the endpoints in phalcon.
If I set status code to client/server error code(4xx/5xx), then the response returned is empty. How can I fix that?
Example:
$...
0
votes
1
answer
266
views
PHP Fatal error: Uncaught Error: Class 'Phalcon\\Db' not found. for Phalcon 4
I am currently upgrading version PHP 5 to PHP 7. And Phalcon 1 to Phalcon 4.
my all existing API gives error.
Fatal error: Uncaught Error: Class 'Phalcon\Db' not found.
I have found that use Phalcon\...
0
votes
1
answer
88
views
How bind array parameters in find request?
I want to add conditions to my request based on the permissions of the logged in user
I try this :
$t = array();
$t[] = 3;
$statements = Statement::find(
[
'conditions' =&...
0
votes
1
answer
89
views
Implement Phalcon 4 Database Existence validator (similar to Uniqueness)
Often I need to validate if given value is existing in certain column (attribute) of a table (model).
This can be useful in foreign keys of a model, to check if the given values exists.
Most probably ...
1
vote
2
answers
343
views
Phalcon / MVC / Simple routing not working
I have a simple button which link to a new page /connect.
<a id="userMenuEditConnect" onclick="window.location.href = '{{url('connect')}}';">Connect</a>
I created a ...
0
votes
1
answer
108
views
Why my relation ship return always null with PHP Phalcon?
I try to use relationShip ManyToMany with PHP Pahlcon 3.4
My models :
use Phalcon\Mvc\Model;
class Societe extends Model
{
public $id;
public $nom;
public $adresse1;
public $adresse2;
public $...
1
vote
1
answer
71
views
Install Phalcon on RHEL 7
I'm trying to install Phalcon on my RHEL 7 VM. I downloaded files and folders from GitHub and place them on my VM via WinSCP in /opt/ (using remi repo or git clone from VM is blocked)
When I move into ...
0
votes
1
answer
235
views
Phalcon4 Model Pagination
I used to do my pagination below way in phalcon3.4 however, it looks like no clear way to do this in the phalcon4,
use Phalcon\Paginator\Adapter\Model;
$paginator = new Model(
[
"...
2
votes
1
answer
531
views
Phalcon 4 How to get URL of current page?
In phalcon 3.4 we had the below function to get the current URL,
$current_url = $this->router->getRewriteUri();
However, it seems to be that, it was dropped in version 4.0 however there is no ...
-1
votes
1
answer
611
views
PHP - Phalcon <b>Fatal error</b>: Uncaught Error: Class 'Phalcon\Db' not found in
I recently entered in a company but I'm currently making an API in Laravel, but the old API was built with Phalcon, but some functions need to be working in a New Server, so I installed the phalcon 4 ...
0
votes
1
answer
44
views
ORM issue - UNDEFINED PROPERTY
I have three models with these relations :
Permission :
public function initialize()
{
$this->setSchema("ngd_demat");
$this->setSource("p_permission");
$this->...
1
vote
3
answers
94
views
Phalcon\Image\Adapter\Gd throwing an exception for the text function
I have the following in my code:
use Phalcon\Image\Adapter\GD as Image;
...
$imagePath = BASE_DIR . '/public/img/map-icons/' . $client->getId() . '/' . $file;
$image = new Image($imagePath);...
0
votes
1
answer
36
views
How should I recode my Phalcon v2 PhalconCrypt php to work with v3?
I currently have this in my Phalcon v2 code:
$di->setShared('crypt', function () {
$crypt = new PhalconCrypt();
$crypt->setMode(MCRYPT_MODE_CFB);
$crypt->setKey('mysecretkey');
...
1
vote
1
answer
261
views
session lose on bank redirect phalconphp
i have a website that users can buy stuff . for the payment users redirects to the bank site -> do the payment -> get back to the site .
lately after users get back to the , they lose theirs ...
0
votes
1
answer
292
views
How to sum value column in query builder phalcon
I want to sum values in query builder in framework phalcon, this is my code builder
$builder = new Builder();
$builder
->columns([
"TABLE1.ID_TABLE1",
"count(distinct ...
1
vote
1
answer
2k
views
Connection refused redis
when i try to initialize a new client $tkRedis = new Client(); i get an error message
Connection refused [tcp://127.0.0.1:6379]
The container of Redis is running. But I can't establish a connection ...
0
votes
1
answer
22
views
How to check in Phalcon id valid to do fetchAllAssoc()?
I don't use Phalcon much and am having some trouble with some code after a migration to Phalcon v3 with code that worked before.
foreach($this->facets as $k => $facet) {
$facets[$facet] = $...
1
vote
0
answers
191
views
Apache or PHP not specifying the assets folder correctly
I have this site written in PHP using Phalcon but for some reason when I switch from WAMP to XAMPP it doesn't use the public folder for assets like css/js/fonts/etc but uses the root folder instead? I'...
0
votes
0
answers
25
views
Random segfaults when using what seems to be a typical implode statement
Here's my function:
static function implode_conditions($query) {
$conditions = $query['conditions'];
if ($conditions) {
$imploded_conditions = implode(" AND ", $conditions);
...
0
votes
2
answers
446
views
Phalcon 4.0 setting up Session
I am trying to make an session in my phalcon project, version 4.0 but I am getting this error while creating an session.
Class 'Phalcon\Session\Adapter\Files' not found
$di->setShared('session',...
0
votes
1
answer
86
views
Is it possible to get the rendered view output from a Phalcon controller? From within a unit test?
I'm writing a controller test, like so:
class DepositOrderTest extends AbstractUnitTest {
public function testTestCase(): void {
$deposit_controller = new DepositController();
$...
0
votes
1
answer
182
views
How and When does Phalcon framework create new session file?
My project information:
Phalcon framework
PHP 7.2
PHP vlucas/phpdotenv
My page loses all session (shopping cart, user login...) when page redirects from E-xact Gateway after customer did purchasing. ...
0
votes
1
answer
112
views
ManyToMany relationship get the data
i am try to buid a ManyToMany relationship i have 3 Models movie,genres & moviegenres i want to get all genres for a movie for example $movie = Movie::find(); $movie->genres;
i can put the ...
0
votes
1
answer
50
views
How do you define a 1-1 relationship bidirectionally with phalcon?
I have two tables, work_order and project. On the project records, there is a work_order_id field. There is no project_id on the work_order records. Do I need to add one?
Or is there a way to define ...
1
vote
1
answer
375
views
Phalcon model FindFirst on NULL values
I am trying to use findFirst() to load models by NULL value of field:
$model = MyModel::findFirst([
'conditions' => 'field=?0',
'bind' => [
0 => null,
],
'bindTypes' =&...
1
vote
1
answer
154
views
Phalcon request with custom filter
I'm using phalcon 3 and trying to override the default httprequest class and add a default custom filter, something like this:
public function getPut($name = null, $filters = null, $defaultValue = ...
0
votes
2
answers
1k
views
How to enable InteliSense for Phalcon in VS Code?
I'm using XAMPP with PHP 7.3 with Phalcon 3.4 extension in Windows 10.
I've been having issues on getting code suggestion, or even errors because VS Code can't seem to find Phalcon files.
I've been ...
1
vote
0
answers
88
views
Phalcon Slayer is returning "0" for model id after create/save
I am using Phalcon Slayer framework for my project, but when I'm trying to create/save a model instance to the database, I encounter an issue that id field always return "0" in my model
$...
1
vote
1
answer
176
views
How to get result set or affected row after raw SQL update in Phalcon
I am using the following raw SQL update:
$query = "UPDATE $table SET balance = balance + $this->sum WHERE cashbox_id = $cashboxId";
$db->execute($query);
Now I need the final balance,...
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 ...
0
votes
1
answer
319
views
registerAutoloaders must be compatible with Phalcon\Mvc\ModuleDefinitionInterface
I very need multiple structure application. I used phalcon v3, now migrating v4.
I get error: Fatal error: Declaration of Multiple\Frontend\Module::registerAutoloaders(?Phalcon\DiInterface $di = NULL)...
0
votes
3
answers
521
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
3
answers
17k
views
PHP/Phalcon Error: Closed without sending a request; it was probably just an unused speculative preconnection
I have a basic controller action:
public function createAction() {
$this->view->disable();
$formData = $this->request->getJsonRawBody();
$user = new Users();
...
-1
votes
1
answer
92
views
Phalcon Component using a Custom View (Volt) - how to create Phalcon UI Widgets
On my website i have to write a number of custom UI components and stays independently to the Controllers and Models, to generate views (In common some people call them UI-widgets).
i.e Creating re-...
-1
votes
1
answer
463
views
How to run a phalcon project in localhost
I am using xampp and windows machine.
I am trying to run a existing phalcon project in my pc .
If i try "localhost/odc/public" , it runs the project but could not load any styling.
So i think if i ...
0
votes
1
answer
2k
views
Install phalcon dev tools 3.4
How can I install phalcon dev-tools 3.4 instead of 4?
My phalcon extension is v3.4.5, installed this version because version 4 has some problems with Ubuntu.
So these are the steps I did
I git cloned ...
0
votes
1
answer
256
views
Phalcon\Forms\Form bind emtpy field as null
I have db table like here
CREATE TABLE `tbl` (
`id` INT NOT NULL AUTO_INCREMENT,
`myVar` INT NULL DEFAULT NULL,
PRIMARY KEY (`id`));
I'd like to save empty values from $_POST as NULL.
Here is ...
0
votes
2
answers
2k
views
Can't Load Phalcon Extension On Windows with Xampp
Currently I am using
a. PHP Version : 7.4.4
b. Web Server: XAMPP
c. Architecture : x64
d. OS: Windows 10
What I've Tried
a. I downloaded phalcon_x64_vc15_php7.4_4.0.5+5010.zip from Phalcon Repo
...
0
votes
1
answer
59
views
How to enable XDebug on phalconphp/ubuntu-16.04 docker image?
I'm using phalconphp/ubuntu-16.04 docker image and I want to enable XDebug on that image. Quote from image documentation on https://hub.docker.com/r/phalconphp/ubuntu-16.04
Xdebug is disabled by ...
1
vote
0
answers
335
views
Clone a phalcon project and Installing Phalcon on Ubuntu 18.04
So, I git cloned a phalcon project to /var/www and ran composer install and it gives me the following error
PHP Warning: Cannot load module 'phalcon' because required module 'psr' is not loaded in ...
0
votes
0
answers
237
views
Get XDEBUG_SESSION_START header in Phalcon request
I am trying to remotely start debugger in multiple microservices using Phalcon, the first microservice accepts XDEBUG_SESSION_START header but I cannot get the header in the request when I instantiate ...
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" ...
-1
votes
1
answer
563
views
Error in run phalcon framework after create project
excuse me, I see the following error when executing the phalcon framework
PalconShenaiaController handler class cannot be loaded
#0 [internal function]: Phalcon\Mvc\Dispatcher->...
0
votes
1
answer
73
views
Why the delete() method of Phalcon\Mvc\Collection in the MongoDB collection may not work?
I inserted three documents to mongoDb collection. I want to delete a document from collection.:
It is mongoDB model:
use \Phalcon\Mvc\MongoCollection;
class AutoSnippet extends MongoCollection
{
...