Back to HTMLHelper class

Method iframe

public static string
iframe
(mixed $url, mixed $name, mixed $attribs = null, mixed $noFrames = '')
Write a `<iframe>` element
Parameters
  • string $url The relative URL to use for the src attribute.
  • string $name The target attribute to use.
  • array|string $attribs Attributes to be added to the `<iframe>` element
  • string $noFrames The message to display if the iframe tag is not supported.
Returns
  • string
Since
  • 1.5
Class: HTMLHelper
Project: Joomla

Method iframe - Source code

/**
 * Write a `<iframe>` element
 *
 * @param   string        $url       The relative URL to use for the src attribute.
 * @param   string        $name      The target attribute to use.
 * @param   array|string  $attribs   Attributes to be added to the `<iframe>` element
 * @param   string        $noFrames  The message to display if the iframe tag is not supported.
 *
 * @return  string
 *
 * @since   1.5
 */
public static function iframe($url, $name, $attribs = null, $noFrames = '')
{
    if (\is_array($attribs)) {
        $attribs = ArrayHelper::toString($attribs);
    }
    return '<iframe src="' . $url . '" ' . $attribs . ' name="' . $name . '">' . $noFrames . '</iframe>';
}