extends abstract class Phalcon\Di\Injectable
implements Phalcon\Events\EventsAwareInterface, Phalcon\Di\InjectionAwareInterface, ArrayAccess
With Phalcon you can create “Micro-Framework like” applications. By doing this, you only need to write a minimal amount of code to create a PHP application. Micro applications are suitable to small applications, APIs and prototypes in a practical way.
$app = new \Phalcon\Mvc\Micro(); $app->get( "/say/welcome/{name}", function ($name) { echo "<h1>Welcome $name!</h1>"; } ); $app->handle();
Phalcon\Mvc\Micro constructor
Sets the DependencyInjector container
Maps a route to a handler without any HTTP method constraint
Maps a route to a handler that only matches if the HTTP method is GET
Maps a route to a handler that only matches if the HTTP method is POST
Maps a route to a handler that only matches if the HTTP method is PUT
Maps a route to a handler that only matches if the HTTP method is PATCH
Maps a route to a handler that only matches if the HTTP method is HEAD
Maps a route to a handler that only matches if the HTTP method is DELETE
Maps a route to a handler that only matches if the HTTP method is OPTIONS
Mounts a collection of handlers
Sets a handler that will be called when the router doesn’t match any of the defined routes
Sets a handler that will be called when an exception is thrown handling the route
Returns the internal router used by the application
Sets a service from the DI
Checks if a service is registered in the DI
Obtains a service from the DI
Obtains a shared service from the DI
Handle the whole request
Stops the middleware execution avoiding than other middlewares be executed
Sets externally the handler that must be called by the matched route
Return the handler that will be called for the matched route
Returns the value returned by the executed handler
Check if a service is registered in the internal services container using the array syntax
Allows to register a shared service in the internal services container using the array syntax
$app["request"] = new \Phalcon\Http\Request();
Allows to obtain a shared service in the internal services container using the array syntax
var_dump( $app["request"] );
Removes a service from the internal services container using the array syntax
Appends a before middleware to be called before execute the route
Appends a afterBinding middleware to be called after model binding
Appends an ‘after’ middleware to be called after execute the route
Appends a ‘finish’ middleware to be called when the request is finished
Returns the internal handlers attached to the application
Gets model binder
Sets model binder
$micro = new Micro($di); $micro->setModelBinder(new Binder(), 'cache');
Returns bound models from binder instance
Returns the internal dependency injector
Sets the event manager
Returns the internal event manager
Magic method __get
© 2011–2017 Phalcon Framework Team
Licensed under the Creative Commons Attribution License 3.0.
https://docs.phalconphp.com/en/latest/api/Phalcon_Mvc_Micro.html