Download the PHP package ddruganov/yii2-api-essentials without Composer
On this page you can find all versions of the php package ddruganov/yii2-api-essentials. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download ddruganov/yii2-api-essentials
More information about ddruganov/yii2-api-essentials
Files in ddruganov/yii2-api-essentials
Download ddruganov/yii2-api-essentials
More information about ddruganov/yii2-api-essentials
Files in ddruganov/yii2-api-essentials
Vendor ddruganov
Package yii2-api-essentials
Short Description Bunch of components to make one's development life eaisier
License
Package yii2-api-essentials
Short Description Bunch of components to make one's development life eaisier
License
Please rate this library. Is it a good library?
Informations about the package yii2-api-essentials
yii2-api-essentials
Bunch of small components to make one's yii2 api development life eaiser
Installation
composer require ddruganov/yii2-api-essentials
Description
This package contains useful classes (filters, behaviors, helpers, etc) for api development:
behaviors\TimestampBehavior
: provides basic timestamping of an active record model with fields being 'created_at' and 'updated_at' (detects their existence automatically)collectors\AbstractDataCollector
: a convient way to collect data for an api callexceptions\ModelNotFoundException
: when a search for a model in database failsexceptions\NotImplementedException
: when you need to write an implementation for a method but... later :Dforms\Form
: a container that performs validation of data and manipulates in a certain way; super useful for creating models without directly using an ActiveRecord; also used as a base for data collectorshttp\actions\ApiAction
: base class for all api actions that provides a way to get all incoming data as one array; returns anExecutionResult
and a status code appropriate for that execution result;http\actions\ClosureAction
: when theApiModelAction
is too overkillhttp\actions\FormAction
: provides a way to separate validation and saving of data to reduce class bloat; usesForm
http\controllers\ApiController
: returns everything as json, measures every request timing and makes all api calls transactionalhttp\filters\TimerFilter
: measures the time that an action takes and dumps into the debug loghttp\filters\TransactionFilter
: starts transaction before action, ends it after action; depends onExecutionResult
being successfultesting\UnitTest
: base unit test class; provides a convenient way to assertExecutionResult
state and a customizable faker generatortraits\Activity
: used inActiveQuery
to only get active modelstraits\Pagination
: used inActiveQuery
to set a page in a list query and to get a page counttraits\Sorting
: used inActiveQuery
to sort models; deafult field iscreated_at
traits\SoftDelete
: used inActiveRecord
, when a model is deleted thedeleted_at
field is filled withdate('Y-m-d H:i:s')
DateHelper
: bunch of useful methods for date manipulationExecutionResult
: basically a statically typed version of an array with a specific structure to ensure that all methods working with data return the same structure, but not limited to that
ApiController example
TestCollector
and TestForm
extend the forms\Form
ActiveQuery traits example
ActiveRecord-related components example
Form example
All versions of yii2-api-essentials with dependencies
PHP Build Version
Package Version
Requires
yiisoft/yii2 Version
^2.0
fakerphp/faker Version ^1.19
codeception/codeception Version *
codeception/module-asserts Version *
fakerphp/faker Version ^1.19
codeception/codeception Version *
codeception/module-asserts Version *
The package ddruganov/yii2-api-essentials contains the following files
Loading the files please wait ....