Download the PHP package matiasnamendola/slimpower-slim without Composer

On this page you can find all versions of the php package matiasnamendola/slimpower-slim. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package slimpower-slim

SlimPower - Slim

Latest version Total Downloads

Latest Stable Version Total Downloads Monthly Downloads Daily Downloads composer.lock available

An extension to Slim Framework that allows you use to dynamically instantiated controllers with action methods wherever you would use a closure or callback when routing.

The controller can optionally be loaded from Slim's DI container, allowing you to inject dependencies as required.

Additionally, this extension implements Json Middleware & View with great ease.

Installation

Look at Installation File

Usage - Dynamic controller instantiation

Use the string format {controller class name}:{action method name} wherever you would usually use a closure:

e.g.

You can also register the controller with Slim's DI container:

Example controller

SlimPower - Slim Controller will call the controller's setApp(), setRequest() and setResponse() methods if they exist and populate appropriately. It will then call the controller's `init()`` method.

Hence, a typical controller may look like:

Usage - Json Middleware

To include the middleware and view you just have to load them using the default Slim way. Read more about Slim Here (https://github.com/codeguy/Slim#getting-started)

Example method

All your requests will be returning a JSON output. the usage will be $app->render( (int)$HTTP_CODE, (array)$DATA);

Example code

Example output

Errors

To display an error just set the error => true in your data array. All requests will have an error param that defaults to false.

You can optionally throw exceptions, the middleware will catch all exceptions and display error messages.

Embedding response data and metadata in separate containers

It is possible to separate response metadata and business information in separate containers.

To make it possible just init JsonView with containers names

Response

Routing specific requests to the API

If your site is using regular HTML responses and you just want to expose an API point on a specific route, you can use Slim router middlewares to define this.

Middleware

The middleware will set some static routes for default requests. if you dont want to use it, you can copy its content code into your bootstrap file.

IMPORTANT: remember to use $app->config('debug', false); or errors will still be printed in HTML

Credits

License

The MIT License (MIT). Please see License File for more information.

Example project

Look at slimpower-slim-example.


All versions of slimpower-slim with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
slim/slim Version 2.*
symfony/yaml Version v2.6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package matiasnamendola/slimpower-slim contains the following files

Loading the files please wait ....