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


PHP Mage_Core_Block_Template::getTemplateFile方法代码示例

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


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

示例1: testGetTemplateFile

 /**
  * @magentoAppIsolation enabled
  */
 public function testGetTemplateFile()
 {
     Mage::app()->getConfig()->getOptions()->setDesignDir(__DIR__ . DIRECTORY_SEPARATOR . '_files');
     // with template
     $template = 'dummy.phtml';
     $this->_block->setTemplate($template);
     $file = $this->_block->getTemplateFile();
     $this->assertContains('frontend', $file);
     $this->assertStringEndsWith($template, $file);
     // change area
     $this->_block->setArea('adminhtml');
     $file = $this->_block->getTemplateFile();
     $this->assertContains('adminhtml', $file);
     $this->assertStringEndsWith($template, $file);
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:18,代码来源:Template.php

示例2: getTemplateFile

 /**
  * Get absolute path to template
  *
  * Load template from adminhtml/default area flag is_simple is set
  *
  * @return string
  */
 public function getTemplateFile()
 {
     if (!$this->getIsSimple()) {
         return parent::getTemplateFile();
     }
     //load base template from admin area
     $params = array('_relative' => true, '_area' => 'adminhtml', '_package' => 'default');
     return Mage::getDesign()->getTemplateFilename($this->getTemplate(), $params);
 }
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:16,代码来源:Abstract.php

示例3: xmlEncodeAndAddHovers

 /**
  * convert each string which linking to some class or template to ajax link
  *
  * @param string $xml
  * @return string
  */
 public function xmlEncodeAndAddHovers($xml)
 {
     $xml = preg_replace(['/<template>(.*?)<\\/template>/ium', '/template="(.*?)"/ium', '/helper="(.*?)"/ium', '/(<.+?type=")(.*?)("[^>]*>)/ium'], ['<template>{{template=$1}}</template>', 'template="{{template=$1}}"', 'helper="{{helper=$1}}"', '$1{{block=$2}}$3'], $xml);
     $xml = htmlspecialchars($xml);
     if (Mage::app()->getStore()->isAdmin()) {
         $routeBase = 'debug/admin_index';
     } else {
         $routeBase = 'debug/index';
     }
     $pattern = '/{{(.*?)}}/ium';
     $xml = preg_replace_callback($pattern, function ($matches) use($routeBase) {
         list($key, $val) = explode('=', $matches[1]);
         switch ($key) {
             case 'block':
                 $url = Mage::getUrl($routeBase . '/viewBlock', ['block' => Mage::app()->getConfig()->getBlockClassName($val), '_secure' => Mage::app()->getStore()->isCurrentlySecure()]);
                 $result = '<a class="remoteCall" href="' . $url . '">' . $val . '</a>';
                 break;
             case 'helper':
                 $url = Mage::getUrl($routeBase . '/viewBlock', ['block' => Mage::app()->getConfig()->getHelperClassName(preg_replace('/\\/[^\\/]*$/', '', $val)), '_secure' => Mage::app()->getStore()->isCurrentlySecure()]);
                 $result = '<a class="remoteCall" href="' . $url . '">' . $val . '</a>';
                 break;
             case 'template':
                 $block = new Mage_Core_Block_Template();
                 $block->setTemplate($val);
                 $url = Mage::getUrl($routeBase . '/viewTemplate', ['_query' => ['template' => $block->getTemplateFile()], '_secure' => Mage::app()->getStore()->isCurrentlySecure()]);
                 $result = '<a class="remoteCall" href="' . $url . '">' . $val . '</a>';
                 break;
         }
         return $result;
     }, $xml);
     return $xml;
 }
开发者ID:baltechies,项目名称:n98-magerun-modules,代码行数:38,代码来源:Data.php


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