Class Phalcon\Mvc\Application

Source Github from namespace : \ Phalcon \ Mvc

Phalcon\Mvc\Application

This component encapsulates all the complex operations behind instantiating every component needed and integrating it with the rest to allow the MVC pattern to operate as desired. class Application extends \Phalcon\Mvc\Application { / Register the services here to make them general or register in the ModuleDefinition to make them module-specific \/ protected function _registerServices() { } / This method registers all the modules in the application \/ public function main() { $this->registerModules(array( 'frontend' => array( 'className' => 'Multiple\Frontend\Module', 'path' => '../apps/frontend/Module.php' ), 'backend' => array( 'className' => 'Multiple\Backend\Module', 'path' => '../apps/backend/Module.php' ) )); } } $application = new Application(); $application->main();
Methods
Methods Details
  • public function

    __construct

    (variable $dependencyInjector)
    Phalcon\Mvc\Application
  • public function

    useImplicitView

    (bool $implicitView)
    By default. The view is implicitly buffering all the output
    You can full disable the view component using this method
  • public function

    registerModules

    (array $modules, bool $merge)
    Register an array of modules present in the application
    $this->registerModules(array( 'frontend' => array( 'className' => 'Multiple\Frontend\Module', 'path' => '../apps/frontend/Module.php' ), 'backend' => array( 'className' => 'Multiple\Backend\Module', 'path' => '../apps/backend/Module.php' ) ));
  • public function

    getModules

    ()
    Return the modules registered in the application
  • public function

    getModule

    (string $name)
    Gets the module definition registered in the application via module name
  • public function

    setDefaultModule

    (string $defaultModule)
    Sets the module name to be used if the router doesn't return a valid module
  • public function

    getDefaultModule

    ()
    Returns the default module name
  • public function

    handle

    (variable $uri)
    Handles a MVC request
Follow along: