当前位置: 首页>>代码示例>>PHP>>正文


PHP Kwc_Admin::getComponentFile方法代码示例

本文整理汇总了PHP中Kwc_Admin::getComponentFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Kwc_Admin::getComponentFile方法的具体用法?PHP Kwc_Admin::getComponentFile怎么用?PHP Kwc_Admin::getComponentFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Kwc_Admin的用法示例。


在下文中一共展示了Kwc_Admin::getComponentFile方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _getMasterClass

 protected function _getMasterClass($component)
 {
     $masterClass = Kwc_Admin::getComponentFile($component->componentClass, 'PdfMaster', 'php', true);
     if (!$masterClass) {
         $masterClass = 'Kwf_Pdf_TcPdf';
     }
     return $masterClass;
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:8,代码来源:ContentSender.php

示例2: replaceOutput

 public function replaceOutput($renderer)
 {
     if ($this->isLoggedIn()) {
         return false;
     }
     $template = Kwc_Admin::getComponentFile($this, 'Component', 'tpl');
     $renderer = new Kwf_Component_Renderer();
     $view = new Kwf_Component_View($renderer);
     $view->assign($this->getTemplateVars());
     return $renderer->render($view->render($template));
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:11,代码来源:Component.php

示例3: _getEmptyImageData

 protected function _getEmptyImageData()
 {
     $emptyImage = $this->_getSetting('emptyImage');
     if (!$emptyImage) {
         return null;
     }
     $ext = substr($emptyImage, strrpos($emptyImage, '.') + 1);
     $filename = substr($emptyImage, 0, strrpos($emptyImage, '.'));
     $file = Kwc_Admin::getComponentFile($this, $filename, $ext);
     $s = getimagesize($file);
     return array('filename' => $emptyImage, 'file' => $file, 'mimeType' => $s['mime'], 'dimensions' => array('width' => $s[0], 'height' => $s[1], 'rotation' => 0));
 }
开发者ID:koala-framework,项目名称:koala-framework,代码行数:12,代码来源:Component.php

示例4: processOutput

 public function processOutput($output, $renderer)
 {
     // Da das Plugin nach dem Rendern ausgeführt wird, muss schon der
     // fertige Content hier reinkommen
     if ($output != 'root plugin(plugin(c1_child c1_childchild))') {
         return 'not ok from plugin. output was: ' . $output;
     } else {
         $template = Kwc_Admin::getComponentFile($this, 'Component', 'tpl');
         $renderer = new Kwf_Component_Renderer();
         $view = new Kwf_Component_View($renderer);
         $view->child = Kwf_Component_Data_Root::getInstance()->getComponentById($this->_componentId)->getChildComponent('-pluginChild');
         return $renderer->render($view->render($template));
     }
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:14,代码来源:Component.php

示例5: __construct

 /**
  * Create a .txt.tpl or .html.tpl file and set $template to the path.
  * @param string|Kwc_Abstract|Kwf_Component_Data $template: If it's a
  *          string it should point to the template in /views/mails. It's
  *          also possible to use a 'Kwc_Abstract' or 'Kwf_Component_Data'
  *          (This is used when the template destination is in this component-folder).
  *          There are no absolute paths allowed.
  * @param string $masterTemplate
  */
 public function __construct($template, $masterTemplate = 'Master')
 {
     parent::__construct();
     if (is_object($template) || in_array($template, Kwc_Abstract::getComponentClasses())) {
         if (is_object($template)) {
             if ($template instanceof Kwc_Abstract) {
                 $template = $template->getData();
             }
             if (!$template instanceof Kwf_Component_Data) {
                 throw new Kwf_Exception("template must be instance of 'Kwc_Abstract' or 'Kwf_Component_Data'");
             }
             $template = $template->componentClass;
         }
         $this->_txtTemplate = Kwc_Admin::getComponentFile($template, 'Component', 'txt.tpl');
         if (!$this->_txtTemplate) {
             throw new Kwf_Exception("Component class '{$template}' needs at least a .txt.tpl mail template.");
         }
         $this->_htmlTemplate = Kwc_Admin::getComponentFile($template, 'Component', 'html.tpl');
     } else {
         if (substr($template, 0, 1) == '/') {
             throw new Kwf_Exception("Absolute mail template paths are not allowed. You called '{$template}'.");
         }
         if (false === $this->getScriptPath("{$template}.txt.tpl")) {
             $template = "mails/{$template}";
             if (false === $this->getScriptPath("{$template}.txt.tpl")) {
                 throw new Kwf_Exception("There has to exist at least a .txt.tpl mail template for '{$template}'.");
             }
         }
         $this->_txtTemplate = "{$template}.txt.tpl";
         if (false !== $this->getScriptPath("{$template}.html.tpl")) {
             $this->_htmlTemplate = "{$template}.html.tpl";
         }
     }
     $this->_mailTplViewMasterTemplate = $masterTemplate;
     if (isset($_SERVER['HTTP_HOST'])) {
         $host = $_SERVER['HTTP_HOST'];
     } else {
         $host = Kwf_Registry::get('config')->server->domain;
     }
     $this->webUrl = (Kwf_Util_Https::supportsHttps() ? 'https' : 'http') . '://' . $host;
     $this->host = $host;
     $this->applicationName = Kwf_Registry::get('config')->application->name;
 }
开发者ID:nsams,项目名称:koala-framework,代码行数:52,代码来源:View.php

示例6: jsonCreateAction

 public function jsonCreateAction()
 {
     $class = $this->_getParam('class');
     $type = $this->_getParam('type');
     if (!in_array($type, array('tpl', 'css'))) {
         throw new Kwf_Exception("Invalid type");
     }
     $path = str_replace('_', '/', $class);
     $path = str_replace('.', '', $path);
     //security
     if (file_exists($path . '.' . $type)) {
         throw new Kwf_ClientException("File does already exist.");
     }
     $srcFile = Kwc_Admin::getComponentFile($class, $type);
     if (!$srcFile) {
         throw new Kwf_ClientException("No file exists that could be copied.");
     }
     if (!copy($srcFile, $path . '.' . $type)) {
         throw new Kwf_Exception("Can't copy '{$srcFile}' to '{$path}.{$type}'");
     }
     $this->view->path = $path . '.' . $type;
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:22,代码来源:OverviewController.php

示例7: getTemplateFile

 /**
  * Returns path of a template file for a given component
  *
  * @param string componentClass
  * @param string template filename without extension
  * @return string
  */
 public static function getTemplateFile($componentClass, $filename = 'Component')
 {
     return Kwc_Admin::getComponentFile($componentClass, $filename, array('tpl', 'twig'));
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:11,代码来源:Abstract.php

示例8: componentFile

 public function componentFile(Kwf_Component_Data $data, $filename)
 {
     $ext = substr($filename, strrpos($filename, '.') + 1);
     $filename = substr($filename, 0, strrpos($filename, '.'));
     return Kwc_Admin::getComponentFile($data->componentClass, $filename, $ext);
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:6,代码来源:ComponentFile.php

示例9: getPdfWriter

 public function getPdfWriter($pdf)
 {
     if (!isset($this->_pdfWriter)) {
         $class = Kwc_Admin::getComponentFile($this->getData()->chained->componentClass, 'Pdf', 'php', true);
         $this->_pdfWriter = new $class($this, $pdf);
     }
     return $this->_pdfWriter;
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:8,代码来源:Component.php


注:本文中的Kwc_Admin::getComponentFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。