Download the PHP package rasclatt/smart-dto without Composer

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

SmartDto\Dto

Create and manipulate Data Transfer Objects

Basic Use

First, create your Dto:

Reference your Dto in your model

Basic Result:

Advanced Example

Revised Dto to include some model-esque features:

Advanced Result

This will produce a different result than the first example because it will run the "id()" method as well:

Parameter Conversion

You are able to convert the input array before assigning the keys to your Dto:

Convert Using A Constant

This will map to camel case.

This will then be mapped to your camel cased parameters:

If you have a string such as 'thedescription', it will not generate camel case because there is no way to know where to break. You would want to use afterConstruct() method to generate that manually to theDescription or use \SmartDto\Mapper object to map two different arrays.

SmartDto\Mapper

This object will generate a string for copy and pasting to your DTO class by examining your input data:

This will produce a string that you can copy and paste:

Pass true to the public function getAttributes(true); to add types behind your parameters:

Map Two Arrays

You might find you need to take one return array and force it into a new array with different keys from the original (like an adapter). This allows you to take two arrays and map the keys and values from each array:

This would produce:


All versions of smart-dto with dependencies

PHP Build Version
Package Version
No informations.
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 rasclatt/smart-dto contains the following files

Loading the files please wait ....