Sections

Abstract Class Phalcon\Application\AbstractApplication

Broncode op GitHub

Namespace Phalcon\Application   Uses Phalcon\Application\Exception, 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
 */
protected container;

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

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

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

Methoden

public function __construct( DiInterface $container = null ): void;

Phalcon\AbstractApplication constructor

public function getDefaultModule(): string;

Returns the default module name

public function getEventsManager(): ManagerInterface;

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

abstract public function handle();

Handles a request

public function registerModules( array $modules, bool $merge = bool ): Application;

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 ): Application;

Sets the module name to be used if the router doesn’t return a valid module

public function setEventsManager( ManagerInterface $eventsManager ): Application;

Sets the events manager

Class Phalcon\Application\Exception

Broncode op GitHub

Namespace Phalcon\Application   Extends \Phalcon\Exception

Exceptions thrown in Phalcon\Application class will use this class