Skip to content

Phalcon application

NOTE

All classes are prefixed with Phalcon

Application\AbstractApplication Abstract

Source on GitHub

  • Namespace

    • Phalcon\Application
  • Uses

    • Phalcon\Di\DiInterface
    • Phalcon\Di\Injectable
    • Phalcon\Events\EventsAwareInterface
    • Phalcon\Events\ManagerInterface
  • Extends

    Injectable

  • Implements

    • EventsAwareInterface

Base class for Phalcon\Cli\Console and Phalcon\Mvc\Application.

Properties

/**
 * @var DiInterface|null
 */
protected $container;

/**
 * @var string
 */
protected $defaultModule = ;

/**
 * @var ManagerInterface|null
 */
protected $eventsManager;

/**
 * @var array
 */
protected $modules;

Methods

public function __construct( DiInterface $container = null );
Phalcon\AbstractApplication constructor

public function getDefaultModule(): string;
Returns the default module name

public function getEventsManager(): ManagerInterface | null;
Returns the internal event manager

public function getModule( string $name ): array | object;
Gets the module definition registered in the application via module name

public function getModules(): array;
Return the modules registered in the application

public function registerModules( array $modules, bool $merge = bool ): AbstractApplication;
Register an array of modules present in the application

$this->registerModules(
    [
        "frontend" => [
            "className" => \Multiple\Frontend\Module::class,
            "path"      => "../apps/frontend/Module.php",
        ],
        "backend" => [
            "className" => \Multiple\Backend\Module::class,
            "path"      => "../apps/backend/Module.php",
        ],
    ]
);

public function setDefaultModule( string $defaultModule ): AbstractApplication;
Sets the module name to be used if the router doesn't return a valid module

public function setEventsManager( ManagerInterface $eventsManager ): void;
Sets the events manager

Application\Exception

Source on GitHub

  • Namespace

    • Phalcon\Application
  • Uses

  • Extends

    \Exception

  • Implements

Exceptions thrown in Phalcon\Application class will use this class