Application\AbstractApplication
AbstractSource on GitHubBase class for Phalcon\Cli\Console and Phalcon\Mvc\Application.
stdClassPhalcon\Di\InjectablePhalcon\Application\AbstractApplication- implementsPhalcon\Events\EventsAwareInterface
Uses Phalcon\Application\Exceptions\ModuleNotRegistered · Phalcon\Di\DiInterface · Phalcon\Di\Injectable · Phalcon\Events\EventsAwareInterface · Phalcon\Events\ManagerInterface
Method Summary
public__construct( DiInterface$container = null )Phalcon\AbstractApplication constructorpublicstringgetDefaultModule()Returns the default module namepublicManagerInterface|nullgetEventsManager()Returns the internal event managerpublicarray|objectgetModule( string$name )Gets the module definition registered in the application via module namepublicarraygetModules()Return the modules registered in the applicationpublicstaticregisterModules(array$modules,bool$merge = false)Register an array of modules present in the applicationpublicstaticsetDefaultModule( string$defaultModule )Sets the module name to be used if the router does not return a valid modulepublicvoidsetEventsManager( ManagerInterface$eventsManager )Sets the events managerProperties
protectedstring$defaultModule = ""protectedManagerInterface|null$eventsManager = nullprotectedarray$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 GitHubExceptions thrown in Phalcon\Application class will use this class
\ExceptionPhalcon\Application\Exception
Application\Exceptions\ModuleNotRegistered
ClassSource on GitHub\ExceptionPhalcon\Application\ExceptionPhalcon\Application\Exceptions\ModuleNotRegistered
Uses Phalcon\Application\Exception
Method Summary
Methods
Public · 1
__construct()
public function __construct( string $name );