3.12.1 Creating a simple admin interface with scaffolding
このセクションには保留されている変更があります. More information about translations
If you have enabled admin routing in your app/config/core.php, with Configure::write('Routing.admin', 'admin'); you can use scaffolding to generate an admin interface.
Once you have enabled admin routing assign your admin prefix to the scaffolding variable.
var $scaffold = 'admin';
var $scaffold = 'admin';
http://example.com/admin/controller/index http://example.com/admin/controller/view http://example.com/admin/controller/edit http://example.com/admin/controller/add http://example.com/admin/controller/delete
http://example.com/admin/controller/indexhttp://example.com/admin/controller/viewhttp://example.com/admin/controller/edithttp://example.com/admin/controller/addhttp://example.com/admin/controller/delete
This is an easy way to create a simple backend interface quickly. Keep in mind that you cannot have both admin and non-admin methods scaffolded at the same time. As with normal scaffolding you can override individual methods and replace them with your own.
function admin_view($id = null) {
//custom code here
}
function admin_view($id = null) {//custom code here}
Once you have replaced a scaffolded action you will need to create a view file for the action as well.


























