WIACPSite theme 0.2.0-alpha.92
Türkçe

§10

Output points (hooks)

Output points: SiteHeadEnd (arrives inside head with $page['head']), SiteBodyStart, SiteBodyEnd, SiteAfterBreadcrumbs (right under the breadcrumbs; the engine places site notices here, §5.9), SiteHeaderBefore, SiteHeaderAfter, SiteContentBefore, SiteContentAfter (the engine places them around the page content itself), SiteFooterBefore, SiteFooterAfter, ClientSidebarBefore, ClientSidebarAfter, ClientDashboardWidgets.

Filters (for extensions): SitePageTitle, SiteBodyClasses, SiteMenuItems, SiteBreadcrumbs, SiteHomepageSections, ClientNavigation.

A module adds output like this:

php
Hook::on('SiteBodyEnd', function (array $items, array $page): array {
    $items[] = new \Illuminate\Support\HtmlString('<script src="/modules/addons/x/x.js" defer></script>');

    return $items;
});

Plain text is escaped. A listener that throws does not break the page; the result of a listener that breaks the filter's type is ignored.