API16

JButtonLink/fetchButton: Difference between revisions

From Joomla! Documentation

m clean up
m preparing for archive only
 
Line 54: Line 54:


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=fetchButton
  category=fetchButton
  category=JButtonLink
  category=JButtonLink
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*

Latest revision as of 01:21, 25 March 2017

<! removed transcluded page call, red link never existed >

Syntax

fetchButton($type='Link', $name= 'back', $text= '', $url=null)
Parameter Name Default Value Description
$type 'Link'
$name 'back'
$text
$url null

Defined in

libraries/joomla/html/toolbar/button/link.php

Importing

jimport( 'joomla.html.toolbar.button.link' );

Source Body

public function fetchButton($type='Link', $name = 'back', $text = '', $url = null)
{
        $text   = JText::_($text);
        $class  = $this->fetchIconClass($name);
        $doTask = $this->_getCommand($url);

        $html   = "<a href=\"$doTask\">\n";
        $html .= "<span class=\"$class\">\n";
        $html .= "</span>\n";
        $html   .= "$text\n";
        $html   .= "</a>\n";

        return $html;
}


<! removed transcluded page call, red link never existed >

Examples

Code Examples