Skip to content

Phalcon Application

Updated View as Markdown

Application\AbstractApplication

AbstractSource on GitHub

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

Uses Phalcon\Application\Exceptions\ModuleNotRegistered · Phalcon\Di\DiInterface · Phalcon\Di\Injectable · Phalcon\Events\EventsAwareInterface · Phalcon\Events\ManagerInterface

Method Summary

Properties

protectedDiInterface|null$container = null
protectedstring$defaultModule = ""
protectedManagerInterface|null$eventsManager = null
protectedarray$modules = []

Methods

Public · 8

__construct()

public function __construct( DiInterface $container = null );

Phalcon\AbstractApplication constructor

getDefaultModule()

public function getDefaultModule(): string;

Returns the default module name

getEventsManager()

public function getEventsManager(): ManagerInterface|null;

Returns the internal event manager

getModule()

public function getModule( string $name ): array|object;

Gets the module definition registered in the application via module name

getModules()

public function getModules(): array;

Return the modules registered in the application

registerModules()

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

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",
        ],
    ]
);

setDefaultModule()

public function setDefaultModule( string $defaultModule ): static;

Sets the module name to be used if the router does not return a valid module

setEventsManager()

public function setEventsManager( ManagerInterface $eventsManager ): void;

Sets the events manager

Application\Exception

ClassSource on GitHub

Exceptions thrown in Phalcon\Application class will use this class

Application\Exceptions\ModuleNotRegistered

ClassSource on GitHub

This file is part of the Phalcon Framework.

(c) Phalcon Team <[email protected]>

For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code.

Uses Phalcon\Application\Exception

Method Summary

Methods

Public · 1

__construct()

public function __construct( string $name );

Type to search…

↑↓ navigate↵ selectEsc close