Class Phalcon\Cli\Console

extends abstract class Phalcon\Application

implements Phalcon\Di\InjectionAwareInterface, Phalcon\Events\EventsAwareInterface

Source on GitHub

This component allows to create CLI applications using Phalcon

Methods

public addModules (array $modules)

Merge modules with the existing ones

  1. <?php
  2. $application->addModules(
  3. [
  4. "admin" => [
  5. "className" => "Multiple\\Admin\\Module",
  6. "path" => "../apps/admin/Module.php",
  7. ],
  8. ]
  9. );

public handle ([array $arguments])

Handle the whole command-line tasks

public setArgument ([array $arguments], [mixed $str], [mixed $shift])

Set an specific argument

public __construct ([Phalcon\DiInterface $dependencyInjector]) inherited from Phalcon\Application

Phalcon\Application

public setEventsManager (Phalcon\Events\ManagerInterface $eventsManager) inherited from Phalcon\Application

Sets the events manager

public getEventsManager () inherited from Phalcon\Application

Returns the internal event manager

public registerModules (array $modules, [mixed $merge]) inherited from Phalcon\Application

Register an array of modules present in the application

  1. <?php
  2. $this->registerModules(
  3. [
  4. "frontend" => [
  5. "className" => "Multiple\\Frontend\\Module",
  6. "path" => "../apps/frontend/Module.php",
  7. ],
  8. "backend" => [
  9. "className" => "Multiple\\Backend\\Module",
  10. "path" => "../apps/backend/Module.php",
  11. ],
  12. ]
  13. );

public getModules () inherited from Phalcon\Application

Return the modules registered in the application

public getModule (mixed $name) inherited from Phalcon\Application

Gets the module definition registered in the application via module name

public setDefaultModule (mixed $defaultModule) inherited from Phalcon\Application

Sets the module name to be used if the router doesn’t return a valid module

public getDefaultModule () inherited from Phalcon\Application

Returns the default module name

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 (mixed $propertyName) inherited from Phalcon\Di\Injectable

Magic method __get