What are Hooks in CakePHP?

by trycia.jones , in category: Technology , 3 years ago

What are Hooks in CakePHP?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by dion.waelchi , 3 years ago

CakePHP hooks are callback functions that are called before or after a model operation.We define these functions in our Model classes.


Below is the list of some hooks or callback functions provided by CakePHP.

  • beforeFind
  • afterFind
  • beforeValidate
  • afterValidate
  • beforeSave
  • afterSave
  • beforeDelete
  • afterDelete
  • onError