Back to Documentation
September - PHP Movie & Serie Watch Script

Hook reference

This page lists the hooks available to plugins and themes. Published hook names and signatures are a contract: they do not break in minor releases, and a hook is announced as deprecated before it is removed.

use September\Core\Hook\Hook;

Hook::addAction('name', $callback, 10);   // runs when the event happens
Hook::addFilter('name', $callback, 10);   // receives a value, returns it modified

Actions

Core and request

HookWhenArguments
core.bootingAfter environment, config and error handler are set up, before plugins loadApplication $app
core.bootedWhen boot is completeApplication $app
routes.registerAfter core routes load; plugins add routes hereRouter $router
request.receivedBefore the request is matched to a routeRequest $request
response.sendingRight before the response is sentResponse $response, Request $request
session.startedWhen the session starts—

Models and database

HookWhenArguments
model.creating / model.createdBefore / after a record is inserted (id assigned)Model $model
model.updating / model.updatedBefore / after a record is updatedModel $model
model.deleting / model.deletedBefore / after a record is deletedModel $model
migrate.completedWhen migrate finisheslist<string> $ran
seed.completedWhen db:seed finishesstring $seederClass

Themes and plugins

HookWhenArguments
theme.activatedWhen the theme is changedstring $slug
plugin.activatedWhen a plugin is activated (after its migrations run)string $slug
plugin.deactivatedWhen a plugin is deactivatedstring $slug
plugin.failedWhen a plugin fails at boot and is deactivated automaticallystring $slug, Throwable $e
settings.updatedWhen settings are saved in the admin panelarray $values

Membership and interaction

HookWhenArguments
auth.registeredWhen a new member registration completesUser $user
auth.loginOn successful loginUser $user
auth.login_failedOn a failed login attemptstring $email
auth.logoutOn logoutUser $user
user.profile_updatedWhen a profile is updatedUser $user
user.password_changedWhen a password is changedUser $user
content.viewedOn a unique view of a detail pageMovie|Serie|Episode $model
interaction.toggledWhen watched / watchlist / favourite is toggledUser $user, string $type, string $targetType, int $targetId, bool $active
review.createdWhen a new review is postedReview $review
review.repliedWhen a review receives a replyReview $reply, Review $parent
report.createdWhen an issue report is createdReport $report

Filters

Views, language and system

HookWhat it changesSignature
view.resolveFile path of the template to render(string $path, string $viewName): string
view.data.{view}Data passed to a specific view (e.g. view.data.welcome)(array $data): array
validation.rules.{form}Validation rules of a form (e.g. validation.rules.kayit)(array $rules, array $data): array
locale.strings.{locale}Language file strings (e.g. locale.strings.en)(array $strings): array
console.commandsCLI command registry (name => class or factory)(array $commands): array
settings.definitionsSetting definitions (core, theme, plugin)(array $definitions): array
mail.messageOutgoing email (subject, body, recipient)(array $message): array

Front-end content

HookWhat it changesSignature
home.slidesHome page slider items(array $slides): array
home.rowsHome page content rows (add, remove, reorder)(array $rows): array
nav.itemsTop menu items(array $items): array
footer.columnsFooter columns(array $columns): array
search.querySearch query (trimming, normalising)(string $query, Request $request): string
search.resultsSearch results(array $results, string $query): array
discover.filtersDiscover filter options (genre, language, country)(array $options): array
discover.queryDiscover query parameters(array $filters, array $query): array
content.detail.factsFact rows on the detail page(array $facts, Movie|Serie $model): array
card.badgesContent card badges (language flags)(array $flags, array $item): array
report.topicsIssue report topics (key => label)(array $topics): array

Panels and theme

HookWhat it changesSignature
dashboard.menuMember account panel menu(array $items): array
admin.menuAdmin panel menu(array $items): array
theme.settings.sectionsSections of the theme settings page(array $sections, string $themeSlug, array $definitions): array

Ads, head and tracking codes

HookWhat it changesSignature
ads.placementsThe theme's ad slots (slug => label)(array $placements, string $themeSlug): array
ads.unit_htmlHTML of a single ad unit(string $html, string $placement, AdUnit $unit): string
ads.htmlWrapper HTML of an ad slot(string $html, string $placement, array $units): string
head.metaExtra meta/link tags inside <head> (canonical, OG)(string $html, string $title): string
head.trackingTracking codes before </head>(string $html): string
body.open.trackingTracking codes right after the opening <body>(string $html): string
body.close.trackingTracking codes before </body>(string $html): string