Browse Source

Rename UrlHelper methods.

ADmad 10 years ago
parent
commit
1704ab4ed2
2 changed files with 6 additions and 7 deletions
  1. 3 3
      src/View/Helper/HtmlHelper.php
  2. 3 4
      src/View/Helper/UrlHelper.php

+ 3 - 3
src/View/Helper/HtmlHelper.php

@@ -437,7 +437,7 @@ class HtmlHelper extends Helper
         if (strpos($path, '//') !== false) {
             $url = $path;
         } else {
-            $url = $this->Url->cssUrl($path, $options);
+            $url = $this->Url->css($path, $options);
             $options = array_diff_key($options, ['fullBase' => null, 'pathPrefix' => null]);
         }
 
@@ -528,7 +528,7 @@ class HtmlHelper extends Helper
         }
 
         if (strpos($url, '//') === false) {
-            $url = $this->Url->scriptUrl($url, $options);
+            $url = $this->Url->script($url, $options);
             $options = array_diff_key($options, ['fullBase' => null, 'pathPrefix' => null]);
         }
         if ($options['once'] && isset($this->_includedAssets[__METHOD__][$url])) {
@@ -808,7 +808,7 @@ class HtmlHelper extends Helper
      */
     public function image($path, array $options = [])
     {
-        $path = $this->Url->imageUrl($path, $options);
+        $path = $this->Url->image($path, $options);
         $options = array_diff_key($options, ['fullBase' => null, 'pathPrefix' => null]);
 
         if (!isset($options['alt'])) {

+ 3 - 4
src/View/Helper/UrlHelper.php

@@ -50,11 +50,10 @@ class UrlHelper extends Helper
      * @param array $options Options array. Possible keys:
      *   `fullBase` Return full URL with domain name
      *   `pathPrefix` Path prefix for relative URLs
-     *   `ext` Asset extension to append
      *   `plugin` False value will prevent parsing path as a plugin
      * @return string Generated URL
      */
-    public function imageUrl($path, array $options = [])
+    public function image($path, array $options = [])
     {
         $pathPrefix = Configure::read('App.imageBaseUrl');
         return $this->assetUrl($path, $options + compact('pathPrefix'));
@@ -74,7 +73,7 @@ class UrlHelper extends Helper
      *   `plugin` False value will prevent parsing path as a plugin
      * @return string Generated URL
      */
-    public function cssUrl($path, array $options = [])
+    public function css($path, array $options = [])
     {
         $pathPrefix = Configure::read('App.cssBaseUrl');
         $ext = '.css';
@@ -95,7 +94,7 @@ class UrlHelper extends Helper
      *   `plugin` False value will prevent parsing path as a plugin
      * @return string Generated URL
      */
-    public function scriptUrl($path, array $options = [])
+    public function script($path, array $options = [])
     {
         $pathPrefix = Configure::read('App.jsBaseUrl');
         $ext = '.js';