Public Member Functions | |
getTemplate () | |
getArea () | |
assign ($key, $value=null) | |
setScriptPath ($dir) | |
getDirectOutput () | |
getShowTemplateHints () | |
fetchView ($fileName) | |
renderView () | |
getBaseUrl () | |
getJsUrl ($fileName='') | |
Protected Member Functions | |
_toHtml () | |
Protected Attributes | |
$_viewDir = '' | |
$_viewVars = array() | |
$_baseUrl | |
$_jsUrl | |
Static Protected Attributes | |
static | $_showTemplateHints |
static | $_showTemplateHintsBlocks |
Definition at line 35 of file Template.php.
_toHtml | ( | ) | [protected] |
Render block HTML
Reimplemented from Mage_Core_Block_Abstract.
Reimplemented in Mage_Adminhtml_Block_Catalog_Product_Attribute_New_Product_Attributes, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes_Create, Mage_Adminhtml_Block_Customer_Edit_Tab_Carts, Mage_Adminhtml_Block_Newsletter_Template_Preview, Mage_Adminhtml_Block_Poll_Edit_Tab_Answers_List, Mage_Adminhtml_Block_Rating_Edit_Tab_Form, Mage_Adminhtml_Block_Sales_Items_Column_Name_Grouped, Mage_Adminhtml_Block_Sales_Order_Create_Header, Mage_Adminhtml_Block_Sales_Order_Create_Items, Mage_Adminhtml_Block_Sales_Order_Create_Load, Mage_Adminhtml_Block_Sales_Order_Create_Newsletter, Mage_Adminhtml_Block_Sales_Order_Payment, Mage_Adminhtml_Block_Store_Switcher, Mage_Adminhtml_Block_System_Convert_Profile_Run, Mage_Adminhtml_Block_System_Email_Template_Preview, Mage_Adminhtml_Block_Widget_Accordion_Item, Mage_Adminhtml_Block_Widget_Button, Mage_Adminhtml_Block_Widget_Container, Mage_AmazonPayments_Block_Asp_Shortcut, Mage_AmazonPayments_Block_Link_Shortcut, Mage_Checkout_Block_Cart_Item_Renderer_Grouped, Mage_Checkout_Block_Cart_Sidebar, Mage_Checkout_Block_Multishipping_Link, Mage_Checkout_Block_Multishipping_Payment_Info, Mage_Checkout_Block_Onepage_Payment_Info, Mage_Core_Block_Html_Calendar, Mage_Core_Block_Html_Date, Mage_Core_Block_Messages, Mage_Downloadable_Block_Adminhtml_Catalog_Product_Edit_Tab_Downloadable, Mage_GoogleCheckout_Block_Link, Mage_GoogleOptimizer_Block_Code, Mage_Page_Block_Html_Breadcrumbs, Mage_Page_Block_Html_Toplinks, Mage_Paypal_Block_Link_Shortcut, Mage_PaypalUk_Block_Link_Shortcut, Mage_Poll_Block_ActivePoll, Mage_Rating_Block_Entity_Detailed, Mage_Reports_Block_Product_Compared, Mage_Reports_Block_Product_Viewed, Mage_Review_Block_Product_View, Mage_Rss_Block_Catalog_Category, Mage_Rss_Block_Catalog_New, Mage_Rss_Block_Catalog_NotifyStock, Mage_Rss_Block_Catalog_Review, Mage_Rss_Block_Catalog_Salesrule, Mage_Rss_Block_Catalog_Special, Mage_Rss_Block_Catalog_Tag, Mage_Rss_Block_Order_New, Mage_Rss_Block_Order_Status, Mage_Rss_Block_Wishlist, Mage_Sales_Block_Order_Email_Items_Order_Grouped, Mage_Sales_Block_Order_Item_Renderer_Grouped, Mage_Sales_Block_Order_Recent, Mage_Sales_Block_Reorder_Sidebar, Mage_Tag_Block_Customer_Recent, Mage_Tag_Block_Popular, and Mage_Wishlist_Block_Customer_Sidebar.
Definition at line 188 of file Template.php.
00189 { 00190 if (!$this->getTemplate()) { 00191 return ''; 00192 } 00193 $html = $this->renderView(); 00194 return $html; 00195 }
assign | ( | $ | key, | |
$ | value = null | |||
) |
Assign variable
string|array | $key | |
mixed | $value |
Reimplemented in Mage_Core_Block_Template_Zend.
Definition at line 76 of file Template.php.
00077 { 00078 if (is_array($key)) { 00079 foreach ($key as $k=>$v) { 00080 $this->assign($k, $v); 00081 } 00082 } 00083 else { 00084 $this->_viewVars[$key] = $value; 00085 } 00086 return $this; 00087 }
fetchView | ( | $ | fileName | ) |
Retrieve block view from file (template)
string | $fileName |
Reimplemented in Mage_Core_Block_Template_Zend.
Definition at line 126 of file Template.php.
00127 { 00128 Varien_Profiler::start($fileName); 00129 00130 extract ($this->_viewVars); 00131 $do = $this->getDirectOutput(); 00132 00133 if (!$do) { 00134 ob_start(); 00135 } 00136 if ($this->getShowTemplateHints()) { 00137 echo '<div style="position:relative; border:1px dotted red; margin:6px 2px; padding:18px 2px 2px 2px; zoom:1;"><div style="position:absolute; left:0; top:0; padding:2px 5px; background:red; color:white; font:normal 11px Arial; text-align:left !important; z-index:998;" onmouseover="this.style.zIndex=\'999\'" onmouseout="this.style.zIndex=\'998\'" title="'.$fileName.'">'.$fileName.'</div>'; 00138 if (self::$_showTemplateHintsBlocks) { 00139 $thisClass = get_class($this); 00140 echo '<div style="position:absolute; right:0; top:0; padding:2px 5px; background:red; color:blue; font:normal 11px Arial; text-align:left !important; z-index:998;" onmouseover="this.style.zIndex=\'999\'" onmouseout="this.style.zIndex=\'998\'" title="'.$thisClass.'">'.$thisClass.'</div>'; 00141 } 00142 } 00143 00144 include $this->_viewDir.DS.$fileName; 00145 00146 if ($this->getShowTemplateHints()) { 00147 echo '</div>'; 00148 } 00149 00150 if (!$do) { 00151 $html = ob_get_clean(); 00152 } else { 00153 $html = ''; 00154 } 00155 Varien_Profiler::stop($fileName); 00156 return $html; 00157 }
getArea | ( | ) |
getBaseUrl | ( | ) |
Get base url of the application
Reimplemented in Mage_Page_Block_Html.
Definition at line 202 of file Template.php.
00203 { 00204 if (!$this->_baseUrl) { 00205 $this->_baseUrl = Mage::getBaseUrl(); 00206 } 00207 return $this->_baseUrl; 00208 }
getDirectOutput | ( | ) |
Definition at line 101 of file Template.php.
00102 { 00103 if ($this->getLayout()) { 00104 return $this->getLayout()->getDirectOutput(); 00105 } 00106 return false; 00107 }
getJsUrl | ( | $ | fileName = '' |
) |
Get url of base javascript file
To get url of skin javascript file use getSkinUrl()
string | $fileName |
Definition at line 218 of file Template.php.
00219 { 00220 if (!$this->_jsUrl) { 00221 $this->_jsUrl = Mage::getBaseUrl('js'); 00222 } 00223 return $this->_jsUrl.$fileName; 00224 }
getShowTemplateHints | ( | ) |
Definition at line 109 of file Template.php.
00110 { 00111 if (is_null(self::$_showTemplateHints)) { 00112 self::$_showTemplateHints = Mage::getStoreConfig('dev/debug/template_hints') 00113 && Mage::helper('core')->isDevAllowed(); 00114 self::$_showTemplateHintsBlocks = Mage::getStoreConfig('dev/debug/template_hints_blocks') 00115 && Mage::helper('core')->isDevAllowed(); 00116 } 00117 return self::$_showTemplateHints; 00118 }
getTemplate | ( | ) |
Definition at line 59 of file Template.php.
00060 { 00061 return $this->_getData('template'); 00062 }
renderView | ( | ) |
Render block
Definition at line 164 of file Template.php.
00165 { 00166 Varien_Profiler::start(__METHOD__); 00167 00168 $this->setScriptPath(Mage::getBaseDir('design')); 00169 $params = array('_relative'=>true); 00170 if ($area = $this->getArea()) { 00171 $params['_area'] = $area; 00172 } 00173 00174 $templateName = Mage::getDesign()->getTemplateFilename($this->getTemplate(), $params); 00175 00176 $html = $this->fetchView($templateName); 00177 00178 Varien_Profiler::stop(__METHOD__); 00179 00180 return $html; 00181 }
setScriptPath | ( | $ | dir | ) |
Set template location dire
string | $dir |
Reimplemented in Mage_Core_Block_Template_Zend.
Definition at line 95 of file Template.php.
$_baseUrl [protected] |
Definition at line 52 of file Template.php.
$_jsUrl [protected] |
Definition at line 54 of file Template.php.
$_showTemplateHints [static, protected] |
Definition at line 56 of file Template.php.
$_showTemplateHintsBlocks [static, protected] |
Definition at line 57 of file Template.php.
$_viewDir = '' [protected] |
Definition at line 43 of file Template.php.
$_viewVars = array() [protected] |
Definition at line 50 of file Template.php.