What are Hooks in CakePHP?

Member

trycia.jones

by trycia.jones , in category: Technology , a month ago

What are Hooks in CakePHP?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by dion.waelchi , a month 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