CRUD Functionality
This will generate all necessary classes and views to manage CRUD operations against a database table. You may generate CRUD functionality by using the opus crud CLI command, such as:
apex opus crud <MODEL_FILENAME> --dbtable <TABLE_NAME> --view <VIEW_URI> [--magic]
apex crud MyShop/Models/Product --dbtable shop_products --view admin/shop/product --magic
Using the above example, the following files will be generated:
Type | Filename |
---|---|
Model | /src/MyShop/Models/Product.php |
Controller | /src/MyShop/Controllers/ProductController.php |
Data Table | /src/MyShop/Opus/DataTables/Products.php |
HTML Form | /src/MyShop/opus/Forms/Product.php |
View | views/html/admin/shop/product.html |
View | views/html/admin/shop/product_manage.html |
View | views/php/admin/shop/product.php |
View | views/php/admin/shop/product_manage.php |
You simply need to add a menu into the administration panel to link everything together, and then be able to perform all necessary CRUD operations via the admin panel on the specified database table. Natually, you will most likely want to tweak and modify the auto-generated results (eg. columns in data table).