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 initializationModule $object- module object
cron.settings.module.{module name}- filter for the list of module cron tasksarray $tasks- list of module tasksModule $object- module object
sendmail.templates.module.{module name}- filter for the list of module email templatesarray $templates- list of module templatesModule $object- module object
site.settings.system.extra.{module name}- filter for the list of module system settingsarray $settings- additional system settingsModule $object- module object
publicator.settings.{module name}- filter for the settings of thePublicatorcomponent initialized in the modulearray $settings- component settings\bff\db\Publicator $object- component object
locale.tables.{module name}- filter for the list of localizable tables and fields of the modulearray $list- listModel $object- module model object
Plugins
plugins.init.{plugin name}- a hook called after plugin initialization, before calling thestartmethodPlugin $object- plugin object
plugins.start.{plugin name}- a hook called after plugin startPlugin $object- plugin object
cron.settings.plugin.{plugin name}- filter for the list of plugin cron tasksarray $tasks- list of plugin tasksPlugin $object- plugin object
sendmail.templates.plugin.{plugin name}- filter for the list of plugin email templatesarray $templates- list of plugin templatesPlugin $object- plugin object
Templates
view.module.{module name}.{template name}- filter for post-processing module PHP templatesstring $content- generated HTML templatearray $data- data passed to the templatearray $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 dataarray $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 templatesstring $content- generated HTML templatearray $data- data passed to the templatearray $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 dataarray $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/ directorystring $content- generated HTML templatearray $data- data passed to the templatearray $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/ directoryarray $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 listarray $list- list of routesarray $options- additional options
{module name}.routes- filter for the list of module routesarray $list- list of routesarray $options- additional options
{module name}.url- filter for generating module links, implemented in theurl()static method of the modulestring $url- generated URL of the linkarray $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 sectionsarray $tabs- list of menu item names
admin.menu.header.counters- filter for the list of header items with countersarray $list- list
admin.menu.header.user- filter for the list of menu items in the user dropdown in the top right cornerarray $list- list
admin.menu.build- hook called after the completion of building the admin panel menu listMenu $object- menu object
JavaScript
js.extra- hook for inserting additional frontend JavaScript filesadmin.js.extra- hook for inserting additional JavaScript files in the admin paneljs.includes- filter for the list of included JavaScript filesarray $list- list of files
admin.js.includes- filter for the list of included JavaScript files in the admin panelarray $list- list of files
js.includes.core- filter for the list of core JavaScript librariesarray $list- list of settings
js.app.lang- filter for the list of localization phrases passed to theappJavaScript object (frontend)array $list- list of phrases
CSS
css.extra- hook for inserting additional frontend CSS filesadmin.css.extra- hook for inserting additional CSS files in the admin panelcss.includes- filter for the list of included CSS filesarray $list- list of files
admin.css.includes- filter for the list of included CSS files in the admin panelarray $list- list of files
Payment Systems
bills.pay.systems.data- filter for the list of payment system data used in the corearray $list- list of data
bills.pay.systems.user- filter for the list of available payment methods displayed to the userarray $list- list of payment systemsarray $extra- additional data: balanceUse - whether payment from balance is available
bills.pay.submit- hook for handling the submit event of the account top-up formfloat $amount- amount specified by the userstring $paySystem- payment system keyarray $pay- amount to pay: [amount => amount, currency => currency ID]
bills.pay.form- filter for the account payment form sent to the payment system providerstring $form- HTML formint $paySystem- payment system IDarray $data- additional invoice data
bills.pay.process- hook for handling the request from the payment systemstring $paySystem- key of the payment system performing the request or the method name
bills.pay.success- hook for handling the successful payment pagebills.pay.fail- hook for handling the payment error pagebills.pay.result- hook for handling the result method (required for some payment systems)bills.status.list- filter for the list of account statusesarray $list- list of available statuses
Email Sending
mail.send.template- filter for email template data before sendingarray $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 settingmail.noreply),'fromName'- sender’s name (default value is the system settingmail.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 emailarray $data- sending data:'to','subject','body','from','fromName','result'- sending result,'time'- sending timeMail $object- mail component object
SEO
seo.meta.render- filter for the list of meta data displayed in the<head>blockarray $view- list of meta data
seo.meta.text.prepare- filter for substituting SEO macros in textstring|array $text- SEO text or list of textsarray $data- additional parameters:'replace'- link to the replacement listfrom => 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/pluginarray $templates- list of template settingsModule|Plugin $object- module/plugin object
site.cron.sitemapXML- filter for the data passed to Sitemap.xmlarray $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 typeTYPE_TEXTstring $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 textstring $text- text to be transliterated
utils.func.translit.convert- filter for the list of transliterated charactersarray $list- list'character'=>'transliteration'
utils.videoparser.providers.list- filter for the list of supported video link providersarray $list- list of provider settings
Additional
app.init- hook called after application initializationdev.writable.check.list- filter for the list of directories and files requiring write permissions checkarray $list- list
geo.ip.location.region- filter providing the ability to connect another IP-based region detection providerbool|array $data- region data orfalsestring $ipAddress- user’s IP addressstring $provider- provider key specified in the system settinggeo.ip.location.provider
errors.http.error- hook for HTTP error pages (404, …)int $errorCode- error key: 404, …array $data- error data:title- title,message- descriptionstring $template- default template name