Download the PHP package sircamp/response without Composer

On this page you can find all versions of the php package sircamp/response. 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 response

Sircamp Response

This package allows you to have a "Boostrap-like" rest response object using an Alert like: Info, Warning, Error, Success.

With this package you only return the right response object to your views or your REST response, you can set the correct type of Boostrap alert without any IF statement. Also, on each response object that you create, you can set a message a data payload with all your data.

INSTALLATION

In your root project's directory type:

According to your composer.json, you obtain the right version (stable or dev)

USAGE

In each file where you are using one of the Sircamp\Response objects you must add the right namespace.

new Response

To create new Response object ( InfoResponse for example ) you need two parameters.

A String message, that could be empty, and an array named data.

The data array could contain everthing you want, object, string and much more.

Pay attention that each type of object has automatically set the type string parameter:

getType

This method returns the type of object's istance

setType

This method sets the type of the object

getMessage

This method returns the message attribute of of the object

setMessage

This method sets the message attribute of of the object

getData

This method returns the data attribute of of the object

setData

This method sets the data attribute of of the object. As seed the $data parameters is an associative array that contains a mixin of variable

addAllowedType

This method is a static method that allows you to add a castum response type. If you add a custom type, you can create a new extended custom class ( with your desidered type ) at runtime.

To create an anonymous runtime class you must have PHP 7


All versions of response with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
respect/validation Version ^0.9.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 sircamp/response contains the following files

Loading the files please wait ....