Application\AbstractApplication
AbstractSource on GitHubBase class for Phalcon\Cli\Console and Phalcon\Mvc\Application.
\stdClassPhalcon\Di\InjectablePhalcon\Application\AbstractApplication- implementsPhalcon\Events\EventsAwareInterface
Uses Closure · Phalcon\Application\Exceptions\ModuleNotRegistered · Phalcon\Contracts\Application\ApplicationTypes · Phalcon\Di\DiInterface · Phalcon\Di\Injectable · Phalcon\Events\EventsAwareInterface · Phalcon\Events\ManagerInterface · Phalcon\Events\Traits\EventsAwareTrait
Method Summary
public__construct( DiInterface|null$container = null )AbstractApplication constructor.publicstringgetDefaultModule()Returns the default module namepublicmixedgetModule( 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 validpublicvoidsetEventsManager( ManagerInterface$eventsManager )Sets the events managerProperties
protectedstring$defaultModule = ""protectedarray$modules = []Methods
__construct()
public function __construct( DiInterface|null $container = null );AbstractApplication constructor.
getDefaultModule()
public function getDefaultModule(): string;Returns the default module name
getModule()
public function getModule( string $name ): mixed;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 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
__construct()
public function __construct( string $name );