1
I have an administrative panel with several areas your item listings from each own table. What’s best to do:
A action 'list' for each Controller responsible for each area:
class aController extends Controller{
public function list(){
}
}
class bController extends Controller{
public function list(){
}
}
class cController extends Controller{
public function list(){
}
}
Or make a Controller 'Listcontroller' receiving parameters:
class ListController extends Controller{
public function index($table){
}
}
The last case seems to solve the problem of code repetitions, but I do not know if it will bring problems in the future.
I think it’s best to create a "list" for each one, and keep the rules properly separated. It will generate more code, but everything will be more "readable". More will remain to make modifications, or isolate and solve future problems.
– mau humor
Kelvym, for your trouble there I would suggest using a scaffold Enerator, huh.
– Wallace Maxters