Skip to main content
Topic: interface action_controller? (Read 6818 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

interface action_controller?

It's not that useful for now, but my heart says: let's use an interface for the admin controllers.. All controllers need at least the action_index() method, IMO this should be declared in an interface.

Code: [Select]
interface admin_action_controller
{
     function action_index();
     function settings(); // deprecated, I know..
}

and in the related controller:
Code: [Select]
class ManageBBC_Controller implements admin_action_controller
{
/**
* BBC settings form
* @var Settings_Form
*/
...

It's just a quick'n'dirty sample..

Opinions?
Thorsten "TE" Eurich
------------------------

Re: interface action_controller?

Reply #1

Quote from: TE – It's not that useful for now, but my heart says: let's use an interface for the admin controllers.. All controllers need at least the action_index() method, IMO this should be declared in an interface.

Surely. :) Or an abstract base class.

Also, I believe pre_dispatch() is part of it.
Thinking at contextual stuff they do, such as load templates and languages.

There's no particular certain reason for a base class vs an interface. But it can always be filled with a method they need.
The best moment for testing your PR is right after you merge it. Can't miss with that one.

Re: interface action_controller?

Reply #2

I think we have this now...am I wrong?
Bugs creator.
Features destroyer.
Template killer.

Re: interface action_controller?

Reply #3

yep, we have.. not an interface but an abstract class but we have .. :)
Thorsten "TE" Eurich
------------------------

Re: interface action_controller?

Reply #4

Then...

 emanuele moves it because TE is too lazy. :P
Bugs creator.
Features destroyer.
Template killer.