A full-stack PHP framework delivered as a C-extension

Its innovative architecture makes Phalcon the fastest PHP framework ever built! See for yourself...

  Watch the demo video: A polling app built from scratch in < 15 min.

Discover the wealth of built-in components

Low overhead

PHP C-extension (Phalcon)

  • C-extensions are loaded together with PHP one time on the web server’s daemon start process
  • Classes and functions provided by the extension are ready to use for any application
  • The code is compiled and isn’t interpreted because is already compiled to a specific platform and processor
  • Thanks to its low-level architecture and optimizations Phalcon provides the lowest overhead for MVC-based applications

Model-View-Controller

Build single and multi-module applications with ease and pleasure. Using the file structure, scheme and patterns you already know.


    single/
        app/
            controllers/
            models/
            views/
        public/
            css/
            img/
            js/
                                        

    multiple/
      apps/
        frontend/
           controllers/
           models/
           views/
           Module.php
        backend/
           controllers/
           models/
           views/
           Module.php
        public/
        ../
                                        

Dependency Injection

Phalcon is built upon a powerful yet ease to understand and use pattern called Dependency Injection. Initialize or define services once - and use them virtually anywhere throughout the application.


//Create the Dependency Injector Container
$di = new Phalcon\DI();

//Register classes, functions, components
$di->set("request", new Phalcon\Http\Request());

..

//Use anywhere else in code
$request = $di->getShared("request");

                                

RESTful services

Writing REST servers and applications has never been easier. No boilerplate. Simple services will fit in one file.


    $app = new Phalcon\Mvc\Micro();

    //Returning data in JSON
    $app->get('/get/data.json', function () {
        echo json_encode(array("some", "important", "data"));
    });

    $app->handle();
                                

Universal Class Loader

Register namespaces, prefixes, directories or classes. Take advantage of Autoloader events and maintain full controll over the business logic using Autoloader configuration.


    // Creates the autoloader
    $loader = new \Phalcon\Loader();

    // Register some directories
    $loader->registerDirs(
        array(
            "library/MyComponent/",
            "vendor/example/adapters/",
            "vendor/example/"
        )
    );

    // register autoloader
    $loader->register();
                                

Router

Routing as it supposed to be. Nothing more. Nothing less.


    // Create the router
    $router = new \Phalcon\Mvc\Router();

    //Define a route
    $router->add(
        "/admin/users/my-profile",
        array(
            "controller" => "users",
            "action"     => "profile",
        )
    );
                                

Come join our vibrant developer community!

phalcon andresgutierrez sjinks niden ovr dreamsxin xboston carvajaldiazeduar mruz sergeyklay nkt kenjikobe SidRoberts Cinderella-Man steffengy endeveit tmihalik quantum13 kjdev JimmDiGrizli WooDzu racklin iGusev KorsaR-ZN Green-Cat olivier-monaco netstu dogstarTest gsouf digitronac marciopaiva odiel qzfzz mobli rianorie Chameleon-m akaNightmare inouet xueron jerejones maxgalbu Myleft dugwood uonick boxbillinggit rigin wenchen unisys12 brainformatik 0 MaxCodeX Barbery relort thecodeassassin fogcity panlatent pvm quasipickle richmulhern dario1985 nexik zyxep theDisco Theader MiuraKatsu 7thcubic ilyk hylent tyler-shaw ogarbe parshikov nazwa braska vguardiola duythien YerlenZhubangaliyev PyYoshi thehe andycheg netyum h0tw1r3 brikou kenjis niterain

Learn to fly with Phalcon 2

Get started by learning the basic concepts behind a common Phalcon application

Try the tutorial

Meet Zephir

Learn about the technology that empowers Phalcon

Visit the website

Help Phalcon to fly higher

Show your appreciation and help us with project costs by simply donating via:

Pledgie or
Follow along: