本文整理汇总了PHP中helpers\Hooks::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Hooks::get方法的具体用法?PHP Hooks::get怎么用?PHP Hooks::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helpers\Hooks
的用法示例。
在下文中一共展示了Hooks::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dataLoadandConvert
/**
* place hook calls into the relevant data array call
* @param array $data
* @return array $data
*/
public static function dataLoadandConvert($data)
{
$hooks = Hooks::get();
$data['afterBody'] = $hooks->run('afterBody', $data['afterBody']);
$data['css'] = $hooks->run('css', $data['css']);
$data['js'] = $hooks->run('js', $data['js']);
return $data;
}
示例2: before
/**
* Method automatically invoked before the current Action, stopping the flight
* when it return false. This Method is supposed to be overriden for using it.
*/
protected function before()
{
// Run the Hooks associated to Views.
$hooks = Hooks::get();
foreach (array('afterBody', 'css', 'js') as $hook) {
$result = $hooks->run($hook);
// Share the result into Views.
View::share($hook, $result);
}
// Return true to continue the processing.
return true;
}
示例3:
<?php
/**
* Sample layout
*/
use Helpers\Assets;
use Helpers\Url;
use Helpers\Hooks;
//initialise hooks
$hooks = Hooks::get();
?>
<!DOCTYPE html>
<html lang="<?php
echo LANGUAGE_CODE;
?>
">
<head>
<!-- Site meta -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<?php
//hook for plugging in meta tags
$hooks->run('meta');
?>
<title><?php
echo $data['title'] . ' - ' . SITETITLE;
//SITETITLE defined in app/Core/Config.php
?>
</title>
示例4:
<?php
\Helpers\Hooks::get()->run('footer');
?>
</body>
</html>