Helper (class)

Class Helper

Abstract base class for all other Helpers in CakePHP. Provides common methods and features.

Callback methods

Helpers support a number of callback methods. These callbacks allow you to hook into the various view lifecycle events and either modify existing view content or perform other application specific logic. The events are not implemented by this base class, as implementing a callback method subscribes a helper to the related event. The callback methods are as follows:

  • beforeRender(Event $event, $viewFile) - beforeRender is called before the view file is rendered.
  • afterRender(Event $event, $viewFile) - afterRender is called after the view file is rendered but before the layout has been rendered.
  • beforeLayout(Event $event, $layoutFile)` - beforeLayout is called before the layout is rendered.
  • afterLayout(Event $event, $layoutFile) - afterLayout is