- md5
- 3d9bddc1ce70b077f9225b93c7bb03e1
- sha1
- ceaa83497a6fd7dd7b19801c4b82fad6a1cae11f
- sha256
- cbc0d840973d4d80ac86e51e45d22fba049f54b197786a68b773485ef4c558ac
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
<?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\Form\Field;
defined('JPATH_PLATFORM') or die;
/**
* Form Field class for the Joomla Platform.
* Implements a combo box field.
*
* @since 1.7.0
*/
class ComboField extends ListField
{
/**
* The form field type.
*
* @var string
* @since 1.7.0
*/
protected $type = 'Combo';
/**
* Name of the layout being used to render the field
*
* @var string
* @since 3.8.0
*/
protected $layout = 'joomla.form.field.combo';
/**
* Method to get the field input markup for a combo box field.
*
* @return string The field input markup.
*
* @since 1.7.0
*/
protected function getInput()
{
if (empty($this->layout))
{
throw new \UnexpectedValueException(sprintf('%s has no layout assigned.', $this->name));
}
return $this->getRenderer($this->layout)->render($this->getLayoutData());
}
/**
* Method to get the data to be passed to the layout for rendering.
*
* @return array
*
* @since 3.8.0
*/
protected function getLayoutData()
{
$data = parent::getLayoutData();
// Get the field options.
$options = $this->getOptions();
$extraData = array(
'options' => $options,
);
return array_merge($data, $extraData);
}
}
The same content is in 4 releases, Joomla 4.0.0-alpha8 to 4.0.0-alpha11. See them all, or every version of this file.