本文整理汇总了PHP中Timber::twig_template_hierarchy方法的典型用法代码示例。如果您正苦于以下问题:PHP Timber::twig_template_hierarchy方法的具体用法?PHP Timber::twig_template_hierarchy怎么用?PHP Timber::twig_template_hierarchy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timber
的用法示例。
在下文中一共展示了Timber::twig_template_hierarchy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
/**
* This file bootstraps Timber Regions
*
* When you are building a theme with this framework, there should be no need
* to edit this file. Your own initialization code should go in lib/init.php.
*
* Any theme functions shoud be run from lib/site.php
* Regions and region methods can be defined in lib/regions-theme.php
*/
if (!class_exists('Timber')) {
add_action('admin_notices', function () use($text, $class) {
echo '<div class="error"><p>Timber not activated. Make sure you activate the plugin in <a href="/wp-admin/plugins.php#timber">/wp-admin/plugins.php</a></p></div>';
});
return;
}
Timber::$twig_template_hierarchy = true;
/**
* Theme Includes
*/
// Require site class straight away (maybe from both subdir install and parent theme)
require_once 'lib/site.php';
require_once TEMPLATEPATH . '/lib/site.php';
// Maybe also load child site class
if (TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/lib/site.php')) {
require STYLESHEETPATH . '/lib/site.php';
}
$theme_includes = array('lib/regions.php', 'lib/regions-theme.php', 'lib/init.php');
foreach ($theme_includes as $file) {
if (!($filepath = locate_template($file))) {
// This must mean we're a subdir install
require $file;