Hooks and Filters of the Application

The list presented in this section contains descriptions of core application hooks.

Modules

  • {module name}.init - a hook called after module initialization
    • Module $object - module object
  • cron.settings.module.{module name} - filter for the list of module cron tasks
    • array $tasks - list of module tasks
    • Module $object - module object
  • sendmail.templates.module.{module name} - filter for the list of module email templates
    • array $templates - list of module templates
    • Module $object - module object
  • site.settings.system.extra.{module name} - filter for the list of module system settings
    • array $settings - additional system settings
    • Module $object - module object
  • publicator.settings.{module name} - filter for the settings of the Publicator component initialized in the module
    • array $settings - component settings
    • \bff\db\Publicator $object - component object
  • locale.tables.{module name} - filter for the list of localizable tables and fields of the module
    • array $list - list
    • Model $object - module model object  

Plugins

  • plugins.init.{plugin name} - a hook called after plugin initialization, before calling the start method
    • Plugin $object - plugin object
  • plugins.start.{plugin name} - a hook called after plugin start
    • Plugin $object - plugin object
  • cron.settings.plugin.{plugin name} - filter for the list of plugin cron tasks
    • array $tasks - list of plugin tasks
    • Plugin $object - plugin object
  • sendmail.templates.plugin.{plugin name} - filter for the list of plugin email templates
    • array $templates - list of plugin templates
    • Plugin $object - plugin object  

Templates

  • view.module.{module name}.{template name} - filter for post-processing module PHP templates
    • string $content - generated HTML template
    • array $data - data passed to the template
    • array $extra: 'filePath' - path to the included file, 'fileName' - file name with extension, 'relPath' - relative path, 'theme' - whether the theme file is included
  • view.module.{module name}.{template name}.data - hook for preprocessing module PHP template data
    • array $view: 'data' - data passed by reference, 'filePath' - path to the included file, 'fileName' - file name with extension, 'relPath' - relative path, 'theme' - whether the theme file is included
  • view.plugin.{plugin name}.{template name} - filter for post-processing plugin PHP templates
    • string $content - generated HTML template
    • array $data - data passed to the template
    • array $extra: 'filePath' - path to the included file, 'fileName' - file name with extension, 'relPath' - relative path, 'theme' - whether the theme file is included
  • view.plugin.{plugin name}.{template name}.data - hook for preprocessing plugin PHP template data
    • array $view: 'data' - data passed by reference, 'filePath' - path to the included file, 'theme' - whether the theme file is included
  • view.tpl.{template name} - filter for post-processing PHP templates in the /tpl/ directory
    • string $content - generated HTML template
    • array $data - data passed to the template
    • array $extra: 'filePath' - path to the included file, 'fileName' - file name with extension, 'relPath' - relative path, 'theme' - whether the theme file is included
  • view.tpl.{template name}.data - hook for preprocessing data of PHP templates in the /tpl/ directory
    • array $view: 'data' - data passed by reference, 'filePath' - path to the included file, 'fileName' - file name with extension, 'relPath' - relative path, 'theme' - whether the theme file is included  

Routing

  • routes - filter for the project routes list
    • array $list - list of routes
    • array $options - additional options
  • {module name}.routes - filter for the list of module routes
    • array $list - list of routes
    • array $options - additional options
  • {module name}.url - filter for generating module links, implemented in the url() static method of the module
    • string $url - generated URL of the link
    • array $data - link parameters: key - key, opts - additional parameters, dynamic - dynamic link, base - base URL  

Admin Panel

  • admin.menu.tabs - filter for the list that determines the order of main menu sections
    • array $tabs - list of menu item names
  • admin.menu.header.counters - filter for the list of header items with counters
    • array $list - list
  • admin.menu.header.user - filter for the list of menu items in the user dropdown in the top right corner
    • array $list - list
  • admin.menu.build - hook called after the completion of building the admin panel menu list
    • Menu $object - menu object  

JavaScript

  • js.extra - hook for inserting additional frontend JavaScript files
  • admin.js.extra - hook for inserting additional JavaScript files in the admin panel
  • js.includes - filter for the list of included JavaScript files
    • array $list - list of files
  • admin.js.includes - filter for the list of included JavaScript files in the admin panel
    • array $list - list of files
  • js.includes.core - filter for the list of core JavaScript libraries
    • array $list - list of settings
  • js.app.lang - filter for the list of localization phrases passed to the app JavaScript object (frontend)
    • array $list - list of phrases  

CSS

  • css.extra - hook for inserting additional frontend CSS files
  • admin.css.extra - hook for inserting additional CSS files in the admin panel
  • css.includes - filter for the list of included CSS files
    • array $list - list of files
  • admin.css.includes - filter for the list of included CSS files in the admin panel
    • array $list - list of files  

Payment Systems

  • bills.pay.systems.data - filter for the list of payment system data used in the core
    • array $list - list of data
  • bills.pay.systems.user - filter for the list of available payment methods displayed to the user
    • array $list - list of payment systems
    • array $extra - additional data: balanceUse - whether payment from balance is available
  • bills.pay.submit - hook for handling the submit event of the account top-up form
    • float $amount - amount specified by the user
    • string $paySystem - payment system key
    • array $pay - amount to pay: [amount => amount, currency => currency ID]
  • bills.pay.form - filter for the account payment form sent to the payment system provider
    • string $form - HTML form
    • int $paySystem - payment system ID
    • array $data - additional invoice data
  • bills.pay.process - hook for handling the request from the payment system
    • string $paySystem - key of the payment system performing the request or the method name
  • bills.pay.success - hook for handling the successful payment page
  • bills.pay.fail - hook for handling the payment error page
  • bills.pay.result - hook for handling the result method (required for some payment systems)
  • bills.status.list - filter for the list of account statuses
    • array $list - list of available statuses  

Email Sending

  • mail.send.template - filter for email template data before sending
    • array $data - template data:
      • 'subject' - email subject,
      • 'body' - email body,
      • 'is_html' - whether the email template is HTML,
      • 'wrapper_id' - ID of the "Mail / Email Templates" template,
      • 'to' - recipient's email,
      • 'from' - sender's email (default value is the system setting mail.noreply),
      • 'fromName' - sender's name (default value is the system setting mail.fromname),
      • 'vars' - data to be substituted into the template {macro} => 'value',
      • 'lang' - key of the template language (default language)
    • string $templateName - template name
  • mail.sended - hook triggered immediately after sending an email
    • array $data - sending data: 'to', 'subject', 'body', 'from', 'fromName', 'result' - sending result, 'time' - sending time
    • Mail $object - mail component object  

SEO

  • seo.meta.render - filter for the list of meta data displayed in the <head> block
    • array $view - list of meta data
  • seo.meta.text.prepare - filter for substituting SEO macros in text
    • string|array $text - SEO text or list of texts
    • array $data - additional parameters: 'replace' - link to the replacement list from => to, 'macrosData' - link to the data to be substituted instead of macros
  • seo.templates.{module/plugin name} - filter for SEO template settings of a module/plugin
    • array $templates - list of template settings
    • Module|Plugin $object - module/plugin object
  • site.cron.sitemapXML - filter for the data passed to Sitemap.xml
    • array $data - data in the format of a callback list  

Core Components

  • input.email.temporary - filter for additional checking of the existence of an email address in the forbidden (temporary) address list (isEmailTemporary)
    • bool $isTemporary - marked by the system as temporary (true) or not (false)
    • string $email - email address
  • input.phone.validate - filter for additional validation of a phone number (isPhoneNumber)
    • string $phoneNumber - phone number
  • input.text.validate - filter for additional validation of text of type TYPE_TEXT
    • string $text - text
  • input.searchstring.validate - filter for additional validation of a search string (cleanSearchString)
    • string $string - search string
  • utils.func.translit - filter for additional transliteration of text
    • string $text - text to be transliterated
  • utils.func.translit.convert - filter for the list of transliterated characters
    • array $list - list 'character'=>'transliteration'
  • utils.videoparser.providers.list - filter for the list of supported video link providers
    • array $list - list of provider settings  

Additional

  • app.init - hook called after application initialization
  • dev.writable.check.list - filter for the list of directories and files requiring write permissions check
    • array $list - list
  • geo.ip.location.region - filter providing the ability to connect another IP-based region detection provider
    • bool|array $data - region data or false
    • string $ipAddress - user's IP address
    • string $provider - provider key specified in the system setting geo.ip.location.provider
  • errors.http.error - hook for HTTP error pages (404, ...)
    • int $errorCode - error key: 404, ...
    • array $data - error data: title - title, message - description
    • string $template - default template name