Back to PopupButton class

Method fetchButton

public string
fetchButton
(mixed $type = 'Modal', mixed $name = '', mixed $text = '', mixed $url = '', mixed $iframeWidth = 640, mixed $iframeHeight = 480, mixed $bodyHeight = null, mixed $modalWidth = null, mixed $onClose = '', mixed $title = '', mixed $footer = null)
Fetch the HTML for the button
Parameters
  • string $type Unused string, formerly button type.
  • string $name Modal name, used to generate element ID
  • string $text The link text
  • string $url URL for popup
  • int $iframeWidth Width of popup
  • int $iframeHeight Height of popup
  • int $bodyHeight Optional height of the modal body in viewport units (vh)
  • int $modalWidth Optional width of the modal in viewport units (vh)
  • string $onClose JavaScript for the onClose event.
  • string $title The title text
  • string $footer The footer html
Returns
  • string HTML string for the button
Since
  • 3.0
Class: PopupButton
Project: Joomla

Method fetchButton - Source code

/**
 * Fetch the HTML for the button
 *
 * @param   string   $type          Unused string, formerly button type.
 * @param   string   $name          Modal name, used to generate element ID
 * @param   string   $text          The link text
 * @param   string   $url           URL for popup
 * @param   integer  $iframeWidth   Width of popup
 * @param   integer  $iframeHeight  Height of popup
 * @param   integer  $bodyHeight    Optional height of the modal body in viewport units (vh)
 * @param   integer  $modalWidth    Optional width of the modal in viewport units (vh)
 * @param   string   $onClose       JavaScript for the onClose event.
 * @param   string   $title         The title text
 * @param   string   $footer        The footer html
 *
 * @return  string  HTML string for the button
 *
 * @since   3.0
 */
public function fetchButton($type = 'Modal', $name = '', $text = '', $url = '', $iframeWidth = 640, $iframeHeight = 480, $bodyHeight = null, $modalWidth = null, $onClose = '', $title = '', $footer = null)
{
    $this->name($name)->text($text)->task($this->_getCommand($url))->url($url)->icon('icon-' . $name)->iframeWidth($iframeWidth)->iframeHeight($iframeHeight)->bodyHeight($bodyHeight)->modalWidth($modalWidth)->onclose($onClose)->title($title)->footer($footer);
    return $this->renderButton($this->options);
}