Create
/app/controllers/carriers_controller.php
<?php class CarriersController extends AppController { var $name = 'Carriers'; var $scaffold; } ?>If the controller is using a model other than, or in addition to, the one with the same name as its name, you can access that model in one of two ways.
- Add
var $uses = array('Carrier', 'Other');
- Access the other model directly in code via
$this->Carrier->Other...
The variable
$scaffold
turns on automated scaffolding for testing and viewing of database data. After testing is complete, ensure to remove the scaffolding line to prevent unauthorized access. If you test with scaffolding, any defined methods will override the scaffolding.
Upload the file and browse to http://drug-ed.com/carriers to verify it works, then add a few carriers.
Name | Extension |
---|---|
Verizon PCS | vtext.com |
AT&T PCS | txt.att.net |
Observe that since there is a defined relationship between Carriers and Users the actions "New User" and "List Users" are available on the Carriers page. Since there is no Users controller the links don't work yet.
No comments:
Post a Comment