Abstract class Phalcon\Application¶
extends abstract class Phalcon\Di\Injectable
implements Phalcon\Events\EventsAwareInterface, Phalcon\Di\InjectionAwareInterface
Base class for Phalcon\Cli\Console and Phalcon\Mvc\Application.
Methods¶
public __construct ([Phalcon\DiInterface $dependencyInjector])
Phalcon\Application Constructor
public setEventsManager (Phalcon\Events\ManagerInterface $eventsManager)
Sets the events manager
public getEventsManager ()
Returns the internal event manager
public registerModules (array $modules, [mixed $merge])
Register an array of modules present in the application
<?php
$this->registerModules(
[
"frontend" => [
"className" => "Multiple\Frontend\Module",
"path" => "../apps/frontend/Module.php",
],
"backend" => [
"className" => "Multiple\Backend\Module",
"path" => "../apps/backend/Module.php",
],
]
);
public getModules ()
Return the modules registered in the application
public getModule (mixed $name)
Gets the module definition registered in the application via module name
public setDefaultModule (mixed $defaultModule)
Sets the module name to be used if the router doesn't return a valid module
public getDefaultModule ()
Returns the default module name
abstract public handle ()
Handles a request
public setDI (Phalcon\DiInterface $dependencyInjector) inherited from Phalcon\Di\Injectable
Sets the dependency injector
public getDI () inherited from Phalcon\Di\Injectable
Returns the internal dependency injector
public __get (string $propertyName) inherited from Phalcon\Di\Injectable
Magic method __get
layout: default title: 'Phalcon\Application\Exception'
Class Phalcon\Application\Exception¶
extends class Phalcon\Exception
implements Throwable
Methods¶
final private Exception __clone () inherited from Exception
Clone the exception
public __construct ([mixed $message], [mixed $code], [mixed $previous]) inherited from Exception
Exception constructor
public __wakeup () inherited from Exception
...
final public string getMessage () inherited from Exception
Gets the Exception message
final public int getCode () inherited from Exception
Gets the Exception code
final public string getFile () inherited from Exception
Gets the file in which the exception occurred
final public int getLine () inherited from Exception
Gets the line in which the exception occurred
final public array getTrace () inherited from Exception
Gets the stack trace
final public Exception getPrevious () inherited from Exception
Returns previous Exception
final public Exception getTraceAsString () inherited from Exception
Gets the stack trace as a string
public string __toString () inherited from Exception
String representation of the exception