Skip to content
Permalink
Browse files

Allowed specifying media path using 'src' attribute

  • Loading branch information...
ADmad committed Feb 10, 2012
1 parent bea50f5 commit be694d8d6bd0b6ad1bc814b93db4cf7129a73cf3
Showing with 10 additions and 0 deletions.
  1. +7 −0 lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
  2. +3 −0 lib/Cake/View/Helper/HtmlHelper.php
@@ -1743,6 +1743,13 @@ public function testMedia() {
'/video'
);
$this->assertTags($result, $expected);
$result = $this->Html->media(null, array('src' => 'video.webm'));
$expected = array(
'video' => array('src' => 'files/video.webm'),
'/video'
);
$this->assertTags($result, $expected);
}
/**
@@ -1047,6 +1047,9 @@ public function media($path, $options = array()) {
$options['text'] = $sourceTags . $options['text'];
unset($options['fullBase']);
} else {
if (empty($path) && !empty($options['src'])) {
$path = $options['src'];
}
$options['src'] = $this->assetUrl($path, $options);
}

0 comments on commit be694d8

Please sign in to comment.
You can’t perform that action at this time.