Mecha CMS

Mecha CMS blog and documentation.

Disable Page Hooks

Force to disable all hooks that should be applied to the given page property.

Applies to Mecha version 2.0.1 and above. Previous versions will use the first argument as the default value of $page->title if $page->title value is null.

echo $page->title(false);
echo $page->get('title', false);


Hook::set('page.title', function($title) {
    return '<mark>' . $title . '</mark>';

$test_1 = $page->title;
$test_2 = $page->title(false);


$test_1 = '<mark>Page Title</mark>';
$test_2 = 'Page Title';