Skip to content
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

docs: update PHPDoc in html_helper #9168

Merged
merged 2 commits into from
Sep 6, 2024
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
30 changes: 20 additions & 10 deletions system/Helpers/html_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
/**
* Unordered List
*
* Generates an HTML unordered list from an single or
* multi-dimensional array.
* Generates an HTML unordered list from a single or
* multidimensional array.
*
* @param array $list List entries
* @param array|object|string $attributes HTML attributes string, array, object
*/
function ul(array $list, $attributes = ''): string
Expand All @@ -36,8 +37,9 @@ function ul(array $list, $attributes = ''): string
/**
* Ordered List
*
* Generates an HTML ordered list from an single or multi-dimensional array.
* Generates an HTML ordered list from a single or multidimensional array.
*
* @param array $list List entries
* @param array|object|string $attributes HTML attributes string, array, object
*/
function ol(array $list, $attributes = ''): string
Expand All @@ -50,10 +52,10 @@ function ol(array $list, $attributes = ''): string
/**
* Generates the list
*
* Generates an HTML ordered list from an single or multi-dimensional array.
* Generates an HTML ordered list from a single or multidimensional array.
*
* @param array $list
* @param array|object|string $attributes string, array, object
* @param array $list List entries
* @param array|object|string $attributes HTML attributes string, array, object
*/
function _list(string $type = 'ul', $list = [], $attributes = '', int $depth = 0): string
{
Expand Down Expand Up @@ -92,7 +94,7 @@ function _list(string $type = 'ul', $list = [], $attributes = '', int $depth = 0
* Generates an image element
*
* @param array|string $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 Should `Config\App::$indexPage` be added to the source path
* @param array|object|string $attributes Additional HTML attributes
*/
function img($src = '', bool $indexPage = false, $attributes = ''): string
Expand Down Expand Up @@ -192,7 +194,7 @@ function doctype(string $type = 'html5'): string
* Generates link to a JS file
*
* @param array|string $src Script source or an array of attributes
* @param bool $indexPage Should indexPage be added to the JS path
* @param bool $indexPage Should `Config\App::$indexPage` be added to the JS path
*/
function script_tag($src = '', bool $indexPage = false): string
{
Expand Down Expand Up @@ -227,7 +229,7 @@ function script_tag($src = '', bool $indexPage = false): string
* Generates link tag
*
* @param array<string, bool|string>|string $href Stylesheet href or an array
* @param bool $indexPage should indexPage be added to the CSS path.
* @param bool $indexPage Should `Config\App::$indexPage` be added to the CSS path.
*/
function link_tag(
$href = '',
Expand Down Expand Up @@ -288,6 +290,7 @@ function link_tag(
* @param array|string $src Either a source string or an array of sources
* @param string $unsupportedMessage The message to display if the media tag is not supported by the browser
* @param string $attributes HTML attributes
* @param bool $indexPage Should `Config\App::$indexPage` be added to the source path
*/
function video($src, string $unsupportedMessage = '', string $attributes = '', array $tracks = [], bool $indexPage = false): string
{
Expand Down Expand Up @@ -334,6 +337,7 @@ function video($src, string $unsupportedMessage = '', string $attributes = '', a
* @param array|string $src Either a source string or an array of sources
* @param string $unsupportedMessage The message to display if the media tag is not supported by the browser.
* @param string $attributes HTML attributes
* @param bool $indexPage Should `Config\App::$indexPage` be added to the source path
*/
function audio($src, string $unsupportedMessage = '', string $attributes = '', array $tracks = [], bool $indexPage = false): string
{
Expand Down Expand Up @@ -413,6 +417,7 @@ function _media(string $name, array $types = [], string $unsupportedMessage = ''
* @param string $src The path of the media resource
* @param string $type The MIME-type of the resource with optional codecs parameters
* @param string $attributes HTML attributes
* @param bool $indexPage Should `Config\App::$indexPage` be added to the source path
*/
function source(string $src, string $type = 'unknown', string $attributes = '', bool $indexPage = false): string
{
Expand All @@ -438,7 +443,10 @@ function source(string $src, string $type = 'unknown', string $attributes = '',
* Generates a track element to specify timed tracks. The tracks are
* formatted in WebVTT format.
*
* @param string $src The path of the .VTT file
* @param string $src The path of the .VTT file
* @param string $kind How the text track is meant to be used
* @param string $srcLanguage Language of the track text data
* @param string $label A user-readable title of the text track
*/
function track(string $src, string $kind, string $srcLanguage, string $label): string
{
Expand All @@ -461,6 +469,7 @@ function track(string $src, string $kind, string $srcLanguage, string $label): s
* @param string $data A resource URL
* @param string $type Content-type of the resource
* @param string $attributes HTML attributes
* @param bool $indexPage Should `Config\App::$indexPage` be added to the data path
*/
function object(string $data, string $type = 'unknown', string $attributes = '', array $params = [], bool $indexPage = false): string
{
Expand Down Expand Up @@ -513,6 +522,7 @@ function param(string $name, string $value, string $type = 'ref', string $attrib
* @param string $src The path of the resource to embed
* @param string $type MIME-type
* @param string $attributes HTML attributes
* @param bool $indexPage Should `Config\App::$indexPage` be added to the source path
*/
function embed(string $src, string $type = 'unknown', string $attributes = '', bool $indexPage = false): string
{
Expand Down
Loading