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


PHP Application::getTemplatesPath方法代码示例

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


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

示例1: indexAction

 public function indexAction()
 {
     $project = $this->_getProject();
     $template = new Template();
     $template->project = $project;
     $template->disableCache();
     echo $template->render(Application::getTemplatesPath() . 'designer/project_debug.php');
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:8,代码来源:Debugger.php

示例2: render

 /**
  * (non-PHPdoc)
  * @see Block_Abstract::render()
  */
 public function render()
 {
     $this->_collectData();
     $tpl = new Template();
     $tpl->setData(array('config' => $this->_config, 'place' => $this->_config['place'], 'menuData' => $this->_data));
     if (static::dependsOnPage) {
         $tpl->set('page', Page::getInstance());
         $tpl->set('pagesTree', Model::factory('Page')->getTree());
     }
     return $tpl->render(Application::getTemplatesPath() . $this->_template);
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:15,代码来源:Menu.php

示例3: loadAction

 /**
  * Get ActionJs Code
  */
 public function loadAction()
 {
     $project = $this->_getProject();
     $actionjs = $project->actionjs;
     $actionjs = str_replace('../', '', $actionjs);
     if ($actionjs[0] !== '.') {
         $actionjs = '.' . $actionjs;
     }
     if (!file_exists($actionjs)) {
         $fileDir = dirname($actionjs);
         if (!file_exists($fileDir)) {
             if (!@mkdir($fileDir, 0775, true)) {
                 Response::jsonError($this->_lang->CANT_WRITE_FS);
             }
         }
         $tpl = new Template();
         if (!@file_put_contents($actionjs, $tpl->render(Application::getTemplatesPath() . 'designer/emptyaction.php'))) {
             Response::jsonError($this->_lang->CANT_WRITE_FS);
         }
         $project->actionjs = $actionjs;
         $this->_storeProject();
     }
     Response::jsonSuccess(file_get_contents($actionjs));
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:27,代码来源:Actionjs.php

示例4: render

 /**
  * (non-PHPdoc)
  * @see Block_Abstract::render()
  */
 public function render()
 {
     $tpl = new Template();
     $tpl->set('data', $this->_config);
     return $tpl->render(Application::getTemplatesPath() . $this->_template);
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:10,代码来源:Simple.php

示例5: validateAction

 /**
  * Validate object action
  */
 public function validateAction()
 {
     $engineUpdate = false;
     $name = Request::post('name', 'string', false);
     if (!$name) {
         Response::jsonError($this->_lang->WRONG_REQUEST);
     }
     $objectConfig = Db_Object_Config::getInstance($name);
     // Check ACL permissions
     $acl = $objectConfig->getAcl();
     if ($acl) {
         if (!$acl->can(Db_Object_Acl::ACCESS_CREATE, $name) || !$acl->can(Db_Object_Acl::ACCESS_VIEW, $name)) {
             Response::jsonError($this->_lang->get('ACL_ACCESS_DENIED'));
         }
     }
     try {
         $obj = new Db_Object($name);
     } catch (Exception $e) {
         Response::jsonError($this->_lang->get('CANT_GET_VALIDATE_INFO'));
     }
     $builder = new Db_Object_Builder($name);
     $tableExists = $builder->tableExists();
     $colUpd = array();
     $indUpd = array();
     $keyUpd = array();
     if ($tableExists) {
         $colUpd = $builder->prepareColumnUpdates();
         $indUpd = $builder->prepareIndexUpdates();
         $keyUpd = $builder->prepareKeysUpdate();
         $engineUpdate = $builder->prepareEngineUpdate();
     }
     if (empty($colUpd) && empty($indUpd) && empty($keyUpd) && $tableExists && !$engineUpdate) {
         Response::jsonSuccess(array(), array('nothingToDo' => true));
     }
     $template = new Template();
     $template->disableCache();
     $template->engineUpdate = $engineUpdate;
     $template->columns = $colUpd;
     $template->indexes = $indUpd;
     $template->keys = $keyUpd;
     $template->tableExists = $tableExists;
     $template->tableName = $obj->getTable();
     $template->lang = $this->_lang;
     $msg = $template->render(Application::getTemplatesPath() . 'orm_validate_msg.php');
     Response::jsonSuccess(array(), array('text' => $msg, 'nothingToDo' => false));
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:49,代码来源:Controller.php

示例6: showPage

 /**
  * Show Page.
  * Running this method initiates rendering of templates and sending of HTML
  * data.
  *
  * @param Page $page
  * @param Blockmanager $blockManager
  */
 public function showPage(Page $page, Blockmanager $blockManager)
 {
     header('Content-Type: text/html; charset=utf-8');
     $template = new Template();
     $template->disableCache();
     $template->setProperties(array('development' => $this->_appConfig->get('development'), 'page' => $page, 'path' => $page->getThemePath(), 'templatesRoot' => Application::getTemplatesPath(), 'blockManager' => $blockManager, 'resource' => Resource::getInstance(), 'pagesTree' => Model::factory('Page')->getTree()));
     Response::put($template->render($page->getTemplatePath('layout.php')));
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:16,代码来源:Router.php

示例7: indexAction


//.........这里部分代码省略.........
        $res->addJs('/js/app/system/RevisionPanel.js', 1);
        $res->addJs('/js/app/system/EditWindow.js', 2);
        $res->addJs('/js/app/system/ContentWindow.js', 3);
        $res->addJs('/js/app/system/designer/viewframe/main.js', 4);
        $res->addJs('/js/app/system/designer/lang/' . $designerConfig['lang'] . '.js', 5);
        $project = $this->_getProject();
        $projectCfg = $project->getConfig();
        Ext_Code::setRunNamespace($projectCfg['runnamespace']);
        Ext_Code::setNamespace($projectCfg['namespace']);
        $grids = $project->getGrids();
        if (!empty($grids)) {
            foreach ($grids as $name => $object) {
                if ($object->isInstance()) {
                    continue;
                }
                $cols = $object->getColumns();
                if (!empty($cols)) {
                    foreach ($cols as $column) {
                        $column['data']->itemId = $column['id'];
                    }
                }
                $object->addListener('columnresize', '{
							 fn:function( ct, column, width,eOpts){
								app.application.onGridColumnResize("' . $name . '", ct, column, width, eOpts);
							 }
				}');
                $object->addListener('columnmove', '{
							fn:function(ct, column, fromIdx, toIdx, eOpts){
								app.application.onGridColumnMove("' . $name . '", ct, column, fromIdx, toIdx, eOpts);
							}
				}');
            }
        }
        $dManager = new Dictionary_Manager();
        $key = 'vf_' . md5($dManager->getDataHash() . serialize($project));
        $templates = $designerConfig->get('templates');
        $replaces = array(array('tpl' => $templates['wwwroot'], 'value' => $this->_configMain->get('wwwroot')), array('tpl' => $templates['adminpath'], 'value' => $this->_configMain->get('adminPath')), array('tpl' => $templates['urldelimiter'], 'value' => $this->_configMain->get('urlDelimiter')));
        $includes = Designer_Factory::getProjectIncludes($key, $project, true, $replaces);
        if (!empty($includes)) {
            foreach ($includes as $file) {
                if (File::getExt($file) == '.css') {
                    $res->addCss($file, false);
                } else {
                    $res->addJs($file, false, false);
                }
            }
        }
        $names = $project->getRootPanels();
        $basePaths = array();
        $parts = explode('/', $this->_configMain->get('wwwroot'));
        if (is_array($parts) && !empty($parts)) {
            foreach ($parts as $item) {
                if (!empty($item)) {
                    $basePaths[] = $item;
                }
            }
        }
        $basePaths[] = $this->_configMain['adminPath'];
        $basePaths[] = 'designer';
        $basePaths[] = 'sub';
        //' . $project->getCode($replaces) . '
        $initCode = '
		app.delimiter = "' . $this->_configMain['urlDelimiter'] . '";
		app.admin = "' . $this->_configMain->get('wwwroot') . $this->_configMain->get('adminPath') . '";
		app.wwwRoot = "' . $this->_configMain->get('wwwroot') . '";

		var applicationClassesNamespace = "' . $projectCfg['namespace'] . '";
		var applicationRunNamespace = "' . $projectCfg['runnamespace'] . '";
		var designerUrlPaths = ["' . implode('","', $basePaths) . '"];
		var canDelete = true;
		var canPublish = true;
		var canEdit = true;

		Ext.onReady(function(){
		    app.application.mainUrl = app.createUrl(designerUrlPaths);
            ';
        if (!empty($names)) {
            foreach ($names as $name) {
                if ($project->getObject($name)->isExtendedComponent()) {
                    if ($project->getObject($name)->getConfig()->defineOnly) {
                        continue;
                    }
                    $initCode .= Ext_Code::appendRunNamespace($name) . ' = Ext.create("' . Ext_Code::appendNamespace($name) . '",{});';
                }
                $initCode .= '
			        app.viewFrame.add(' . Ext_Code::appendRunNamespace($name) . ');
			    ';
            }
        }
        $initCode .= '
        	 app.application.fireEvent("projectLoaded");
	   });';
        $res->addInlineJs($initCode);
        $tpl = new Template();
        $tpl->lang = $this->_configMain['language'];
        $tpl->development = $this->_configMain['development'];
        $tpl->resource = $res;
        $tpl->useCSRFToken = Registry::get('backend', 'config')->get('use_csrf_token');
        Response::put($tpl->render(Application::getTemplatesPath() . 'designer/viewframe.php'));
    }
开发者ID:vgrish,项目名称:dvelum,代码行数:101,代码来源:Viewframe.php


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