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
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. Alias for Phalcon\Mvc\Micro::hasService()
Allows to register a shared service in the internal services container using the array syntax. Alias for Phalcon\Mvc\Micro::setService()
$app['request'] = new Phalcon\Http\Request();
Allows to obtain a shared service in the internal services container using the array syntax. Alias for Phalcon\Mvc\Micro::getService()
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 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
Returns the internal dependency injector
Sets the event manager
Returns the internal event manager
Magic method __get
© 2011–2016 Phalcon Framework Team
Licensed under the Creative Commons Attribution License 3.0.
https://docs.phalconphp.com/en/2.0.0/api/Phalcon_Mvc_Micro.html