Allowed specifying media path using 'src' attribute

This commit is contained in:
ADmad 2012-02-10 13:06:55 +05:30
parent bea50f5246
commit be694d8d6b
2 changed files with 10 additions and 0 deletions

View file

@ -1743,6 +1743,13 @@ class HtmlHelperTest extends CakeTestCase {
'/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);
}
/**

View file

@ -1047,6 +1047,9 @@ class HtmlHelper extends AppHelper {
$options['text'] = $sourceTags . $options['text'];
unset($options['fullBase']);
} else {
if (empty($path) && !empty($options['src'])) {
$path = $options['src'];
}
$options['src'] = $this->assetUrl($path, $options);
}