Download the PHP package phifty/crud without Composer

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

CRUDSearchAction

To modify or composite the result data, simply override the searchComposite method:

protected function searchComposite(Collection $collection)
{
    return $collection->toInflatedArray();
}

React List App

To enable react list app, define the property here:

protected $reactListApp = '....';

Has Many Editor

use CRUD\CRUDReactHasManyEditor;

/**
 * itemDesc describes the relationship between data and the placeholder designed in the UI
 * and defines how the cover view should be built
 *
 * @return array
 */
public function itemDesc()
{
    $controls = [];
    if ($this->canCreate) {
        $controls[] = ['action' => 'create'];
    }
    if ($this->canUpdate) {
        $controls[] = ['action' => 'edit'];
    }
    if ($this->canDelete) {
        $controls[] = ['action' => 'delete'];
    }
    return [
        "view" => "ImageCoverView",
        "display" => "float",
        "coverImage" => [
            "field" => ["thumb", "image"],
            "width" => 200,
            "height" => 100,
            "backgroundSize" => "cover"
        ],
        "title" => ["field" => "title" ],
        "controls" => $controls,
    ];
}

/**
 * itemDesc describes the relationship between data and the placeholder designed in the UI
 * and defines how the cover view should be built
 *
 * @return array
 */
public function itemDesc()
{
    $controls = [];
    if ($this->canUpdate) {
        $controls[] = ['action' => 'edit'];
    }
    if ($this->canDelete) {
        $controls[] = ['action' => 'delete'];
    }
    return [
        "view" => "TextCoverView",
        "display" => "block",
        "title" => [ "field" => "name" ],
        "subtitle" => ["format" => "備註: {comment}"],
        "desc" => [ "field" => "description" ],
        "footer" => [
            "columns" => [
                [ "text" => [ 'format' => '數量 {quantity}' ] ],
                [ "text" => [ 'format' => '價格 $ {price}' ] ]
            ]
        ],
        "controls" => $controls,
    ];
}

/**
 * itemDesc describes the relationship between data and the placeholder designed in the UI
 * and defines how the cover view should be built
 *
 * @return array
 */
public function itemDesc()
{
    $controls = [];
    if ($this->canUpdate) {
        $controls[] = ['action' => 'edit'];
    }
    if ($this->canDelete) {
        $controls[] = ['action' => 'delete'];
    }
    return [
        "view" => "TextCoverView",
        "display" => "block",
        "title" => [ "field" => "name" ],
        "subtitle" => [ "format" => "{address} {cellphone}" ],
        "desc" => [ "field" => "identity_no" ],
        "footer" => [
            /*
            "columns" => [
                [ "text" => [ 'format' => '費用 $ {fee}' ] ],
                [ "text" => [ 'format' => '距離 {distance} km' ] ],
                [ "tags" => [ [ 'format' => '$ {fee}' ], [ 'format' => '{distance} km' ] ] ]
            ]
            */
        ],
        "controls" => $controls,
    ];
}

/**
 * itemDesc describes the relationship between data and the placeholder designed in the UI
 * and defines how the cover view should be built
 *
 * @return array
 */
public function itemDesc()
{
    $controls = [];
    if ($this->canCreate) {
        $controls[] = ['action' => 'create'];
    }
    if ($this->canUpdate) {
        $controls[] = ['action' => 'edit'];
    }
    if ($this->canDelete) {
        $controls[] = ['action' => 'delete'];
    }
    return [
        'columns' => [
            [ 'label' => '姓名', 'key' => 'name' ],
            [ 'label' => '性別', 'key' => 'gender' ],
            [ 'label' => '身份證字號', 'key' => 'identity_no' ],
            [ 'label' => '手機', 'key' => 'cellphone' ],
            [ 'label' => '地址', 'key' => 'address', 'style' => [ 'maxWidth' => 180, 'display' => 'inline-block' ]],
            [ 'label' => '組別', 'key' => 'event_group_title', ],
            [ 'label' => '費用', 'key' => 'total_amount' ],
        ],
        'controls' => $controls,
    ];
}

public function itemViewBuilder()
{
    return 'EventRatingViewBuilder';
}

Using React Editor in the templates

public function createRegionActionPrepare()
{
    parent::createRegionActionPrepare();
    $record = $this->getCurrentRecord();

    $controller = new EventProductCRUDHandler;
    $this->assign('productEditAppConfig', $controller->buildReactHasManyEditorConfig($record, 'products')); // it belongs to reviews
}

{% reactapp "CRUDHasManyEditor" with productTypeEditAppConfig %}

Override Search Action

/**
 * @override searchAction
 */
public function searchAction()
{
    $collection = $this->search($this->getRequest());
    $items = [];
    foreach ($collection as $record) {
        $array = $record->toInflatedArray();
        $array['product'] = $record->product->toInflatedArray();
        $items[] = $array;
    }
    return $this->toJson($items);
}

/**
 * Provide the search functionality to return matched collection in JSON
 * format response.
 */
public function searchAction()
{
    $collection = $this->search($this->getRequest());
    return $this->toJson(array_map(function($item) {
        $array = $item->toInflatedArray();
        $array['gender'] = $item->display('gender');
        $array['total_amount'] = $item->calculateTotalAmount();
        if ($item->event_group_id) {
            $array['event_group_title'] = $item->event_group->title;
        }
        return $array;
    }, $collection->items()));
}

All versions of crud with dependencies

PHP Build Version
Package Version
Requires phifty/phifty Version ^3.1.0
composer/installers Version ~1.0.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 phifty/crud contains the following files

Loading the files please wait ....