{"id":16199004,"url":"https://github.com/drsdre/yii2-radtools","last_synced_at":"2026-04-29T00:04:49.469Z","repository":{"id":56972450,"uuid":"75830413","full_name":"drsdre/yii2-radtools","owner":"drsdre","description":"Rapid Application Development tools to quickly build interconnected crud UI. Uses yii2-ajaxcrud to generate the pop-up forms and kartik-v's Grid for overviews.","archived":false,"fork":false,"pushed_at":"2019-04-12T12:03:37.000Z","size":90,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-13T19:44:40.302Z","etag":null,"topics":["admin-ui","hierarchy","rad","yii2","yii2-ajaxcrud"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drsdre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-07T11:39:51.000Z","updated_at":"2019-04-12T12:02:24.000Z","dependencies_parsed_at":"2022-08-21T10:20:10.701Z","dependency_job_id":null,"html_url":"https://github.com/drsdre/yii2-radtools","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drsdre%2Fyii2-radtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drsdre%2Fyii2-radtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drsdre%2Fyii2-radtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drsdre%2Fyii2-radtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drsdre","download_url":"https://codeload.github.com/drsdre/yii2-radtools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247699185,"owners_count":20981493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admin-ui","hierarchy","rad","yii2","yii2-ajaxcrud"],"created_at":"2024-10-10T09:15:29.063Z","updated_at":"2026-04-29T00:04:49.431Z","avatar_url":"https://github.com/drsdre.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Yii2 RAD Tools\n==============\n\n[![Build Status](https://travis-ci.org/drsdre/yii2-radtools.svg?branch=master)](https://travis-ci.org/drsdre/yii2-radtools)\n\nRapid Application Development controller for quick and complete crud interfaces\nto linked database models. \nIt supports [yii2-ajaxcrud](https://github.com/johnitvn/yii2-ajaxcrud) for modal based crud forms (pop-ups),\n [kartik-v/Dynagrid](https://github.com/kartik-v/yii2-dynagrid) for the Gridview \nand [kartik-v/yii2-detail-view](https://github.com/kartik-v/yii2-detail-view) for integrated view/update/create forms.\n\nThe controller comes with the following build-in actions:\n* index: full page using build in or kartik-v GridView\n* view: either full page or using yii2-ajaxcrud modal\n* create: either full page or using yii2-ajaxcrud modal\n* copy: either full page or using yii2-ajaxcrud modal\n* update: either full page or using yii2-ajaxcrud modal\n* delete: either full page or using yii2-ajaxcrud modal\n* bulkUpdate: for bulk actions from GridView\n* bulkDelete: for bulk actions from GridView\n\nAll actions can be configured to have specific success URL's and custom variables to be send to the view. \nWhen a 'return_url' GET parameter with the action, it will overrule the success URL.\n\nInstallation\n------------\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```\nphp composer.phar require --prefer-dist drsdre/yii2-radtools \"*\"\n```\n\nor add\n\n```\n\"drsdre/yii2-radtools\": \"*\"\n```\n\nto the require section of your `composer.json` file.\n\n\nUsage\n-----\n\nOnce the extension is installed, simply extend from BaseAjaxCrudController and add settings:\n\n```php\nclass UserController extends drsdre\\radtools\\BaseAjaxCrudController\n{\n    protected $useDynagrid = true;\n    protected $modelClass = 'app\\models\\UserForm';\n    protected $searchModelClass ='app\\models\\search\\UserSearch';\n    protected $model_name = 'User';\n    protected $model_field_name = 'username';\n```\n\nTo use hierarchy links, simply extend from AjaxCrudHierarchyLinkController and setup $hierarchy_links parameter:\n```php\nclass TableController extends drsdre\\radtools\\AjaxCrudHierarchyLinkController\n{   \n    protected $useDetailView = true;\n    protected $useDynagrid = true;\n    protected $modelClass = 'app\\models\\UserForm';\n    protected $searchModelClass ='app\\models\\search\\UserSearch';\n    protected $model_name = 'User';\n    protected $model_field_name = 'username';       \n    protected $hierarchy_links = [\n    \t\t'user_id' =\u003e [\n    \t\t\t'model' =\u003e 'app\\models\\User',\n    \t\t\t'linked_model' =\u003e 'user',\n    \t\t\t'breadcrumbs' =\u003e [\n    \t\t\t\t[\n    \t\t\t\t\t'label' =\u003e 'Users',\n    \t\t\t\t\t'url' =\u003e '/user/overview',\n    \t\t\t\t],\n    \t\t\t\t[\n    \t\t\t\t\t'label' =\u003e '{model_name}',\n    \t\t\t\t\t'name_field' =\u003e 'username',\n    \t\t\t\t\t'url' =\u003e '/user/view?id={id}',\n    \t\t\t\t]\n    \t\t\t]\n    \t\t]\n    \t];\n```\n\nBulk update \u0026 delete\n-----\n\nThe bulk-update and bulk-delete actions are enabled by default in BaseAjaxCrudController. \nThey are added in the view using the BulkButtonWidget. \n\nBulk-update uses the model scenario that can be set on a single update action. \nYou can add form elements for changing the data to the 'data-confirm-message'. \nUse the exact field name of the model (this is auto-mapped in the action). \nThe 'data-confirm-ok' field is used to build the submit button which pushes. \n\nFor example:\n  \n```php\n   \u003c?= DynaGrid::widget([\n                'options' =\u003e [\n                    'id' =\u003e 'example-gridview',\n                ],\n                'gridOptions'=\u003e[\n                    'dataProvider' =\u003e $dataProvider,\n                    'filterModel' =\u003e $searchModel,\n                    'panel' =\u003e [\n                        'type' =\u003e 'primary',\n                        'heading' =\u003e '\u003ci class=\"glyphicon glyphicon-list\"\u003e\u003c/i\u003e',\n                        'before' =\u003e '\u003cem\u003e\u003c/em\u003e',\n                        'after' =\u003e BulkButtonWidget::widget( [\n\t\t                        'buttons' =\u003e\n\t\t\t                        Html::a( '\u003ci class=\"glyphicon glyphicon-pencil\"\u003e\u003c/i\u003e\u0026nbsp;Change Status',\n\t\t\t\t                        [ '/cmm-wptheme-map/bulk-update' ],\n\t\t\t\t                        [\n\t\t\t\t\t                        'class'                =\u003e \"btn btn-primary btn-xs\",\n\t\t\t\t\t                        'role'                 =\u003e 'modal-remote-bulk',\n\t\t\t\t\t                        'data-method'          =\u003e false,// for overide yii data api\n\t\t\t\t\t                        'data-request-method'  =\u003e 'post',\n\t\t\t\t\t                        'data-confirm-title'   =\u003e 'Bulk Change Status',\n\t\t\t\t\t                        'data-confirm-message' =\u003e\n\t\t\t\t\t\t                        Html::dropDownList(\n\t\t\t\t\t\t\t                        'status',\n\t\t\t\t\t\t\t                        '',\n\t\t\t\t\t\t\t                        common\\models\\Model::$statuses\n\t\t\t\t\t\t                        ),\n\t\t\t\t\t                        'data-confirm-ok '     =\u003e Html::button( 'Save',\n\t\t\t\t\t\t                        [ 'class' =\u003e 'btn btn-primary', 'type' =\u003e \"submit\" ] ),\n\t\t\t\t                        ]\n\t\t\t                        ) .\n\t\t\t                        ' ' .\n\t\t\t                        Html::a( '\u003ci class=\"glyphicon glyphicon-trash\"\u003e\u003c/i\u003e\u0026nbsp; Delete All',\n\t\t\t\t                        [ \"bulk-delete\" ],\n\t\t\t\t                        [\n\t\t\t\t\t                        'class'                =\u003e \"btn btn-danger btn-xs\",\n\t\t\t\t\t                        'role'                 =\u003e 'modal-remote-bulk',\n\t\t\t\t\t                        'data-confirm'         =\u003e false,\n\t\t\t\t\t                        'data-method'          =\u003e false,\n\t\t\t\t\t                        'data-request-method'  =\u003e 'post',\n\t\t\t\t\t                        'data-confirm-title'   =\u003e 'Are you sure?',\n\t\t\t\t\t                        'data-confirm-message' =\u003e 'Are you sure want to delete this item',\n\t\t\t\t                        ] ),\n\t                        ] ) .\n                                   '\u003cdiv class=\"clearfix\"\u003e\u003c/div\u003e',\n                    ],\n                ],\n                'columns' =\u003e require(__DIR__.'/_columns.php'),\n            ]); ?\u003e\n```\nTODO add explanations for the parameters.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrsdre%2Fyii2-radtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrsdre%2Fyii2-radtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrsdre%2Fyii2-radtools/lists"}