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,401
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
21 votes
4 answers
19k views

How to setup a 404 page in Phalcon

How can I set a 404 page in Phalcon to be displayed when a controller/action does not exist?
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
16 votes
2 answers
34k views

Laravel or Phalcon for a heavy-traffic site [closed]

I come from a Codeigniter background. I've used it for three years and really like it. It's simplicity is great. I've built massive sites with Codeigniter, but I'm looking for a new PHP framework to ...
Noah Goodrich's user avatar
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
14 votes
3 answers
30k views

Phalcon redirection and forwarding

Do I understand correctly that after doing $this->dispatcher->forward() or $this->response->redirect() I need to manually ensure that the rest of the code does't get executed? Like below, ...
Ian Bytchek's user avatar
  • 8,834
13 votes
6 answers
23k views

Get raw sql from Phalcon query builder

Is it possible to extract raw sql query from the query builder instance in Phalcon? Something like this? $queryBuilder = new Phalcon\Mvc\Model\Query\Builder(); $queryBuilder ->from(…) ->...
Ian Bytchek's user avatar
  • 8,834
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
3 answers
12k views

Phalcon php vs node.js

We are going to develop rest server for our application (and all logic is on client javascript). So we thought to use Phalcon php, but we also need to create realtime chat system, which is much more ...
Iliya Garakh's user avatar
12 votes
2 answers
491 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
11 votes
3 answers
5k views

Phalcon UnitTesting

I am running the example from the documentation: http://docs.phalconphp.com/en/latest/reference/unit-testing.html#sample-unit-test I want to create an abstract unit test from Phalcon\Test\...
llundin's user avatar
  • 383
10 votes
1 answer
9k views

numeric loop in volt

I have read the volt documentation in phalcon page and i cant find any example for this... You can make easy loops in objects, for example, in php: foreach($pages as $page){ echo $page->...
Stefan Luv's user avatar
  • 1,179
10 votes
4 answers
12k views

what are the benefits of using a template engine

I do not understand why a developer would use Phalcon's Volt template engine. In the end, after the compilation, the same PHP files are produced, that I would have to write manually in the first ...
temuri's user avatar
  • 2,777
10 votes
1 answer
12k views

Easiest way to access Phalcon config values in views?

I have a section in ini files with some globally used social links, for ex: [social] fb = URL twitter = URL linkedin = URL What's the easiest way to access these, or is there a better way to ...
meder omuraliev's 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
9 votes
9 answers
20k views

How to use the var_dump output directly from the controller?

class IndexController extends \Phalcon\Mvc\Controller { public function indexAction() { $custom = "Custom variable"; var_dump($custom); } } How to display the result not ...
Yury's user avatar
  • 908
9 votes
2 answers
7k views

calling a phalcon php MVC controller via ajax

i am using simple app with phalcon PHP and AngularJs. i am trying to call my phalcon PHP controller from angularJS controller through AJAX POST request. $http.post('/ControllerName/', {params}); ...
Ori Price's user avatar
  • 3,753
8 votes
3 answers
19k views

IDE autocomplete for PhalconPHP [closed]

Is there exist any kind of skeleton for PhalconPHP framework, which I can use in my Netbeans IDE for autocompletion purposes? All I need is a heap of files with class/interface declarations, like ...
Eugene Manuilov's user avatar
8 votes
1 answer
4k views

PHP Fatal error: Class 'jsonserializable' not found in Unknown on line 0

Ubuntu 16.04 PHP 7.0.4 Phalcon 2.1.x Zephir $~: php -v PHP Fatal error: Class 'jsonserializable' not found in Unknown on line 0 When add phalcon.so in php.ini
Gonzalo Fernandez Larravide's user avatar
8 votes
1 answer
12k views

Phalcon save not working

I'm fairly new to Phalcon, I really like it, currently working on my first project in it, however I'm currently coming across an issue with the ORM. I seem to be unable to save. My Users model ...
André Figueira's user avatar
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
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
8 votes
2 answers
2k views

Phalcon PHP post link with JavaScript confirmation dialog

I am developing a CRUD system in Phalcon PHP (version 1.3.4). My goal is to create a link (delete row), that asks for confirmation on click (JavaScript confirmation box) and then goes (request type ...
Tijme's user avatar
  • 39
8 votes
2 answers
5k views

Phalcon on PHP7?

Is PhalconPHP 2.0.10 extension supports PHP 7? I'm planning to start learning Phalcon and I want to run it in PHP 7. I can't find an article or a blog that says Phalcon can run on PHP 7.
Ram's user avatar
  • 508
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
7 votes
1 answer
8k views

How it's possible to disable rendering layout in case of xmlhttprequest in phalcon framework?

How can be disabled layout rendering? For a moment i can detect that request is made via jQuery this way: public function initialize() { if (!$this->request->isAjax()) { // ...
avasin's user avatar
  • 9,276
7 votes
2 answers
8k views

Phalcon PHP Xampp installation - Apache can't find DLL

I am using Windows 7 64bit, Xampp 1.8.3(with PHP 5.5). I'am following Phalcon installation guide, i downloaded x86 version of Phalcon like in this guide. Next i put php_phalcon.dll file in D:/xampp/...
Jacek Jagiełło'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
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
7 votes
4 answers
6k views

How to properly initialize database connection in Phalcon

at the moment, I initialize database in following way: $di->set('db', function() use ($config){ return new \Phalcon\Db\Adapter\Pdo\Mysql( array( "host" => $config->...
lot's user avatar
  • 1,464
7 votes
2 answers
5k views

How do I configure custom routes in Phalcon?

I just stumbled at Phalcon (PHP framework) and it looked so promising I decided to try it. I searched in the docs but haven't found anything related to routes in Phalcon. Does somebody know how to ...
marcio's user avatar
  • 10.1k
7 votes
1 answer
2k views

Debugging Phalcon as a PHP developer

I have been a PHP developer working with Magento for years. I'm now wanting to work on a project that has no ecommerce component, and as such Magento is not a good choice. After browsing online at the ...
Sean's user avatar
  • 1,108
7 votes
3 answers
6k views

Phalcon devtools not working

I'm attempting to install Phalcon Dev Tools on OSX. I have Phalcon installed and it works fine. I've followed the instructions from here: http://docs.phalconphp.com/en/latest/reference/mactools.html ...
Torra's user avatar
  • 1,192
6 votes
4 answers
10k views

Installing Phalcon PHP Devtools: "ERROR: Phalcon extension isn't installed ..." though the module is installed

After some days ago I installed Phalcon PHP, I am more and more exited about it. Now I want to try the Phalcon Devtools out. I've just installed it like in the installation manual via Composer (for ...
automatix's user avatar
  • 14.4k
6 votes
9 answers
20k views

Volt directory can't be written

The error I am getting is Warning: Phalcon\Mvc\View\Engine\Volt\Compiler::compileFile(../app/views/index/index.phtml.php): failed to open stream: Permission denied in /Users/mattstephens/Sites/magpie/...
Matt Stephens's user avatar
6 votes
1 answer
1k views

Phalcon relationships order

Have such relationship in Phalcon, I need this query ordered by log_time DESC $this->hasMany('id', 'LogDevices', 'tk_fk', [ 'alias' => 'logs', 'order' => 'log_time DESC' ]); What ...
Denys Klymenko's user avatar
6 votes
1 answer
8k views

Phalcon loading helper file library

I have created a library that which will load a php file (which may contains users custom functions in it...) you can either call it from bootstrap also from the controller. if file does not exists it ...
Raj's user avatar
  • 1,083
6 votes
1 answer
2k views

How to set an alias on a Model::query() in Phalcon Framework

How to set an SQL alias for a Phalcon Model. A method alias() does not exist. A sample of what i need: $modelA = ModelA::query() ->alias('q') ->columns(['q.*','concat(q.id,...
Mihai Petcu's user avatar
6 votes
3 answers
11k views

PhalconPHP Framework - How to update a model object and the related object

I am working with PhalconPHP and so far I have had little problems. The framework is very good. However, I've run into a problem that I haven't been able to sort out. It's probably a very simple ...
hlasso's user avatar
  • 389
6 votes
1 answer
2k 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' ...
iRaS's user avatar
  • 1,998
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,833
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
2k views

All requests requiring connection to mysql are very very slow (using Phalcon)

I've been working on converting an application of mine from CodeIgniter to Phalcon. I've noticed that [query heavy] requests that only took a maximum of 3 or 4 seconds using CI are taking up to 30 ...
the-notable's user avatar
5 votes
4 answers
9k views

Find entity by id column, \Phalcon\Mvc\Model::findFirst() gives incorrect result

Currently i have table with posts, each posts has an id. For a moment, only one posts exists, with id id = 92. if i execute following code, i will get not false, but post with id=92: $post = ...
avasin's user avatar
  • 9,276
5 votes
3 answers
7k views

How to make models use defaults in Phalcon PHP Framework?

If a table has defaults on certain fields and NULL is not allowed, one would expect the insert script to use those defaults, as MariaDB/MySQL usually does. For example, if the table products has an AI ...
Swader's user avatar
  • 11.5k
5 votes
1 answer
3k views

Phalcon 3: Validating form data using \Phalcon\Mvc\Model\Validator

Since the latest version of Phalcon was released, the examples provided in the documentation do not seem to work correctly. Firstly, I create a new model with DevTools at the command line using ...
mpdc's user avatar
  • 3,560
5 votes
3 answers
4k views

How to add a 404 error code when route does not exisit?

How can I throw a 404 error code when a route does not exist? In phalcon after you set up your routing information - is there a way to check to see if a route coming in (from the user) matches any ...
user1697949's user avatar
5 votes
3 answers
1k views

How can I access Phalcon configuration data in an external library?

Within my project, I've created a "core" directory which contains certain classes and methods called throughout the controllers. I've defined a configuration parameters in my bootstrap file like so: ...
Ayush Sharma's user avatar

1
2 3 4 5
41