mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Allowed specifying media path using 'src' attribute
This commit is contained in:
parent
bea50f5246
commit
be694d8d6b
2 changed files with 10 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue