CoreFiles by mySites.guru
CustomButton.php73 lines, 1,424 bytes, from Joomla_4.0.0-alpha11-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha10
md5
afdd6b206bbf1b20cb1a50f8dab2a036
sha1
f56581ae9cc7c3d62964d2e57755c81630985b57
sha256
4920af1556c2d8afdbd990463c5bb2c1dd2d02f112a89c3fa3015ae224812f75
<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Toolbar\Button;

defined('JPATH_PLATFORM') or die;

use Joomla\CMS\Toolbar\ToolbarButton;

/**
 * Renders a custom button
 *
 * @method self html(string $value)
 * @method string getHtml()
 *
 * @since  3.0
 */
class CustomButton extends ToolbarButton
{
	/**
	 * Render button HTML.
	 *
	 * @param   array  $options  The button options.
	 *
	 * @return  string  The button HTML.
	 *
	 * @since  4.0.0
	 */
	protected function renderButton(array &$options): string
	{
		return (string) ($options['html'] ?? '');
	}

	/**
	 * Fetch the HTML for the button
	 *
	 * @param   string  $type  Button type, unused string.
	 * @param   string  $html  HTML strng for the button
	 * @param   string  $id    CSS id for the button
	 *
	 * @return  string   HTML string for the button
	 *
	 * @since   3.0
	 *
	 * @deprecated  5.0 Use render() instead.
	 */
	public function fetchButton($type = 'Custom', $html = '', $id = 'custom')
	{
		return $html;
	}

	/**
	 * Method to configure available option accessors.
	 *
	 * @return  array
	 *
	 * @since  4.0.0
	 */
	protected static function getAccessors(): array
	{
		return array_merge(
			parent::getAccessors(),
			[
				'html',
			]
		);
	}
}

No other release has this exact content. See every version of this file.