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


PHP Varien_Object::getHtml方法代码示例

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


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

示例1: render

 public function render(Varien_Object $row)
 {
     $field_id = str_replace('field_', '', $this->getColumn()->getIndex());
     $field = Mage::getModel('webforms/fields')->load($field_id);
     $value = $row->getData($this->getColumn()->getIndex());
     $html = '';
     if ($field->getType() == 'textarea') {
         $html = $this->getTextareaBlock($row);
     }
     if ($field->getType() == 'email') {
         if ($value) {
             $websiteId = Mage::app()->getStore($row->getStoreId())->getWebsite()->getId();
             $customer = Mage::getModel('customer/customer')->setData('website_id', $websiteId)->loadByEmail($value);
             $html = $value;
             if ($customer->getId()) {
                 $html .= " [<a href='" . $this->getCustomerUrl($customer->getId()) . "' target='_blank'>" . $customer->getName() . "</a>]";
             }
         }
     }
     $html_object = new Varien_Object(array('html' => $html));
     Mage::dispatchEvent('webforms_block_adminhtml_results_renderer_value_render', array('field' => $field, 'html_object' => $html_object, 'value' => $value));
     if ($html_object->getHtml()) {
         return $html_object->getHtml();
     }
     return nl2br(htmlspecialchars($value));
 }
开发者ID:xiaoguizhidao,项目名称:BumblebeeSite,代码行数:26,代码来源:Value.php

示例2: getValueHtml

 public function getValueHtml($item)
 {
     $result = new Varien_Object();
     $block = $this;
     Mage::dispatchEvent('m_filter_value_html', compact('block', 'item', 'result'));
     return $result->getHtml() ? $result->getHtml() : '';
 }
开发者ID:xiaoguizhidao,项目名称:ortodon,代码行数:7,代码来源:State.php

示例3: fetchRender

 /**
  * Call Render Function
  *
  * @param string $parentFunction
  * @param mixed $params
  * @return string
  */
 public function fetchRender($parentFunction, $row)
 {
     $parentBlock = $this->getParentBlock();
     $fetchObj = new Varien_Object(array('function' => $parentFunction, 'html' => false));
     Mage::dispatchEvent("affiliateplus_grid_fetch_render_{$parentFunction}", array('block' => $parentBlock, 'row' => $row, 'fetch' => $fetchObj));
     if ($fetchObj->getHtml()) {
         return $fetchObj->getHtml();
     }
     return $parentBlock->{$parentFunction}($row);
 }
开发者ID:billadams,项目名称:forever-frame,代码行数:17,代码来源:Grid.php

示例4: render

 public function render(Varien_Object $row)
 {
     $field_id = str_replace('field_', '', $this->getColumn()->getIndex());
     $field = Mage::getModel('webforms/fields')->load($field_id);
     $value = $row->getData($this->getColumn()->getIndex());
     $html = '';
     if ($field->getType() == 'file') {
         if (strlen($value) > 1) {
             $html = '<nobr><a href="' . $this->getDownloadLink($row) . '">' . $value . '</a> <small>[' . $row->getFileSizeText($field_id, $value) . ']</small></nobr>';
         } else {
             return;
         }
     }
     if ($field->getType() == 'image') {
         if (strlen($value) > 1) {
             if ($this->getImageThumbnail($row)) {
                 $html = '<a href="' . $this->getDownloadLink($row) . '" target="_blank"><img src="' . $this->getImageThumbnail($row) . '"/></a>';
             } else {
                 $html = '<nobr><a href="' . $this->getDownloadLink($row) . '">' . $value . '</a> <small>[' . $row->getFileSizeText($field_id, $value) . ']</small></nobr>';
             }
         } else {
             return;
         }
     }
     if ($field->getType() == 'stars') {
         $html = $this->getStarsBlock($row);
     }
     if ($field->getType() == 'textarea') {
         $html = $this->getTextareaBlock($row);
     }
     if ($field->getType() == 'wysiwyg') {
         $html = $this->getHtmlTextareaBlock($row);
     }
     if (strstr($field->getType(), 'date')) {
         $html = $field->formatDate($value);
     }
     if ($field->getType() == 'email') {
         if ($value) {
             $websiteId = Mage::app()->getStore($row->getStoreId())->getWebsite()->getId();
             $customer = Mage::getModel('customer/customer')->setData('website_id', $websiteId)->loadByEmail($value);
             $html = $value;
             if ($customer->getId()) {
                 $html .= " [<a href='" . $this->getCustomerUrl($customer->getId()) . "' target='_blank'>" . $customer->getName() . "</a>]";
             }
         }
     }
     $html_object = new Varien_Object(array('html' => $html));
     Mage::dispatchEvent('webforms_block_adminhtml_results_renderer_value_render', array('field' => $field, 'html_object' => $html_object, 'value' => $value));
     if ($html_object->getHtml()) {
         return $html_object->getHtml();
     }
     return nl2br(htmlspecialchars($value));
 }
开发者ID:smitmanglam,项目名称:staging,代码行数:53,代码来源:Value.php

示例5: _toHtml

 /**
  * render coupon block
  * 
  * @return html
  */
 protected function _toHtml()
 {
     $container = new Varien_Object(array('html' => '', 'rewrite_core' => false));
     Mage::dispatchEvent('rewardpoints_rewrite_coupon_block_to_html', array('block' => $this, 'container' => $container));
     if ($container->getRewriteCore() && $container->getHtml()) {
         return $container->getHtml();
     }
     if ($this->getChild('checkout.cart.rewardpoints')) {
         return $container->getHtml() . $this->getChildHtml('checkout.cart.rewardpoints') . parent::_toHtml();
     }
     return $container->getHtml() . parent::_toHtml();
 }
开发者ID:kanotest15,项目名称:cbmagento,代码行数:17,代码来源:Coupon.php

示例6: render

 public function render(Varien_Object $row)
 {
     $field_id = str_replace('field_', '', $this->getColumn()->getIndex());
     $field = Mage::getModel('webforms/fields')->load($field_id);
     $value = $row->getData($this->getColumn()->getIndex());
     $html = '';
     $html_object = new Varien_Object(array('html' => $html));
     Mage::dispatchEvent('webforms_block_adminhtml_results_renderer_value_render', array('field' => $field, 'html_object' => $html_object, 'value' => $value));
     if ($html_object->getHtml()) {
         return $html_object->getHtml();
     }
     return nl2br(htmlspecialchars($value));
 }
开发者ID:pankajsinghjarial,项目名称:SYLC,代码行数:13,代码来源:Value.php

示例7: _afterToHtml

 protected function _afterToHtml($html)
 {
     $html = parent::_afterToHtml($html);
     $transport = new Varien_Object(array('html' => $html));
     Mage::dispatchEvent('aitsys_block_abstract_to_html_after', array('block' => $this, 'transport' => $transport));
     return $transport->getHtml();
 }
开发者ID:sagmahajan,项目名称:aswan_release,代码行数:7,代码来源:Abstract.php

示例8: addAfterToHtml

 public function addAfterToHtml($html, Mage_Core_Block_Abstract $block)
 {
     $transportObject = new Varien_Object();
     $transportObject->setHtml($html);
     Mage::dispatchEvent('aitunits_core_block_template_to_html_after', array('block' => $block, 'transport' => $transportObject));
     $html = $transportObject->getHtml();
     return $html;
 }
开发者ID:finelinePG,项目名称:finelink-dev,代码行数:8,代码来源:Event.php

示例9: getPriceHtml

 /**
  * Returns product price block html
  *
  * @param Mage_Catalog_Model_Product $product
  * @param boolean $displayMinimalPrice
  */
 public function getPriceHtml($product, $displayMinimalPrice = false, $idSuffix = '')
 {
     $html = parent::getPriceHtml($product, $displayMinimalPrice, $idSuffix);
     $container = new Varien_Object();
     $container->setHtml($html);
     Mage::dispatchEvent('block_catalog_product_get_price_html', array('block' => $this, 'container' => $container));
     $html = $container->getHtml();
     return $html;
 }
开发者ID:riker09,项目名称:DMP_BasePrice,代码行数:15,代码来源:Simple.php

示例10: getGroupedHtml

 public function getGroupedHtml()
 {
     $html = parent::getGroupedHtml();
     $_transportObject = new Varien_Object();
     $_transportObject->setHtml($html);
     Mage::dispatchEvent('core_block_abstract_to_html_after', array('block' => $this, 'transport' => $_transportObject));
     $html = $_transportObject->getHtml();
     return $html;
 }
开发者ID:guohuadeng,项目名称:stampApp,代码行数:9,代码来源:Messages.php

示例11: getGroupedHtml

 /**
  * Retrieve messages in HTML format grouped by type
  *
  * @param   string $type
  * @return  string
  */
 public function getGroupedHtml()
 {
     $html = parent::getGroupedHtml();
     /**
      * Use single transport object instance for all blocks
      */
     $_transportObject = new Varien_Object();
     $_transportObject->setHtml($html);
     Mage::dispatchEvent('core_block_messages_get_grouped_html_after', array('block' => $this, 'transport' => $_transportObject));
     $html = $_transportObject->getHtml();
     return $html;
 }
开发者ID:AndreKlang,项目名称:Lesti_Fpc,代码行数:18,代码来源:Messages.php

示例12: _toHtml

 protected function _toHtml()
 {
     if (!Mage::getStoreConfig('jeroenvermeulen_solarium/results/autocomplete_product_suggestions')) {
         return parent::_toHtml();
     }
     $productIds = $this->getSuggestProductIds();
     if (empty($productIds)) {
         return parent::_toHtml();
     } else {
         // Magento by default starts with a hidden <li>, don't know why.
         $html = '<ul class="product_suggest"><li style="display: none"></li>';
         $transport = new Varien_Object();
         $transport->setHtml(null);
         // Event listener can fill this with HTML, <li> tags.
         Mage::dispatchEvent('jeroenvermeulen_solarium_get_product_suggest_html', array('product_ids' => $productIds, 'transport' => $transport));
         if (!is_null($transport->getHtml())) {
             $html .= $transport->getHtml();
         } else {
             $productCollection = $products = Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter('entity_id', array('in' => $productIds))->addAttributeToSelect(array('name', 'thumbnail', 'product_url'));
             $counter = 0;
             foreach ($productCollection as $product) {
                 $rowClass = ++$counter % 2 ? 'odd' : 'even';
                 $imageUrl = Mage::helper('catalog/image')->init($product, 'thumbnail')->resize('50');
                 $showName = Mage::helper('core/string')->truncate($product->getName(), 100);
                 $html .= sprintf('<li title="%s" class="%s" data-url="%s">', htmlentities($product->getName()), $rowClass, htmlentities($product->getProductUrl()));
                 $html .= '<span class="suggestions-productimage">';
                 $html .= sprintf('<img src="%s" />', htmlentities($imageUrl));
                 $html .= '</span>';
                 $html .= '<span class="suggestions-productname">';
                 $html .= htmlentities($showName);
                 $html .= '</span>';
                 $html .= '</li>';
             }
         }
         $html .= '</ul>';
     }
     return $html;
 }
开发者ID:enyasar,项目名称:magento-solarium,代码行数:38,代码来源:Autocomplete.php

示例13: _toHtml

 /**
  * Add content of template block below price html if defined in config
  *
  * @return string
  */
 public function _toHtml()
 {
     $html = trim(parent::_toHtml());
     if (empty($html) || !Mage::getStoreConfigFlag('catalog/price/display_block_below_price')) {
         return $html;
     }
     if ($this->getTemplate() != $this->_tierPriceDefaultTemplate) {
         $htmlObject = new Varien_Object();
         $htmlObject->setParentHtml($html);
         $htmlTemplate = $this->getLayout()->createBlock('core/template')->setTemplate('germansetup/price_info.phtml')->setFormattedTaxRate($this->getFormattedTaxRate())->setIsIncludingTax($this->isIncludingTax())->setIsIncludingShippingCosts($this->isIncludingShippingCosts())->setIsShowShippingLink($this->isShowShippingLink())->toHtml();
         $htmlObject->setHtml($htmlTemplate);
         Mage::dispatchEvent('germansetup_after_product_price', array('html_obj' => $htmlObject, 'block' => $this));
         $html = $htmlObject->getPrefix();
         $html .= $htmlObject->getParentHtml();
         $html .= $htmlObject->getHtml();
         $html .= $htmlObject->getSuffix();
     }
     return $html;
 }
开发者ID:xiaoguizhidao,项目名称:bilderrahmen,代码行数:24,代码来源:Price.php

示例14: appendToCatalogListing

 /**
  * Appends the points balance in the header somewhere
  * @param Mage_Catalog_Block_Product_List $block
  * @param Varien_Object $transport
  */
 public function appendToCatalogListing($block, $transport)
 {
     // Should we be checking this auto-integration?
     if (!Mage::getStoreConfigFlag('rewards/autointegration/product_listing')) {
         return $this;
     }
     // Block is a price block.
     if (!$block instanceof Mage_Catalog_Block_Product_List) {
         return $this;
     }
     $all_products = $block->getLoadedProductCollection();
     $html = $transport->getHtml();
     $html = $this->_getNewCatalogListingHtml($html, $all_products);
     $transport->setHtml($html);
     return $this;
 }
开发者ID:rajarshc,项目名称:Rooja,代码行数:21,代码来源:Output.php

示例15: toHtml


//.........这里部分代码省略.........
     $showTime = false;
     $calendar = false;
     $config = array('field' => $this, 'field_id' => $field_id, 'field_name' => $field_name, 'field_class' => $field_class, 'field_style' => $field_style, 'field_value' => $field_value, 'result' => $result, 'show_time' => 'false', 'customer_value' => $customer_value, 'template' => 'webforms/fields/text.phtml');
     switch ($field_type) {
         case 'textarea':
             if ($customer_value) {
                 $config['field_value'] = $customer_value;
             }
             $config['template'] = 'webforms/fields/textarea' . $custom . '.phtml';
             break;
         case 'wysiwyg':
             $tinyMCE = true;
             if ($customer_value) {
                 $config['field_value'] = $customer_value;
             }
             $config['template'] = 'webforms/fields/wysiwyg.phtml';
             break;
         case 'select':
             $config['field_options'] = $this->getOptionsArray();
             $config['template'] = 'webforms/fields/select.phtml';
             break;
         case 'select/contact':
             $config['field_options'] = $this->getOptionsArray();
             $config['template'] = 'webforms/fields/select_contact.phtml';
             break;
         case 'select/radio':
             $config['field_class'] = $this->getCssClass();
             $config['field_options'] = $this->getOptionsArray();
             $config['template'] = 'webforms/fields/select_radio' . $custom . '.phtml';
             break;
         case 'select/checkbox':
             $config['field_class'] = $this->getCssClass();
             $config['field_options'] = $this->getOptionsArray();
             $config['template'] = 'webforms/fields/select_checkbox' . $custom . '.phtml';
             break;
         case 'subscribe':
             $config['field_class'] = $this->getCssClass();
             $config['template'] = 'webforms/fields/subscribe.phtml';
             break;
         case 'stars':
             $config['field_options'] = $this->getOptionsArray();
             $config['template'] = 'webforms/fields/stars.phtml';
             break;
         case 'image':
         case 'file':
             $config['field_id'] = 'file_' . $this->getId();
             $config['field_name'] = $config['field_id'];
             $config['template'] = 'webforms/fields/file' . $custom . '.phtml';
             break;
         case 'html':
             $config['template'] = 'webforms/fields/html.phtml';
             break;
         case 'datetime':
             $config['show_time'] = 'true';
             $showTime = true;
         case 'date':
         case 'datetime':
             $calendar = true;
             if ($customer_value) {
                 // format customer value
                 $config['customer_value'] = Mage::helper('core')->formatDate($customer_value, $this->getDateType(), $showTime);
             }
             $config['template'] = 'webforms/fields/date.phtml';
             break;
         case 'hidden':
             $config['template'] = 'webforms/fields/hidden.phtml';
             break;
         case 'country':
             $config['template'] = 'webforms/fields/country.phtml';
             break;
         default:
             if ($customer_value) {
                 $config['field_value'] = $customer_value;
             }
             $config['template'] = 'webforms/fields/text' . $custom . '.phtml';
             break;
     }
     $layout = Mage::app()->getLayout();
     $html = $layout->createBlock('core/template', $field_name, $config)->toHtml();
     if ($this->getData('validate_regex')) {
         $validate_message = str_replace("'", "\\'", $this->getData('validate_message'));
         $html .= "<script>Validation.add('validate-field-{$this->getId()}','{$validate_message}',function(v){var r = new RegExp('{$this->getData('validate_regex')}');return Validation.get('IsEmpty').test(v) || r.test(v);})</script>";
     }
     // activate tinyMCE
     if ($tinyMCE && !Mage::registry('tinyMCE')) {
         Mage::register('tinyMCE', true);
         $tiny_mce = $layout->createBlock('core/template', 'tinyMCE', array('template' => 'webforms/scripts/tiny_mce.phtml'));
         $html .= $tiny_mce->toHtml();
     }
     // activate calendar
     if ($calendar && !Mage::registry('calendar')) {
         Mage::register('calendar', true);
         $calendar_block = $layout->createBlock('core/html_calendar', 'calendar_block', array('as' => 'calendar', 'template' => 'page/js/calendar.phtml'));
         $html .= $calendar_block->toHtml();
     }
     // apply custom field type
     $html_object = new Varien_Object(array('html' => $html));
     Mage::dispatchEvent('webforms_fields_tohtml_html', array('field' => $this, 'html_object' => $html_object));
     return $html_object->getHtml();
 }
开发者ID:smitmanglam,项目名称:staging,代码行数:101,代码来源:Fields.php


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