{"id":15169494,"url":"https://github.com/yii2tech/admin","last_synced_at":"2025-10-01T02:31:20.498Z","repository":{"id":36290386,"uuid":"40594912","full_name":"yii2tech/admin","owner":"yii2tech","description":"Admin pack (actions, widgets, etc) for Yii2","archived":true,"fork":false,"pushed_at":"2019-07-03T11:17:57.000Z","size":193,"stargazers_count":103,"open_issues_count":0,"forks_count":20,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-09-22T22:01:57.244Z","etag":null,"topics":["admin","admin-crud","administration","yii","yii2","yii2-extension"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yii2tech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["klimov-paul"],"patreon":"klimov_paul"}},"created_at":"2015-08-12T10:27:22.000Z","updated_at":"2023-12-26T13:47:42.000Z","dependencies_parsed_at":"2022-09-04T13:01:11.632Z","dependency_job_id":null,"html_url":"https://github.com/yii2tech/admin","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yii2tech%2Fadmin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yii2tech%2Fadmin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yii2tech%2Fadmin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yii2tech%2Fadmin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yii2tech","download_url":"https://codeload.github.com/yii2tech/admin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219875269,"owners_count":16554660,"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","admin-crud","administration","yii","yii2","yii2-extension"],"created_at":"2024-09-27T07:02:18.837Z","updated_at":"2025-10-01T02:31:15.202Z","avatar_url":"https://github.com/yii2tech.png","language":"PHP","funding_links":["https://github.com/sponsors/klimov-paul","https://patreon.com/klimov_paul"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/yii2tech\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://avatars2.githubusercontent.com/u/12951949\" height=\"100px\"\u003e\n    \u003c/a\u003e\n    \u003ch1 align=\"center\"\u003eAdmin pack for Yii 2\u003c/h1\u003e\n    \u003cbr\u003e\n\u003c/p\u003e\n\nThis extension provides controllers, actions, widgets and other tools for administration panel creation in Yii2 project.\n\nFor license information check the [LICENSE](LICENSE.md)-file.\n\n[![Latest Stable Version](https://poser.pugx.org/yii2tech/admin/v/stable.png)](https://packagist.org/packages/yii2tech/admin)\n[![Total Downloads](https://poser.pugx.org/yii2tech/admin/downloads.png)](https://packagist.org/packages/yii2tech/admin)\n[![Build Status](https://travis-ci.org/yii2tech/admin.svg?branch=master)](https://travis-ci.org/yii2tech/admin)\n\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 yii2tech/admin\n```\n\nor add\n\n```json\n\"yii2tech/admin\": \"*\"\n```\n\nto the require section of your composer.json.\n\n\nUsage\n-----\n\nThis extension provides controllers, actions, widgets and other tools for administration panel creation in Yii2 project.\nThese tools are meant to be used together for the rapid web application administration panel composition.\n\nThis package supports usage of following extensions:\n\n - [yii2tech/ar-position](https://github.com/yii2tech/ar-position)\n - [yii2tech/ar-role](https://github.com/yii2tech/ar-role)\n - [yii2tech/ar-search](https://github.com/yii2tech/ar-search)\n - [yii2tech/ar-softdelete](https://github.com/yii2tech/ar-softdelete)\n - [yii2tech/ar-variation](https://github.com/yii2tech/ar-variation)\n\n\u003e Note: none of these extensions is required by default, you'll need to install them yourself, if needed.\n\n\n## Actions \u003cspan id=\"actions\"\u003e\u003c/span\u003e\n\nThis extension provides several independent action classes, which provides particular operation support:\n\n - [[\\yii2tech\\admin\\actions\\Index]] - displays the models listing with search support.\n - [[\\yii2tech\\admin\\actions\\Create]] - supports creation of the new model using web form.\n - [[\\yii2tech\\admin\\actions\\Update]] - supports updating of the existing model using web form.\n - [[\\yii2tech\\admin\\actions\\Delete]] - performs the deleting of the existing record.\n - [[\\yii2tech\\admin\\actions\\View]] - displays an existing model.\n - [[\\yii2tech\\admin\\actions\\SoftDelete]] - performs the \"soft\" deleting of the existing record.\n - [[\\yii2tech\\admin\\actions\\SafeDelete]] - performs the \"safe\" deleting of the existing record.\n - [[\\yii2tech\\admin\\actions\\Restore]] - performs the restoration of the \"soft\" deleted record.\n - [[\\yii2tech\\admin\\actions\\Callback]] - allows invocation of specified method of the model.\n - [[\\yii2tech\\admin\\actions\\Position]] - allows change custom sort position of the particular model.\n - [[\\yii2tech\\admin\\actions\\VariationCreate]] - supports creation of the new model with variations using web form.\n - [[\\yii2tech\\admin\\actions\\VariationUpdate]] - supports updating of the new model with variations using web form.\n - [[\\yii2tech\\admin\\actions\\RoleCreate]] - supports creation of the new model with role using web form.\n - [[\\yii2tech\\admin\\actions\\RoleUpdate]] - supports updating of the new model with role using web form.\n\nPlease refer to the particular action class for more details.\n\nFor example CRUD controller based on provided actions may look like following:\n\n```php\nnamespace app\\controllers;\n\nuse yii\\web\\Controller;\n\nclass ItemController extends Controller\n{\n    public function actions()\n    {\n        return [\n            'index' =\u003e [\n                'class' =\u003e \\yii2tech\\admin\\actions\\Index::class,\n                'newSearchModel' =\u003e function () {\n                    return new ItemSearch();\n                },\n            ],\n            'view' =\u003e [\n                'class' =\u003e \\yii2tech\\admin\\actions\\View::class,\n            ],\n            'create' =\u003e [\n                'class' =\u003e \\yii2tech\\admin\\actions\\Create::class,\n            ],\n            'update' =\u003e [\n                'class' =\u003e \\yii2tech\\admin\\actions\\Update::class,\n            ],\n            'delete' =\u003e [\n                'class' =\u003e \\yii2tech\\admin\\actions\\Delete::class,\n            ],\n        ];\n    }\n\n    public function findModel($id)\n    {\n        if (($model = Item::findOne($id)) !== null) {\n            return $model;\n        }\n        throw new NotFoundHttpException('The requested page does not exist.');\n    }\n\n    public function newModel()\n    {\n        return new Item();\n    }\n}\n```\n\n\n## Controllers \u003cspan id=\"controllers\"\u003e\u003c/span\u003e\n\nThis extension provides several predefined controllers, which can be used as a base controller classes\nwhile creating particular controllers:\n\n- [[\\yii2tech\\admin\\CrudController]] - implements a common set of actions for supporting CRUD for ActiveRecord.\n\nPlease refer to the particular controller class for more details.\n\n\n## Widgets \u003cspan id=\"widgets\"\u003e\u003c/span\u003e\n\nThis  extension provides several widgets, which simplifies view composition for the typical use cases:\n\n - [[\\yii2tech\\admin\\widgets\\Alert]] - renders a message from session flash.\n - [[\\yii2tech\\admin\\widgets\\ActionAlert]] - renders an action proposition based on particular condition, usually a session flag.\n - [[\\yii2tech\\admin\\widgets\\ButtonContextMenu]] - simplifies rendering of the context links such as 'update', 'view', 'delete' etc.\n - [[\\yii2tech\\admin\\widgets\\Nav]] - enhanced version of [[\\yii\\bootstrap\\Nav]], which simplifies icon rendering.\n\nAlso several enhancements for the [[\\yii\\grid\\GridView]] are available:\n\n- [[\\yii2tech\\admin\\grid\\ActionColumn]] - simplifies composition of the action buttons\n- [[\\yii2tech\\admin\\grid\\DeleteStatusColumn]] - serves for the 'soft-deleted' status displaying\n- [[\\yii2tech\\admin\\grid\\PositionColumn]] - provides simple interface for the model custom sort position switching\n- [[\\yii2tech\\admin\\grid\\VariationColumn]] - allows displaying of the variation column values\n\n\n## Using Gii \u003cspan id=\"using-gii\"\u003e\u003c/span\u003e\n\nThis extension provides a code generators, which can be integrated with yii 'gii' module.\nIn order to enable them, you should adjust your application configuration in following way:\n\n```php\nreturn [\n    //....\n    'modules' =\u003e [\n        // ...\n        'gii' =\u003e [\n            'class' =\u003e yii\\gii\\Module::class,\n            'generators' =\u003e [\n                'adminMainFrame' =\u003e [\n                    'class' =\u003e yii2tech\\admin\\gii\\mainframe\\Generator::class\n                ],\n                'adminCrud' =\u003e [\n                    'class' =\u003e yii2tech\\admin\\gii\\crud\\Generator::class\n                ]\n            ],\n        ],\n    ]\n];\n```\n\n\"MainFrame\" generator creates a basic admin panel code, which includes layout files, main controller\nfile and basic view files. The created structure is necessary for the correct rendering of the code created\nby \"Admin CRUD\" generator.\n\n\"Admin CRUD\" generator is similar to regular \"CRUD\" generator, but it generates code, which uses tools from\nthis extension, so the result code is much more clean.\n\n\n## Internationalization \u003cspan id=\"internationalization\"\u003e\u003c/span\u003e\n\nAll text and messages introduced in this extension are translatable under category 'yii2tech-admin'.\nYou may use translations provided within this extension, using following application configuration:\n\n```php\nreturn [\n    'components' =\u003e [\n        'i18n' =\u003e [\n            'translations' =\u003e [\n                'yii2tech-admin' =\u003e [\n                    'class' =\u003e yii\\i18n\\PhpMessageSource::class,\n                    'basePath' =\u003e '@yii2tech/admin/messages',\n                ],\n                // ...\n            ],\n        ],\n        // ...\n    ],\n    // ...\n];\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyii2tech%2Fadmin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyii2tech%2Fadmin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyii2tech%2Fadmin/lists"}