[SUGGESTION] - publish / unpublish redundant in fuel/controllers/module.php

edited September 2011 in News & Announcements
Iines 965 on...
Why instead of having the controller methods publish(), unpublish() call _publish_unpublish() with the relative id and action bound to the controller, wouldn't you put this method inside the Base_module_model?

And since we're here, why wouldn't you just make it a generic 'toggle_publish_state' method that would set the model's 'published' field to its opposite on request?

something like (pseudo-code obviously)

module.php

function toggle_published($id)
{
$this->$model->toggle_publish_state($id);
}

...
Base_module_model

function toggle_publish_state()
{
$this->published = !$this->published
}
Just a curiousity here ... no trolling meant of course! :D

Comments

Sign In or Register to comment.