Skip to content

Commit

Permalink
Fix indentation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shama committed Feb 11, 2012
1 parent 81c9661 commit 12c47f5
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions en/core-libraries/helpers/html.rst
Original file line number Diff line number Diff line change
Expand Up @@ -379,37 +379,43 @@ methods of the HtmlHelper and how to use them.

.. php:method:: media(string|array $path, array $options)
:param string|array $path: Path to the video file, relative to the webroot/{$options['pathPrefix']} directory.
Or an array where each item itself can be a path string or an associate array containing keys `src` and `type`
:param string|array $path: Path to the video file, relative to the
`webroot/{$options['pathPrefix']}` directory. Or an array where each
item itself can be a path string or an associate array containing keys
`src` and `type`.
:param array $options: Array of HTML attributes, and special options.
Options:
- `type` Type of media element to generate, valid values are "audio" or "video".
If type is not provided media type is guessed based on file's mime type.
- `text` Text to include inside the video tag
- `pathPrefix` Path prefix to use for relative urls, defaults to 'files/'
- `fullBase` If provided the src attribute will get a full address including domain name

Returns a formatted audio/video tag.::
- `type` Type of media element to generate, valid values are "audio"
or "video". If type is not provided media type is guessed based on
file's mime type.
- `text` Text to include inside the video tag
- `pathPrefix` Path prefix to use for relative urls, defaults to
'files/'
- `fullBase` If provided the src attribute will get a full address
including domain name

.. versionadded:: 2.1

Returns a formatted audio/video tag::

<?php
echo $this->Html->media('audio.mp4');

//Output
// Output
<video src="/files/audio.mp3"></audio>

echo $this->Html->media('video.mp4', array('fullBase' => true, 'text' => 'Fallback text'));

//Output
// Output
<video src="http://www.somehost.com/files/video.mp4">Fallback text</video>

echo $this->Html->media(
array('video.mp4', array('src' => 'video.ogg', 'type' => "video/ogg; codecs='theora, vorbis'")),
array('autoplay')
);

//Output
// Output
<video autoplay="autoplay">
<source src="/files/video.mp4" type="video/mp4"/>
<source src="/files/video.ogg" type="video/ogg; codecs='theora, vorbis'"/>
Expand Down

0 comments on commit 12c47f5

Please sign in to comment.