Permalink
Browse files

Change fullPath option to fullBase in HtmlHelper::image for consistency

Updated test cases for that.
Included doc block about that option.
  • Loading branch information...
1 parent 9042667 commit 03bac42366045b9b974f390e26fc38c7a4bcf626 @CauanCabral CauanCabral committed Jan 18, 2012
Showing with 6 additions and 5 deletions.
  1. +1 −1 lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
  2. +5 −4 lib/Cake/View/Helper/HtmlHelper.php
@@ -353,7 +353,7 @@ public function testImageTag() {
$result = $this->Html->image('/test/view/1.gif');
$this->assertTags($result, array('img' => array('src' => '/test/view/1.gif', 'alt' => '')));
- $result = $this->Html->image('test.gif', array('fullPath' => true));
+ $result = $this->Html->image('test.gif', array('fullBase' => true));
$here = $this->Html->url('/', true);
$this->assertTags($result, array('img' => array('src' => $here . 'img/test.gif', 'alt' => '')));
}
@@ -739,8 +739,9 @@ public function getCrumbList($options = array()) {
/**
* Creates a formatted IMG element. If `$options['url']` is provided, an image link will be
- * generated with the link pointed at `$options['url']`. This method will set an empty
- * alt attribute if one is not supplied.
+ * generated with the link pointed at `$options['url']`. If `$options['fullBase']` is provided,
+ * the src attribute will receive full address (non-relative url) of the image file.
+ * This method will set an empty alt attribute if one is not supplied.
*
* ### Usage
*
@@ -767,9 +768,9 @@ public function image($path, $options = array()) {
$path = $this->assetTimestamp($this->webroot($path));
}
- if(!empty($options['fullPath'])) {
+ if (!empty($options['fullBase'])) {
$path = $this->url('/', true) . $path;
- unset($options['fullPath']);
+ unset($options['fullBase']);
}
if (!isset($options['alt'])) {

0 comments on commit 03bac42

Please sign in to comment.