本文整理汇总了PHP中TemplateLoader::addFile方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplateLoader::addFile方法的具体用法?PHP TemplateLoader::addFile怎么用?PHP TemplateLoader::addFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TemplateLoader
的用法示例。
在下文中一共展示了TemplateLoader::addFile方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initializeLayout
/**
* only load templates if bootstrap is activated, so diverent layouts will work instead of template changes
*
* @param \PageModel $page
* @param \LayoutModel $layout
*/
public function initializeLayout($page, \LayoutModel $layout)
{
static::$pageLayout = $layout;
if (!static::isEnabled()) {
return;
}
// reset default framework
static::$pageLayout->framework = null;
$templates = $GLOBALS['BOOTSTRAP']['templates']['dynamicLoad'];
// only load these templates if layout uses it because default templates are changed
foreach ($templates as $path => $templates) {
foreach ($templates as $template) {
\TemplateLoader::addFile($template, $path);
}
}
}
示例2: chooseTemplates
/**
* Choose the right template
*/
public function chooseTemplates()
{
// do not choose backend templates in the frontend see #27
if (TL_MODE == "FE") {
return;
}
// check theme for back end user
/** @var \BackendUser $objUser */
$objUser = \Controller::importStatic('BackendUser');
$loggedIn = $this->beUserLoggedIn($objUser);
$theme = $objUser->backendTheme;
if ($loggedIn === false && \Config::get('backendTheme') != "sb-admin" || $theme !== null && $theme != "sb-admin") {
return;
}
// modified templates
$arrTemplate = array('be_changelog', 'be_chart_panel', 'be_confirm', 'be_diff', 'be_error', 'be_forbidden', 'be_help', 'be_incomplete', 'be_install', 'be_login', 'be_main', 'be_navigation', 'be_no_active', 'be_no_forward', 'be_no_layout', 'be_no_page', 'be_no_root', 'be_pagination', 'be_password', 'be_picker', 'be_popup', 'be_purge_data', 'be_referer', 'be_switch', 'be_unavailable', 'be_welcome');
// Register the template
foreach ($arrTemplate as $value) {
\TemplateLoader::addFile($value, 'system/modules/sb-admin/templates/backend');
}
}
示例3:
<?php
/**
* @package contao-leaflet-metamodels
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2015-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
TemplateLoader::addFile('mm_attr_leaflet_map', 'system/modules/leaflet-metamodels/templates');
示例4: elseif
<?php
/**
* @package contao-bootstrap
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2015 netzmacht creative David Molineus
* @license LGPL 3.0
* @filesource
*
*/
\TemplateLoader::addFiles(array('block_section_jumbotron' => 'system/modules/bootstrap-layout/templates', 'block_section_jumbotron_container' => 'system/modules/bootstrap-layout/templates', 'block_section_container' => 'system/modules/bootstrap-layout/templates', 'fe_bootstrap' => 'system/modules/bootstrap-layout/templates'));
if (version_compare(VERSION, '3.3', '<')) {
\TemplateLoader::addFile('fe_bootstrap_32', 'system/modules/bootstrap-layout/templates');
} elseif (version_compare(VERSION, '3.4', '<')) {
\TemplateLoader::addFile('fe_bootstrap_33', 'system/modules/bootstrap-layout/templates');
} else {
\TemplateLoader::addFile('fe_bootstrap_34', 'system/modules/bootstrap-layout/templates');
}
示例5:
<?php
/**
* @package contao-subforms
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2015 netzmacht creative David Molineus
* @license LGPL 3.0
* @filesource
*
*/
\TemplateLoader::addFile('form_subform', 'system/modules/subforms/templates');
示例6:
<?php
/**
* @package contao-form-validation
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2015-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
\TemplateLoader::addFile('form_validation_js', 'system/modules/form-validation/templates');
示例7:
/**
* @package contao-form-helper
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2015 netzmacht creative David Molineus
* @license LGPL 3.0
* @filesource
*
*/
\TemplateLoader::addFile('formhelper_element_container', 'system/modules/form-helper/templates/element');
\TemplateLoader::addFile('formhelper_element_checkboxes', 'system/modules/form-helper/templates/element');
\TemplateLoader::addFile('formhelper_element_radios', 'system/modules/form-helper/templates/element');
\TemplateLoader::addFile('formhelper_element_select', 'system/modules/form-helper/templates/element');
\TemplateLoader::addFile('formhelper_error_all', 'system/modules/form-helper/templates/error');
\TemplateLoader::addFile('formhelper_error_last', 'system/modules/form-helper/templates/error');
\TemplateLoader::addFile('form_explanation', 'system/modules/form-helper/templates/widget');
\TemplateLoader::addFile('form_widget', 'system/modules/form-helper/templates/widget');
\TemplateLoader::addFile('form_captcha', 'system/modules/form-helper/templates/widget');
\TemplateLoader::addFile('form_checkbox', 'system/modules/form-helper/templates/widget');
\TemplateLoader::addFile('form_headline', 'system/modules/form-helper/templates/widget');
\TemplateLoader::addFile('form_password', 'system/modules/form-helper/templates/widget');
\TemplateLoader::addFile('form_radio', 'system/modules/form-helper/templates/widget');
\TemplateLoader::addFile('form_submit', 'system/modules/form-helper/templates/widget');
\TemplateLoader::addFile('formhelper_layout_tableless', 'system/modules/form-helper/templates/layout');
\TemplateLoader::addFile('formhelper_layout_table', 'system/modules/form-helper/templates/layout');
\TemplateLoader::addFile('formhelper_layout_table_nocolumns', 'system/modules/form-helper/templates/layout');
if (version_compare(VERSION, '3.3', '>=')) {
\TemplateLoader::addFile('form_textfield', 'system/modules/form-helper/templates/widget');
\TemplateLoader::addFile('form_textarea', 'system/modules/form-helper/templates/widget');
\TemplateLoader::addFile('form_select', 'system/modules/form-helper/templates/widget');
\TemplateLoader::addFile('form_upload', 'system/modules/form-helper/templates/widget');
}
示例8: loadDynamicTemplates
/**
*/
protected function loadDynamicTemplates()
{
// template settings
$originPath = \TemplateLoader::getPath('be_main', 'html5');
$defaultPath = TL_ROOT . '/system/modules/core/templates/backend/be_main.html5';
// only change be_main if no other be_main then the default one is chosen
// we use customized navigation templates so we do not need to load icons dynamically
if ($defaultPath == $originPath) {
if (version_compare(VERSION, '3.3', '>=')) {
$path = 'system/modules/font-awesome/templates/dynamic/3.3';
} else {
$path = 'system/modules/font-awesome/templates/dynamic/3.2';
}
\TemplateLoader::addFile('be_main', $path);
$GLOBALS['ICON_REPLACER']['navigation']['phpOnly'] = true;
}
\TemplateLoader::addFile('be_navigation', 'system/modules/font-awesome/templates/dynamic');
}
示例9:
<?php
ClassLoader::addClasses(array('BootstrapDatepickerField' => 'system/modules/bootstrap-datepicker/widgets/BootstrapDatepickerField.php'));
\TemplateLoader::addFile('form_datepicker', 'system/modules/bootstrap-datepicker/templates/widget');