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.

Phalcon is an open source, full stack framework for and written as a extension, optimized for high performance. Developers don't need to learn or use the C language, since the functionality is exposed as PHP classes ready to be used.

Phalcon is loosely coupled, allowing developers to use the the whole or selected objects as glue components, based on the needs of the application.

Phalcon strives for performance while keeping the framework robust and easy to use.

Phalcon is written in , a language resembling or in syntax.

Downloading

The source for Phalcon is on Github. Compiled packages for Windows can be found on the download page.

Documentation:

  • Tutorial - Begin with a background of the project, go through installation and start by writing a simple hello, world! application. Move on rapidly to the MVC implementation, models, views and tie it all together.

  • API reference - All classes that the framework offers listed and documented.

  • Developer tools - Phalcon offers a set of command line tools that make creating and managing Phalcon projects easier. It is strongly recommended that you install and use them, as many answers and tutorials will depend on them.

  • Incubator - Includes PHP code snippets that are written from the community for the community. These snippets are designed to be drop-ins to current projects to extend the framework according to the needs of the developer.

Help And Support

Help can be found on the official forum, bugs and issues can be reported on Github. There is also a Discord server for informal discussion.

Sample Projects:

Some projects have been created to illustrate how Phalcon works and shared on Github. You can fork and clone these projects as a starting point for your own, or just to get to know the framework.

  • Forum - Perhaps the most practical Phalcon application out there, which is readily available to the public, requiring users to use their github account for authentication. Currently powering the official Phlacon forums.

  • INVO - Sample lightweight application showing you how you could use Phalcon to write an invoicing or accounting application.

  • Vokuro - Sample lightweight application demonstrating authentication and authorization using Phalcon.

  • MVC Examples - Micro MVC example as well as multiple modules examples (with or without namespaces).

  • REST example - REST Micro MVC application with middleware, utilizing .

There is also a list of live sites that are Powered by Phalcon.

2031 questions
4
votes
2 answers

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('id', 'Participants', 'projectId'); …
user2758717
4
votes
1 answer

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 computer this works, but not on a remote server. Init…
4
votes
1 answer

Phalcon: Best practice to implement "login required" functionality

I am implementing a medium sized web app in PHP Phalcon with URLs that are publicly accessible and a few URLs that can only be accessed when the user is authenticated. Django provides decorators (login_required), that redirect the user to the login…
Konstant
  • 2,179
  • 16
  • 32
4
votes
2 answers

Phalcon: Polymorphic Association

Is there a built-in way with Phalcon to manage Polymorphic Associations - through behaviors or natively - other than manually handling them? Thanks!
Mr Mikkél
  • 2,577
  • 4
  • 34
  • 52
4
votes
1 answer

Can't get header AUTHORIZATION but change to AUTHORIZATIO can get value

In Micro Framework. curl -i -X GET -H "AUTHORIZATION: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InRlc3QiLCJleHAiOjE0MTUyODg0NzgsImxhc3QiOjEzNTY5OTk1MjR9.-xysOSRcj5hgG1iMVfZWHuz39dEpvod0O5ry3EiBstg"…
4
votes
1 answer

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\Adapter\QueryBuilder(array( "builder" => $builder, …
zogby
  • 462
  • 4
  • 15
4
votes
2 answers

How to minify HTML code in PhalconPHP

I use phalconphp framework for my test project. I have simple controller with following code: $this->view->setVar('myData', $data); Are there any tools in PhalconPHP to minify HTML code in view? Thanks!
Sergey
  • 5,396
  • 3
  • 26
  • 38
4
votes
2 answers

How to fallback to IndexController when Controller not exist in Phalcon?

When I enter url like: http://localhost/asdfasdfasdcxccarf Phalcon is giving me this message: PhalconException: AsdfasdfasdcxccarfController handler class cannot be loaded Which is logical, because this controller doesn't exist. However, how can I…
user3797244
  • 53
  • 1
  • 5
4
votes
3 answers

How can I pass variables to main view in phalconphp

How can I pass variables to main view, not just the view for controller. in fact I want to share a piece of data across all views. how can I do that in phalcon. for instance, in Laravel, I can use: View::share('variable', $value);
Pars
  • 4,932
  • 10
  • 50
  • 88
4
votes
1 answer

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 is different on Controller and Model? Any idea?
Viet Nguyen
  • 63
  • 2
  • 5
4
votes
1 answer

A multi module MVC structure in phalconphp

Hi I'm trying to implement a Multi Module MVC for frontend and backend like what is in phalconphp documentations. But I can't make it work. it's about an hour but I really can not understand where is the problem. Could anyone guide me how can I make…
Pars
  • 4,932
  • 10
  • 50
  • 88
4
votes
2 answers

phalcon : volt get value from array which key taken from variable

In phalcon templating engine volt (which is similar to twig) you can fetch all records by : {% for product in products %} Name: {{ product.name }} Description: {{ product.description }} price: {{ product.price}} {% endfor %} So, in my…
AzDesign
  • 1,169
  • 1
  • 8
  • 18
4
votes
2 answers

Phalcon execute sql query in the model

Currently I decided to look at Phalcon php as an alternate php framework to Codeigniter. I followed the tutorials on the website and it is pretty sweet the way it works. I'm still trying to wrap my head around few things though. From my…
cjrb
  • 197
  • 1
  • 2
  • 17
4
votes
2 answers

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
  • 89
  • 2
  • 4
4
votes
3 answers

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
  • 2,767
  • 5
  • 41
  • 63