當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Komento::getClass方法代碼示例

本文整理匯總了PHP中Komento::getClass方法的典型用法代碼示例。如果您正苦於以下問題:PHP Komento::getClass方法的具體用法?PHP Komento::getClass怎麽用?PHP Komento::getClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Komento的用法示例。


在下文中一共展示了Komento::getClass方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getAjaxTemplate

 public function getAjaxTemplate()
 {
     $files = JRequest::getVar('names', '');
     if (empty($files)) {
         return false;
     }
     // Ensure the integrity of each items submitted to be an array.
     if (!is_array($files)) {
         $files = array($files);
     }
     $result = array();
     foreach ($files as $file) {
         $template = Komento::getTheme();
         $out = $template->fetch($file . '.ejs');
         $obj = new stdClass();
         $obj->name = $file;
         $obj->content = $out;
         $result[] = $obj;
     }
     Komento::getClass('json', 'KomentoJson');
     header('Content-type: text/x-json; UTF-8');
     $json = new KomentoJson();
     echo $json->encode($result);
     exit;
 }
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:25,代碼來源:themes.php

示例2: getResource

 public function getResource()
 {
     $resources = JRequest::getVar('resource');
     $component = JRequest::getCmd('kmtcomponent');
     Komento::setCurrentComponent($component);
     if (!is_array($resources)) {
         header('Content-type: text/x-json; UTF-8');
         echo '[]';
         exit;
     }
     foreach ($resources as &$resource) {
         $resource = (object) $resource;
         switch ($resource->type) {
             case 'language':
                 $resource->content = JText::_(strtoupper($resource->name));
                 break;
             case 'view':
                 $template = Komento::getTheme();
                 $out = $template->fetch($resource->name . '.ejs');
                 if ($out !== false) {
                     $resource->content = $out;
                 }
                 break;
         }
     }
     Komento::getClass('json', 'KomentoJson');
     header('Content-type: text/x-json; UTF-8');
     $json = new KomentoJson();
     echo $json->encode($resources);
     exit;
 }
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:31,代碼來源:foundry.php

示例3: getLanguage

 public function getLanguage()
 {
     $languages = JRequest::getVar('languages');
     $result = array();
     // If this is not an array, make it as an array.
     if (!is_array($languages)) {
         $languages = array($languages);
     }
     foreach ($languages as $key) {
         $result[$key] = JText::_(strtoupper($key));
     }
     Komento::getClass('json', 'Services_JSON');
     header('Content-type: text/x-json; UTF-8');
     $json = new Services_JSON();
     echo $json->encode($result);
     exit;
 }
開發者ID:kosmosby,項目名稱:medicine-prof,代碼行數:17,代碼來源:lang.php

示例4: _

 public static function _()
 {
     $class = 'KomentoLegacy16';
     if (Komento::joomlaVersion() == '1.5') {
         $class = 'KomentoLegacy15';
     }
     $legacy = Komento::getClass('legacy', $class);
     $args = func_get_args();
     $function = array_shift($args);
     if (strstr($function, '::')) {
         $function = str_replace('::', '_', $function);
     }
     if (is_callable(array($class, $function))) {
         return call_user_func_array(array($class, $function), $args);
     } else {
         return false;
     }
 }
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:18,代碼來源:helper.php

示例5: header

if (Komento::joomlaVersion() >= '1.6') {
    if (!JFactory::getUser()->authorise('core.manage', 'com_komento')) {
        JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
        JFactory::getApplication()->close();
    }
}
// else
// {
// 	if ( !JFactory::getUser()->authorize('com_komento', 'manage') )
// 	{
// 		return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
// 	}
// }
if (JRequest::getBool('compile')) {
    $minify = JRequest::getBool('minify', false);
    $compiler = Komento::getClass('compiler', 'KomentoCompiler');
    $results = $compiler->compile($minify);
    header('Content-type: text/x-json; UTF-8');
    echo json_encode($results);
    exit;
}
Komento::getHelper('Ajax')->process();
// Get the task
$task = JRequest::getCmd('task', 'display');
// We treat the view as the controller. Load other controller if there is any.
$controller = JRequest::getCmd('c', JRequest::getCmd('controller', ''));
// If task is getLanguage, then set c = lang
if ($task == 'getLanguage') {
    $controller = 'lang';
}
$controller = KomentoController::getInstance($controller);
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:31,代碼來源:komento.php


注:本文中的Komento::getClass方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。