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


PHP Varien_Object::setUrl方法代码示例

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


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

示例1: _prepareObject

 /**
  * Prepare page object
  *
  * @param array $data
  * @return Varien_Object
  */
 protected function _prepareObject(array $data)
 {
     $object = new Varien_Object();
     $object->setId($data[$this->getIdFieldName()]);
     $object->setUrl($data['url']);
     return $object;
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:13,代码来源:Page.php

示例2: getLastNotice

 public function getLastNotice()
 {
     if ($this->showExtendwarePopup === false) {
         return parent::getLastNotice();
     }
     static $lastNotice = false;
     if ($lastNotice === false) {
         $lastNotice = null;
         $message = Mage::helper('ewcore/notification')->getMessage();
         if ($message) {
             $lastNotice = new Varien_Object();
             $lastNotice->setTitle($message->getSubject());
             $lastNotice->setDescription($message->getSummary());
             $lastNotice->setUrl($this->getUrl('extendware_ewcore/adminhtml_message/edit', array('id' => $message->getId())));
             $lastNotice->setSeverity(Mage_AdminNotification_Model_Inbox::SEVERITY_MINOR);
             switch ($message->getSeverity()) {
                 case 'notice':
                     $lastNotice->setSeverity(Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE);
                     break;
                 case 'minor':
                     $lastNotice->setSeverity(Mage_AdminNotification_Model_Inbox::SEVERITY_MINOR);
                     break;
                 case 'major':
                     $lastNotice->setSeverity(Mage_AdminNotification_Model_Inbox::SEVERITY_MAJOR);
                     break;
                 case 'critical':
                     $lastNotice->setSeverity(Mage_AdminNotification_Model_Inbox::SEVERITY_CRITICAL);
                     break;
             }
         }
     }
     return $lastNotice;
 }
开发者ID:platonicsolution,项目名称:local-server,代码行数:33,代码来源:Window.php

示例3: _prepareObject

 protected function _prepareObject(array $data)
 {
     $object = new Varien_Object();
     $object->setId($data['post_id']);
     $object->setUrl($data['url']);
     $object->setDate($data['date']);
     return $object;
 }
开发者ID:vstorm83,项目名称:ausport,代码行数:8,代码来源:Page.php

示例4: addFeed

 /**
  * add a new feed
  *
  * @access public
  * @param string $label
  * @param string $url
  * @param bool $prepare
  * @return Stovpak_Article_Block_Rss
  * @author Ultimate Module Creator
  */
 public function addFeed($label, $url, $prepare = false)
 {
     $link = $prepare ? $this->getUrl($url) : $url;
     $feed = new Varien_Object();
     $feed->setLabel($label);
     $feed->setUrl($link);
     $this->_feeds[$link] = $feed;
     return $this;
 }
开发者ID:astovpak,项目名称:martana,代码行数:19,代码来源:Stovpak_Article_Block_Rss.php

示例5: getJson

 public function getJson()
 {
     $response = new Varien_Object();
     $helper = Mage::helper('yanws/articleUtils');
     $response->setUrl(Mage::getBaseUrl());
     $response->setConvertTable(Mage::helper('yanws')->_getTransliterator()->getConvertTable());
     $response->setBaseRoute($helper::BASE_ROUTE);
     return $response->toJson();
 }
开发者ID:Emagedev,项目名称:Yanws,代码行数:9,代码来源:JsData.php

示例6: _getWsdlConfig

 /**
  * Get wsdl config
  *
  * @return Varien_Object
  */
 protected function _getWsdlConfig()
 {
     $wsdlConfig = new Varien_Object();
     $queryParams = $this->getController()->getRequest()->getQuery();
     if (isset($queryParams['wsdl'])) {
         unset($queryParams['wsdl']);
     }
     $wsdlConfig->setUrl(htmlspecialchars(Mage::getUrl('*/*/*', array('_query' => $queryParams))));
     $wsdlConfig->setName('Magento');
     $wsdlConfig->setHandler($this->getHandler());
     return $wsdlConfig;
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:17,代码来源:Soap.php

示例7: _initItems

 protected function _initItems()
 {
     $data = $this->_getItemsData();
     $items = array();
     foreach ($data as $itemData) {
         $obj = new Varien_Object();
         $obj->setData($itemData);
         $obj->setUrl($itemData['value']);
         $items[] = $obj;
     }
     $this->_items = $items;
     return $this;
 }
开发者ID:monarcmoso,项目名称:beta2,代码行数:13,代码来源:MMD_Multiselectnavigation_Model_Catalog_Layer_Filter_Category.php

示例8: setRedirect

 /**
  * Additionally check for session messages in several domains case
  *
  * @param string $url
  * @param int $code
  * @return Mage_Core_Controller_Response_Http
  */
 public function setRedirect($url, $code = 302)
 {
     /**
      * Use single transport object instance
      */
     if (self::$_transportObject === null) {
         self::$_transportObject = new Varien_Object();
     }
     self::$_transportObject->setUrl($url);
     self::$_transportObject->setCode($code);
     Mage::dispatchEvent('controller_response_redirect', array('response' => $this, 'transport' => self::$_transportObject));
     return parent::setRedirect(self::$_transportObject->getUrl(), self::$_transportObject->getCode());
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:20,代码来源:Http.php

示例9: _prepareProduct

 protected function _prepareProduct(array $productRow)
 {
     $product = new Varien_Object();
     $product->setId($productRow[$this->getIdFieldName()]);
     $id = $product->getId();
     $productMedia = Mage::getModel('catalog/product')->load($id)->getImage();
     $product->setMedia($productMedia);
     $productName = Mage::getModel('catalog/product')->load($id)->getName();
     $product->setName($productName);
     $productUrl = !empty($productRow['url']) ? $productRow['url'] : 'catalog/product/view/id/' . $product->getId();
     $product->setUrl($productUrl);
     return $product;
 }
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:13,代码来源:Product.php

示例10: getCollection

 public function getCollection($storeId)
 {
     $pages = parent::getCollection($storeId);
     $select = Mage::getModel('amlanding/page')->getCollection()->addFieldToFilter('is_active', 1)->getSelect()->join(array('amlanding_page_store' => $this->getTable('amlanding/page_store')), 'main_table.page_id = amlanding_page_store.page_id', array())->where('amlanding_page_store.store_id IN (?)', array($storeId));
     $query = $this->_getWriteAdapter()->query($select);
     $urlSuffix = Mage::helper('catalog/category')->getCategoryUrlSuffix($storeId);
     $urlSuffix = $urlSuffix ? $urlSuffix : '';
     while ($row = $query->fetch()) {
         $object = new Varien_Object();
         $object->setId($row['page_id']);
         $object->setUrl($row['identifier'] . $urlSuffix);
         $object->setTitle($row['title']);
         $pages[] = $object;
     }
     return $pages;
 }
开发者ID:CE-Webmaster,项目名称:CE-Hub,代码行数:16,代码来源:Page.php

示例11: _initItems

 protected function _initItems()
 {
     if ('catalogsearch' == Mage::app()->getRequest()->getModuleName()) {
         return parent::_initItems();
     }
     $data = $this->_getItemsData();
     $items = array();
     foreach ($data as $itemData) {
         if (!$itemData) {
             continue;
         }
         $obj = new Varien_Object();
         $obj->setData($itemData);
         $obj->setUrl($itemData['value']);
         $items[] = $obj;
     }
     $this->_items = $items;
     return $this;
 }
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:19,代码来源:Amasty_Shopby_Model_Catalog_Layer_Filter_Category.php

示例12: download

 public function download(Varien_Object $connectionInfo, $target)
 {
     $url = $connectionInfo->getUrl();
     if (!$url) {
         Mage::throwException($this->_getLog()->__("No valid URL given: %s", $url));
     }
     $this->_log($this->_getLog()->__("Downloading file %s from %s, to %s", basename($url), $url, $target));
     $targetInfo = pathinfo($target);
     $filename = isset($targetInfo['extension']) ? basename($target) : basename(parse_url($url, PHP_URL_PATH));
     $path = $this->_getTargetPath(dirname($target), $filename);
     $fp = fopen($path, 'w+');
     //This is the file where we save the information
     $cookie = tempnam(Mage::getBaseDir('tmp'), "CURLCOOKIE");
     $ch = curl_init($url);
     //Here is the file we are downloading, replace spaces with %20
     curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1");
     curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
     curl_setopt($ch, CURLOPT_ENCODING, "");
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_AUTOREFERER, true);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
     curl_setopt($ch, CURLOPT_FILE, $fp);
     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
     curl_exec($ch);
     $response = curl_getinfo($ch);
     curl_close($ch);
     fclose($fp);
     if ($response['http_code'] == 301 || $response['http_code'] == 302) {
         if ($headers = get_headers($response['url'])) {
             foreach ($headers as $value) {
                 if (substr(strtolower($value), 0, 9) == "location:") {
                     $connectionInfo->setUrl(trim(substr($value, 9, strlen($value))));
                     Mage::throwException($this->_getLog()->__("Retrying with forwarded URL: %s", $connectionInfo->getUrl()));
                     return $this->download($connectionInfo, $target);
                 }
             }
         }
     }
     return null;
 }
开发者ID:tormit,项目名称:Ho_Import,代码行数:41,代码来源:Http.php

示例13: _prepareProduct

 /**
  * Prepare product
  *
  * @param array $productRow
  * @return Varien_Object
  */
 protected function _prepareProduct(array $productRow)
 {
     $product = new Varien_Object();
     $product->setId($productRow[$this->getIdFieldName()]);
     $productLoaded = Mage::getModel('catalog/product')->setData($productRow);
     $requestPath = $productLoaded->getUrl();
     $idPath = sprintf('product/%d', $productLoaded->getEntityId());
     if (($categoryIdAsc = Mage::helper('ascurl')->getCategoryIdAsc($productLoaded, true)) && Mage::getStoreConfig(self::USE_CANONICAL_URL_AT_GOOGLE_SITEMAP, $productLoaded->getStoreId())) {
         $idPath = sprintf('%s/%d', $idPath, $categoryIdAsc);
     }
     $rewrited = $this->_getWriteAdapter()->query(str_replace('to_replace', $idPath, $this->rewriteQuery))->fetch();
     if (isset($rewrited['request_path'])) {
         $product->setUrl($rewrited['request_path']);
     }
     try {
         if (Mage::getStoreConfig(AW_Ascurl_Model_Sitemap::USE_IMAGES, $productLoaded->getStoreId())) {
             $product->setImageUrl($productLoaded->getImageUrl());
         }
     } catch (Exception $ex) {
     }
     return $product;
 }
开发者ID:rubenjohne,项目名称:ts-echo,代码行数:28,代码来源:Product.php

示例14: _initItems

 protected function _initItems()
 {
     if (!($key = Mage::app()->getRequest()->getParam('am_landing'))) {
         return parent::_initItems();
     }
     $data = $this->_getItemsData();
     $items = array();
     foreach ($data as $itemData) {
         if (!$itemData) {
             continue;
         }
         $obj = new Varien_Object();
         $obj->setData($itemData);
         if (isset($itemData['id'])) {
             /*
              * Navigation works here
              */
             $param = 'cat=' . $itemData['id'];
             $url = Mage::helper('amshopby/url')->getFullUrl();
             $url = preg_replace('/(\\?|&)cat=\\d+/', '$1' . $param, $url, 1, $count);
             if (!$count) {
                 if (strpos($url, '?') !== false) {
                     $url .= '&' . $param;
                 } else {
                     $url .= '?' . $param;
                 }
             }
         } else {
             $url = Mage::helper('amlanding/url')->getLandingUrl(array('cat' => $itemData['value']));
         }
         $obj->setUrl($url);
         $items[] = $obj;
     }
     $this->_items = $items;
     return $this;
 }
开发者ID:CE-Webmaster,项目名称:CE-Hub,代码行数:36,代码来源:Category.php

示例15: getFileDownloadParams

 /**
  * Returns special download params (if needed) for custom option with type = 'file'.
  * Needed to implement Mage_Catalog_Model_Product_Configuration_Item_Interface.
  *
  * We have to customize only controller url, so return it.
  *
  * @return null|Varien_Object
  */
 public function getFileDownloadParams()
 {
     $params = new Varien_Object();
     $params->setUrl($this->_customOptionDownloadUrl);
     return $params;
 }
开发者ID:natxetee,项目名称:magento2,代码行数:14,代码来源:Item.php


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