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

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 apprecition and help us with project costs by simply donating via:

Pledgie or
Follow along: