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
83 votes
5 answers
105k views

Error building : fatal error: pcre.h: No such file or directory

I'm just finished installing Ubuntu 13.10. I want try Phalcon, and when I build the source (phalcon.so), I have this error : from /home/fabrice/Downloads/cphalcon/build/32bits/phalcon.c:204: /...
fabrice's user avatar
  • 1,399
4 votes
2 answers
2k views

Phalcon performance related queries

I'm building a REST API for the output of endpoint /projects I have created 2 models: Projects: class Projects extends BaseModel { public function initialize() { $this->hasMany('...
user avatar
9 votes
4 answers
37k views

google recaptcha returns false due to "invalid-input-secret"

I have installed the latest recaptcha from google but it always returns false upon post submit and always returning "invalid-input-secret" error even though the verification is always correct from the ...
MusicManDev's user avatar
8 votes
1 answer
6k views

Namespaces with Phalcon

All my controllers are under the namespace MyApp\Controllers so, as the documentation recommended, I've set my default namespace to it: $dispatcher->setDefaultNamespace('MyApp\Controllers'); But ...
cvsguimaraes's user avatar
7 votes
5 answers
31k views

How to run RAW SQL query in PhalconPHP

I try to get result from this query $sql = " SET @col = NULL; SET @sql = NULL; Select Group_Concat(Distinct ...
Sir Z.'s user avatar
  • 124
3 votes
1 answer
2k views

PhalconPHP MVC Micro app: Specify a request path and assert the response code

I've followed the unit testing tutorial and modified it to test a HTTP request to Micro MVC app, based on this post. I can successfully validate the output string, however I'm not sure how to assert ...
David Cifuentes's user avatar
1 vote
2 answers
8k views

How to echo last query string in Phalcon?

I have worked a lot on codeigniter. In codeigniter , if there is need to get query string that is executed last, we can get it using: echo $this->db->last_query(); exit; But currently I am ...
Shahid Rafiq's user avatar
7 votes
2 answers
7k views

Cross controller variables in Phalcon

In an effort to keep my code DRY I would like to be able to define "cross controller" variables. Classic example is that I would like access to some config items that are loaded in my bootstap. What ...
Tim's user avatar
  • 3,101
5 votes
3 answers
7k views

How do I use "Main Layout" views in a multi module Phalcon application?

I am using a "multi module" MVC structure for my PhalconPHP application. One issue I am trying to figure out is how I can configure my "Main Layout" view to be above the module view folders. In ...
Tim's user avatar
  • 3,101
4 votes
1 answer
3k views

Phalcon: the order of 2 functions "initialize" and "onConstruct" in Controller and Model

I check myself and see that, the order of execution on Controller is "onConstruct" then "initialize", while on Model is "initialize" then "onConstruct". So why the order of execution of these methods ...
Viet Nguyen's user avatar
4 votes
5 answers
10k views

It is possible to get Phalcon\Mvc\View rendered output in variable?

I need to give back json object, that has property 'html' with rendered action. Is it possible to do natively with Phalcon vew? Example: $posts = NewsPost::find(['limit' => 10]); $view = new ...
avasin's user avatar
  • 9,276
3 votes
1 answer
919 views

Problems compile phalcon on osx 10.9

Trying to follow instruction from documentation: running $ sudo ./install and get this: gcc -I. -I/Users/honky/cphalcon/build/64bits -DPHP_ATOM_INC -I/Users/honky/cphalcon/build/64bits/include -I/...
Michael's user avatar
  • 31
2 votes
1 answer
786 views

Force autocomplete suggestions for file paths

I am currently working on a controller file for a Phalcon project. I like how PhpStorm gives you autocomplete suggestions when writing a src or href value in an HTML file. I was wondering, is possible ...
Sneakyp33t's user avatar
2 votes
2 answers
1k views

Friendly URLs in phalcon framwork is not working in Ubuntu [closed]

I have tried these two codes. but It is not working. It need to access public folder too. http://docs.phalconphp.com/en/latest/reference/tutorial.html #www/tutorial/.htaccess <IfModule ...
Tharaka Nilupul Dharmabandu's user avatar
1 vote
2 answers
929 views

Phalcon and nginx - framework run only indexController

I am using Phalcon and Nginx, and i have a problem. When I go to http://myapp.dev/segmentation Phalcon should run SegmentationController and its indexAction() method. But instead, Phalcon is running ...
Jacek Jagiełło'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
3 answers
1k views

"Invalid Service Definition" when using DI->Get Phalcon PHP

This question is related to Appending multiple config arrays in PhalconPHP I am trying to get retrieve an object from the DI using the get method. The object is being set like this // $new_array ...
Tim's user avatar
  • 3,101
1 vote
2 answers
869 views

Plus sign decoded into space

I send requests from ios and android to some PHP server and some params in GET request are wrongly decoded. request: http://myserver.com/path?email=john+doe $_GET['email'] == 'john doe' instead of '...
Alexandru Circus's user avatar
1 vote
1 answer
938 views

Phalcon PhP - how to change the view dynamically

I'm working in a website where part of it I have the static html, so I created a layout and in it I'm inserting the static content using views. My problem is as this website has many pages I feel ...
André Luiz's user avatar
  • 6,802
0 votes
1 answer
508 views

How to implement \Phalcon\Mvc\Model::findIn()?

Fairly simple question, but I can't seem to find anything about it. I've got a set of ids, and I need to find all matching records. So I'd like to query : $records = MyModel::findIn([1,2,3,4]); ...
Elvex's user avatar
  • 652
-2 votes
3 answers
407 views

how to use php and volt parameter together?

I am using Volt and PHP in phalcon volt partial I want to iterate a loop and in the loop I have php code that accept a parameter this is my code {% for header in headers %} <th> <?=...
morteza mortezaie's user avatar
46 votes
2 answers
15k views

How can I add volt syntax checking in PHPStorm

I want to be able to have syntax highlighting in PHPStorm for Volt, Phalcon's template engine. Is there a way to do so?
Nikolaos Dimopoulos's user avatar
20 votes
3 answers
25k views

Compiling Phalcon - Virtual memory exhausted: Cannot allocate memory

When I try to compile Phalcon, I get an error: virtual memory exhausted: Cannot allocate memory I am running the following commands git clone --depth=1 git://github.com/phalcon/cphalcon.git cd ...
Nikolaos Dimopoulos's user avatar
18 votes
4 answers
18k views

How do I use phalcon-devtools\ide\phpstorm in phpstorm?

I am trying to integrate the Phalcon developer tools with phpstorm. There is a video here, but I am unable to view it due to my location. I can't find any other usable reference in the documentation, ...
Lee's user avatar
  • 229
15 votes
1 answer
11k views

How to copy the CSS and JS files in vendor folder of composer to public?

I'm just starting to learn several PHP frameworks. The examples I tried all use composer, which I have not used before, so things are not exactly clear to me yet. I specified some JS and CSS ...
Dylan's user avatar
  • 9,199
13 votes
5 answers
14k views

how to install phalcon.so in mac os

I have installed phalcon extension.It was installed successfully but the phalcon command not working. following Error shown. "iMac:project Atomix$ phalcon -sh: phalcon: command not found" I have ...
Bipul Khan's user avatar
12 votes
2 answers
489 views

PhalconPHP Database transactions fail on server

I have developed a website using PhalconPHP. the website works perfectly fine on my local computer with the following specifications: PHP Version 7.0.22 Apache/2.4.18 PhalconPHP 3.3.1 and also on my ...
VafaK's user avatar
  • 514
8 votes
1 answer
8k views

How can I set up a user defined function in Volt (Phalcon)

How can I set up a user defined function in Volt? For instance I want to call a function that would translate strings in my views as such: <div class='page-header'> <h2>{{ tr('...
Nikolaos Dimopoulos's user avatar
7 votes
6 answers
9k views

Phalcon: how to get distinct models?

Using Phalcon Model, how can I get distinct rows when get rows using the find() method.
Handsome Nerd's user avatar
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 ...
Andriy Haydash's user avatar
5 votes
3 answers
5k views

Netbeans syntax highlighting for volt (twig) and php in phtml files

I'm working with Phalcon in Netbeans. I see I can use twig plugin for template highlighting for volt files. I am using phtml files and want highlighting for volt (twig) and php. Is this possible? ...
Ally's user avatar
  • 955
5 votes
2 answers
14k views

How to find by multiple criteria with Phalcon findFirst?

I'm trying to get a video from my video database, the selection is based on a unique combination of external_id and language_id (both integers). I tried the following code, but it looks like findFirst(...
KBoek's user avatar
  • 5,823
5 votes
1 answer
2k views

what's the difference between redirect and dispatch in phalcon?

When I want to change to a page from another, I can find both $this->dispatcher->forward() and $this->response->redirect(). Both seem to work ok. What's the difference between them, and ...
Nathan Tsui's user avatar
5 votes
1 answer
4k views

Phalcon Router and Loader for subfolder structure getting bigger. How to set up?

I have a quite big project that I need to program. I used to code with CodeIgniter but since they stopped maintaining the framework, I decided to switch to another. I chose Phalcon framework. The ...
cjrb's user avatar
  • 197
4 votes
3 answers
18k views

Loading Models with INNER JOIN

Let's say I have a Phalcon\Mvc\Model that I load using ::findFirst($id). How can I swap in a custom query that would load the model row and do INNER JOIN on some other table? Thanks!
temuri's user avatar
  • 2,777
4 votes
2 answers
7k views

How to connect multiple database in phalcon framework at the same time use both in model class not only one

In my code I have two database ABC and XYZ. I want to use both database in same model than What is the solution for it in phalcon? How to implement multiple database connection for this ?
radhika's user avatar
  • 89
4 votes
3 answers
13k views

Phalcon tutorial error PhalconException: TestController handler class cannot be loaded

I'm having some trouble getting Phalcon Tutorial 1 to work. In the end I've cloned the version of it onGithub to make sure I'm not missing something; still getting the same behavior from that. ...
MHG's user avatar
  • 1,410
4 votes
1 answer
2k views

Downgrade Phalcon from previous version?

Im running in Ubuntu 15 and installed Phalcon v3 but i have an issue with our current working API which is using v2 of Phalcon, is there a way to downgrade the current version of Phalcon that i'd ...
Nebyk's user avatar
  • 37
3 votes
2 answers
1k views

When should we use multi-module structure (instead simple structure) in php Phalcon

When should we use multi-module structure (instead simple structure) in php Phalcon? I have found some multi-module skeleton, such as: https://github.com/ovr/phalcon-module-skeleton, https://...
Deka's user avatar
  • 1,333
3 votes
2 answers
6k views

How to connect multiple database in phalcon framework

i have to database namely master and xyz ,in that i required to connect both database in application . so is it possible to connect multiple database in one application and yes then how.?
Bhavin Solanki's user avatar
3 votes
1 answer
10k views

Phalcon PHP - Form and model validation

Phalcon support 2 validation components: Phalcon\Validation\Validator Phalcon\Mvc\Model\Validator I dont know how to use them in my situation. I have a registration form with: csrf username ...
Kevin's user avatar
  • 1,423
2 votes
3 answers
2k views

Phalcon backup view path

Is there any way to pass through a secondary path to the views dir in phalcon? in zend framework I think the syntax is $this->view->addScriptPath('/backup/path'); $this->view->...
CodeMonkey's user avatar
  • 3,281
2 votes
3 answers
7k views

getting exception : Service 'db' wasn't found in the dependency injection container in Phalcon

Even after setting "db" in services.php I'm getting above exception. services.php $di->set('db', function() use ($config) { $dbclass = 'Phalcon\Db\Adapter\Pdo\\' . $config->database->...
Pankaj's user avatar
  • 581
2 votes
1 answer
213 views

Sending variable from volt to custom function

I have created a custom function I can access from the volt. The function seems to work fine, but I cannot manage to send the variable to the function. It sends the variable as text instead of its ...
Alvin Bakker's user avatar
  • 1,466
2 votes
3 answers
1k views

how to install specific phalcon framework version 2.0.?

i have a application which is working fine with version 2.0 for that i am unable to install phalcon version 2.0 only latest version version 3.2.2 is installing.. so how can i install v 2.0..?? ...
asif's user avatar
  • 279
2 votes
2 answers
7k views

Phalcon Model find() with condition in another table

so I have 2 tables like this books id name status_id ------------------------------- 1 a 0 2 b 2 ... status id description --------------------- ...
lightbringer's user avatar
2 votes
2 answers
5k views

Phalconphp routes not working

I'm new to phalconphp and following their tutorials, as far as I understand it, I don't need to create a specific routing component and that it should pick up a route if it exists. I could obviously ...
TommyBs's user avatar
  • 9,396
2 votes
1 answer
2k views

How can I dynamically reference template file in volt template?

We know, {% include header.volt %} is reference file with name's header.volt. How can I dynamically reference template file in volt template? like this:      {% include ...
Marser's user avatar
  • 23
2 votes
1 answer
6k views

Phalcon\Mvc\Model::validation() and non-model validators

I am working on Model validation using Model::validation() call. It looks like Model::validate() only accepts validators from Phalcon\Mvc\Model\Validator namespace and crashes when Phalcon\Validation\...
temuri's user avatar
  • 2,777
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(); ...
hariom srivastava's user avatar