Welcome Guest, Not a member yet? Register   Sign In
autocontrollers
#5

[eluser]jparent[/eluser]
I've thought in something like:

Code:
class MX_Controller extends Controller
{  
  function show_all($row = NULL,$howmany = NULL)
  {
      $model = $this->properties->get('main_model');
      $data['entries'] = $this->{$model}->get_all($row,$howmany);
      $this->_render('show_all');//joins all partial views with the 'show_all' view
  }
  //more methods like show_one show_by($field,$value),insert,update($id),delete
  ...
}

Then when you declare a controller it will be simple like:

Code:
class Blog extends MX_Controller
{
function __construct()
{
  parent::__construct();
  $this->porperties = load_properties('blog');
}
}

And you will have the basic methods, then you can do new ones or extend it. You will can change the view changing the theme in the properties.

This is a simple example. I might consider that it will have relationship tables, javascript, css, additional helpers or libraries ..., additional views, interacction between controllers...


Messages In This Thread
autocontrollers - by El Forum - 06-09-2010, 05:51 AM
autocontrollers - by El Forum - 06-09-2010, 03:53 PM
autocontrollers - by El Forum - 06-10-2010, 05:03 AM
autocontrollers - by El Forum - 06-10-2010, 06:09 AM
autocontrollers - by El Forum - 06-11-2010, 06:12 AM
autocontrollers - by El Forum - 06-11-2010, 08:37 AM
autocontrollers - by El Forum - 06-15-2010, 04:40 AM
autocontrollers - by El Forum - 06-15-2010, 05:31 AM
autocontrollers - by El Forum - 06-16-2010, 01:17 AM
autocontrollers - by El Forum - 06-16-2010, 06:47 AM
autocontrollers - by El Forum - 06-17-2010, 01:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB