PHP code example of phpro / zf-smartcrud
1. Go to this page and download the library: Download phpro/zf-smartcrud library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
phpro / zf-smartcrud example snippets
'phpro-smartcrud-gateway' => array(
'smartcrud.gateway.doctrine.default' => array(
'type' => 'PhproSmartCrud\Gateway\DoctrineCrudGateway',
'options' => array(
'object_manager' => 'doctrine.documentmanager.odm_default',
),
)
),
'phpro-smartcrud-service' => array(
'SmartCrudServiceKey' => array(
'default' => array(
'gateway' => 'smartcrud.gateway.doctrine.default',
'entity-class' => 'entity-key',
'form' => 'form-key',
'listeners' => []
),
),
),
'phpro-smartcrud-service' => array(
'default-list' => array(
'options' => array(
'paginator' => array(
'adapter_class' => '\Zend\Paginator\Adapter\ArrayAdapter',
'page_size' => 50,
'page_key' => 'page',
),
)
)
),
'phpro-smartcrud-service' => array(
'default-list' => array(
'options' => array(
'query-provider' => 'servicemanager.key.my-custom-query-provider',
),
)
),
CrudEvent::BEFORE_LIST
CrudEvent::AFTER_LIST
CrudEvent::BEFORE_DATA_VALIDATION
CrudEvent::BEFORE_CREATE
CrudEvent::AFTER_CREATE
CrudEvent::INVALID_CREATE
CrudEvent::BEFORE_READ
CrudEvent::AFTER_READ
CrudEvent::BEFORE_UPDATE
CrudEvent::AFTER_UPDATE
CrudEvent::INVALID_UPDATE
CrudEvent::BEFORE_DELETE
CrudEvent::AFTER_DELETE
CrudEvent::INVALID_DELETE
CrudEvent::BEFORE_VALIDATE
CrudEvent::AFTER_VALIDATE
CrudEvent::FORM_READY
'phpro-smartcrud-controller' => array(
'default' => array(
'view-builder' => 'Phpro\SmartCrud\View\Model\ViewModelBuilder',
)
'SmartCrudControllerKey' => array(
'controller' => 'Phpro\SmartCrud\Controller\CrudController',
'identifier-name' => 'identifier',
'smart-service' => 'SmartCrudServiceKey',
'view-builder' => 'Phpro\SmartCrud\View\Model\ViewModelBuilder',
'view-path' => 'path',
),
),
sh
php composer.phar version, type `dev-master`)