Skip to content

docs: fix html_helper.rst #5276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions user_guide_src/source/helpers/html_helper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ The following functions are available:
.. php:function:: img([$src = ''[, $indexPage = false[, $attributes = '']]])

:param string|array $src: Image source URI, or array of attributes and values
:param bool $indexPage: Whether to treat $src as a routed URI string
:param bool $indexPage: Whether to treat ``$src`` as a routed URI string
:param mixed $attributes: Additional HTML attributes
:returns: HTML image tag
:rtype: string

Lets you create HTML <img /> tags. The first parameter contains the
Lets you create HTML ``<img />`` tags. The first parameter contains the
image source. Example::

echo img('images/picture.jpg');
Expand Down Expand Up @@ -79,11 +79,11 @@ The following functions are available:
echo img($src);

There is an optional second parameter to specify the MIME type, otherwise the
function will use your Mimes config to guess.
function will use your Mimes config to guess::

$src = img_data('path/img_without_extension', 'image/png'); // data:image/png;base64,HT5A822...

Note that $path must exist and be a readable image format supported by the ``data:`` protocol.
Note that ``$path`` must exist and be a readable image format supported by the ``data:`` protocol.
This function is not recommended for very large files, but it provides a convenient way
of serving images from your app that are not web-accessible (e.g., in **public/**).

Expand All @@ -94,12 +94,12 @@ The following functions are available:
:param string $type: Type of the related document
:param string $title: Link title
:param string $media: Media type
:param bool $indexPage: Whether to treat $src as a routed URI string
:param bool $indexPage: Whether to treat ``$src`` as a routed URI string
:param string $hreflang: Hreflang type
:returns: HTML link tag
:rtype: string

Lets you create HTML <link /> tags. This is useful for stylesheet links,
Lets you create HTML ``<link />`` tags. This is useful for stylesheet links,
as well as other links. The parameters are *href*, with optional *rel*,
*type*, *title*, *media* and *indexPage*.

Expand Down Expand Up @@ -135,11 +135,11 @@ The following functions are available:
.. php:function:: script_tag([$src = ''[, $indexPage = false]])

:param mixed $src: The source name of a JavaScript file
:param bool $indexPage: Whether to treat $src as a routed URI string
:param bool $indexPage: Whether to treat ``$src`` as a routed URI string
:returns: HTML script tag
:rtype: string

Lets you create HTML <script></script> tags. The parameters is *src*, with optional *indexPage*.
Lets you create HTML ``<script></script>`` tags. The parameters is *src*, with optional *indexPage*.

*indexPage* is a boolean value that specifies if the *src* should have
the page specified by ``$config['indexPage']`` added to the address it creates.
Expand Down Expand Up @@ -284,8 +284,8 @@ The following functions are available:
:returns: HTML-formatted ordered list
:rtype: string

Identical to :php:func:`ul()`, only it produces the <ol> tag for
ordered lists instead of <ul>.
Identical to :php:func:`ul()`, only it produces the ``<ol>`` tag for
ordered lists instead of ``<ul>``.

.. php:function:: video($src[, $unsupportedMessage = ''[, $attributes = ''[, $tracks = [][, $indexPage = false]]]])

Expand Down Expand Up @@ -359,7 +359,7 @@ The following functions are available:
:returns: HTML-formatted audio element
:rtype: string

Identical to :php:func:`video()`, only it produces the <audio> tag instead of <video>.
Identical to :php:func:`video()`, only it produces the ``<audio>`` tag instead of ``<video>``.

.. php:function:: source($src = ''[, $type = false[, $attributes = '']])

Expand All @@ -369,7 +369,7 @@ The following functions are available:
:returns: HTML source tag
:rtype: string

Lets you create HTML <source /> tags. The first parameter contains the
Lets you create HTML ``<source />`` tags. The first parameter contains the
source source. Example::

echo source('movie.mp4', 'video/mp4', 'class="test"');
Expand All @@ -384,7 +384,7 @@ The following functions are available:
:returns: HTML embed tag
:rtype: string

Lets you create HTML <embed /> tags. The first parameter contains the
Lets you create HTML ``<embed />`` tags. The first parameter contains the
embed source. Example::

echo embed('movie.mov', 'video/quicktime', 'class="test"');
Expand All @@ -399,7 +399,7 @@ The following functions are available:
:returns: HTML object tag
:rtype: string

Lets you create HTML <object /> tags. The first parameter contains the
Lets you create HTML ``<object />`` tags. The first parameter contains the
object data. Example::

echo object('movie.swf', 'application/x-shockwave-flash', 'class="test"');
Expand Down Expand Up @@ -433,7 +433,7 @@ The following functions are available:
:returns: HTML param tag
:rtype: string

Lets you create HTML <param /> tags. The first parameter contains the
Lets you create HTML ``<param />`` tags. The first parameter contains the
param source. Example::

echo param('movie.mov', 'video/quicktime', 'class="test"');
Expand Down Expand Up @@ -471,7 +471,7 @@ The following functions are available:
// <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

The following is a list of the pre-defined doctype choices. These are configurable,
pulled from `application/Config/DocTypes.php`, or they could be over-ridden in your `.env` configuration.
pulled from **app/Config/DocTypes.php**, or they could be over-ridden in your **.env** configuration.

=============================== =================== ==================================================================================================================================================
Document type Option Result
Expand Down