本文整理汇总了PHP中FD::resolve方法的典型用法代码示例。如果您正苦于以下问题:PHP FD::resolve方法的具体用法?PHP FD::resolve怎么用?PHP FD::resolve使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FD
的用法示例。
在下文中一共展示了FD::resolve方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: attach
public function attach($path = null)
{
// Keep current value
$_styleTag = $this->styleTag;
$_CDATA = $this->CDATA;
// Keep original file value
if (!is_null($path)) {
$_file = $this->file;
$this->file = FD::resolve($path . '.' . $this->extension);
}
// Reset to false
$this->styleTag = false;
$this->CDATA = false;
$output = $this->parse();
FD::page()->addInlineStylesheet($output);
// Restore current value
$this->styleTag = $_styleTag;
$this->CDATA = $_CDATA;
// Restore original file value
if (!is_null($path)) {
$this->file = $_file;
}
}
示例2: getResourcesSettings
public function getResourcesSettings()
{
$config = FD::config();
$assets = FD::get('Assets');
$themes = FD::get('Themes');
$locations = $assets->locations();
// Build a deterministic cache
$settings = array("language" => JFactory::getLanguage()->getTag(), "template" => array("site" => $config->get('theme.site', 'wireframe'), "admin" => $config->get('theme.admin', 'default')), "view" => array(), "modified" => filemtime($this->resourceManifestFile));
// Determine if there are template overrides
if (JFolder::exists($locations['site_override'])) {
$settings["template"]["site_override"] = FD::call('Assets', 'getJoomlaTemplate', array('site'));
}
if (JFolder::exists($locations['admin_override'])) {
$settings["template"]["admin_override"] = FD::call('Assets', 'getJoomlaTemplate', array('admin'));
}
// Get manifest
$manifest = $this->getResourcesManifest();
if (isset($manifest[0]->view) && $manifest[0]->view) {
foreach ($manifest[0]->view as $view) {
$original = $view;
$view = 'themes:/' . $view;
$path = FD::resolve($view . '.ejs');
// If the file still does not exist, we'll skip this
if (!JFile::exists($path)) {
continue;
}
$settings["view"][] = array("path" => str_ireplace(JPATH_ROOT, '', $path), "modified" => filemtime($path));
}
}
// Build hash
$settings["id"] = md5(serialize($settings));
return $settings;
}
示例3: listen
/**
* Processes an ajax call that is passed to the server. It is smart enough to decide which
* file would be responsible to keep these codes.
*
* @since 1.0
* @access public
*
* @author Mark Lee <mark@stackideas.com>
*/
public function listen()
{
$doc = JFactory::getDocument();
$ajax = FD::getInstance('Ajax');
// Do not proceed if the request is not in ajax format.
if ($doc->getType() != 'ajax') {
return;
}
// Namespace format should be POSIX format.
$namespace = JRequest::getVar('namespace');
$parts = explode(':/', $namespace);
// Detect if the user passed in a protocol.
$hasProtocol = count($parts) > 1;
if (!$hasProtocol) {
$namespace = 'ajax:/' . $namespace;
}
return FD::resolve($namespace);
}
示例4: output
/**
* Outputs the data from a template file.
*
* @since 1.0
* @access public
* @param string Path to template.
* @param Array An array of arguments.
*
* @return string The output of the theme file.
*
* @author Mark Lee <mark@stackideas.com>
*/
public function output($path = null, $vars = null)
{
// Keep original file value
if (!is_null($path)) {
$_file = $this->file;
$this->file = FD::resolve($path . '.' . $this->extension);
}
// Let's try to extract the data.
$output = $this->parse($vars);
// Restore original file value
if (!is_null($path)) {
$this->file = $_file;
}
// Free up some memory
unset($_file);
return $output;
}