當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。