本文整理汇总了PHP中JApplicationCms::getTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP JApplicationCms::getTemplate方法的具体用法?PHP JApplicationCms::getTemplate怎么用?PHP JApplicationCms::getTemplate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JApplicationCms
的用法示例。
在下文中一共展示了JApplicationCms::getTemplate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAfterRouteSite
/**
* Load Gantry framework before dispatching to the component.
*/
private function onAfterRouteSite()
{
$template = $this->app->getTemplate(true);
if (!file_exists(JPATH_THEMES . "/{$template->template}/gantry/theme.yaml")) {
return;
}
$path = JPATH_THEMES . "/{$template->template}/includes/gantry.php";
if (is_file($path)) {
// Manually setup Gantry 5 Framework from the template.
include $path;
return;
}
// Setup Gantry 5 Framework or throw exception.
Gantry5\Loader::setup();
// Get Gantry instance.
$gantry = Gantry\Framework\Gantry::instance();
// Initialize the template.
$gantry['theme.path'] = JPATH_THEMES . "/{$template->template}";
$gantry['theme.name'] = $template->template;
$themePath = $gantry['theme.path'] . '/includes/theme.php';
include_once $themePath;
/** @var \Gantry\Framework\Configurations $configurations */
$configurations = $gantry['configurations'];
/** @var Gantry\Framework\Theme $theme */
$theme = $gantry['theme'];
$theme->setLayout($configurations->current());
}
示例2: createView
/**
* @param array $data
* @return Renderer
*/
public function createView(array $data = array())
{
$renderer = new Renderer($data);
$name = $this->getName();
// Add the default view path
$renderer->addIncludePath(COMPONENT_ROOT . '/src/views/' . $this->getName());
$template = $this->app->getTemplate();
$option = $this->input->get('option');
// Prepend the template path
$renderer->addIncludePath(JPATH_ROOT . '/templates/' . $template . '/html/' . $option . '/' . $this->getName(), true);
return $renderer;
}
示例3: onAfterRouteSite
/**
* Load Gantry framework before dispatching to the component.
*/
private function onAfterRouteSite()
{
$template = $this->app->getTemplate(true);
if (!file_exists(JPATH_THEMES . "/{$template->template}/gantry/theme.yaml")) {
return;
}
$gantryPath = JPATH_THEMES . "/{$template->template}/includes/gantry.php";
if (is_file($gantryPath)) {
// Manually setup Gantry 5 Framework from the template.
include_once $gantryPath;
} else {
// Setup Gantry 5 Framework or throw exception.
Gantry5\Loader::setup();
// Get Gantry instance.
$gantry = Gantry\Framework\Gantry::instance();
// Initialize the template.
$gantry['theme.path'] = JPATH_THEMES . "/{$template->template}";
$gantry['theme.name'] = $template->template;
$themePath = $gantry['theme.path'] . '/includes/theme.php';
include_once $themePath;
}
/** @var Gantry\Framework\Theme $theme */
$theme = $gantry['theme'];
/** @var \Gantry\Framework\Outlines $configurations */
$configurations = $gantry['configurations'];
$theme->setLayout($configurations->current());
if (!$this->params->get('production', 0) || $this->params->get('asset_timestamps', 1)) {
$age = (int) ($this->params->get('asset_timestamps_period', 7) * 86400);
Gantry\Framework\Document::$timestamp_age = $age > 0 ? $age : PHP_INT_MAX;
} else {
Gantry\Framework\Document::$timestamp_age = 0;
}
}
示例4: getListCss
/**
* Checks : J template html override css file then fabrik list tmpl template css file. Including them if found
*
* @since 3.0 loads lists's css files
*
* @return void
*/
public function getListCss()
{
$tmpl = $this->getTmpl();
$jTmplFolder = FabrikWorker::j3() ? 'tmpl' : 'tmpl25';
// Check for a form template file (code moved from view)
if ($tmpl != '') {
$qs = '?c=' . $this->getRenderContext();
// $$$rob need & for pdf output which is parsed through xml parser otherwise fails
$qs .= '&buttoncount=' . $this->rowActionCount;
// $$$ hugh - adding format, so custom CSS can do things like adding overrides for PDF
$qs .= '&format=' . $this->app->input->get('format', 'html');
$overRide = 'templates/' . $this->app->getTemplate() . '/html/com_fabrik/list/' . $tmpl . '/template_css.php' . $qs;
if (!FabrikHelperHTML::stylesheetFromPath($overRide)) {
FabrikHelperHTML::stylesheetFromPath('components/com_fabrik/views/list/' . $jTmplFolder . '/' . $tmpl . '/template_css.php' . $qs);
}
/* $$$ hugh - as per Skype conversation with Rob, decided to re-instate the custom.css convention. So I'm adding two files:
* custom.css - for backward compatibility with existing 2.x custom.css
* custom_css.php - what we'll recommend people use for custom css moving forward.
*/
if (!FabrikHelperHTML::stylesheetFromPath('templates/' . $this->app->getTemplate() . '/html/com_fabrik/list/' . $tmpl . '/custom.css' . $qs)) {
FabrikHelperHTML::stylesheetFromPath('components/com_fabrik/views/list/' . $jTmplFolder . '/' . $tmpl . '/custom.css');
}
if (!FabrikHelperHTML::stylesheetFromPath('templates/' . $this->app->getTemplate() . '/html/com_fabrik/list/' . $tmpl . '/custom_css.php' . $qs)) {
$displayData = new stdClass();
$displayData->tmpl = $tmpl;
$displayData->qs = $qs;
$displayData->jTmplFolder = $jTmplFolder;
$displayData->listModel = $this;
$layout = $this->getLayout('list.fabrik-custom-css-qs');
$path = $layout->render($displayData);
FabrikHelperHTML::stylesheetFromPath($path);
}
}
}