Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
hooks
  • hi, is there a way to make system/controllers pre/post hook on system-level? not before/after methods in the controllers, i mean a centralized configuration like codeigniter. Ive not found any mechanism. If im right, is there a coding standard for this in fuelphp?
  • You're asking the question the wrong way around. The question shouldn't be "how can I imitate CodeIgniter?", but it should be "how to best solve this in Fuel?". In this case you'd best write a core Controller extension with the before/after methods extended, these will be used by every controller including the Controller_Template and Controller_Rest.
  • im asking: "is there a coding standard for this in fuelphp?"
    "extending core classes" is fit for this process, thanks
  • Fuel doesn't use hooks, it uses events, supported by the Event class, which is much more flexible than CI's hooks.
    The Core currently defines only one event, 'shutdown', which is triggered in your public/index.php. If you can explain that it exactly is that you're trying to achieve, we can help you come up with a solution. As Jelmer said, don't try to apply methods you've used in other frameworks in Fuel, it will lead to ugly and sub-optimal solutions.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion