core-bundle/src/Resources/contao/widgets/ListWizard.php
public function generate()
	{
		$arrButtons = array('copy', 'delete', 'drag');

		// Make sure there is at least an empty array
		if (empty($this->varValue) || !\is_array($this->varValue))
		{
			$this->varValue = array('');
		}

		// Initialize the tab index
		if (!Cache::has('tabindex'))
		{
			Cache::set('tabindex', 1);
		}

		$return = '<ul id="ctrl_'.$this->strId.'" class="tl_listwizard">';

		// Add input fields
		for ($i=0, $c=\count($this->varValue); $i<$c; $i++)
		{
			$return .= '
    <li><input type="text" name="'.$this->strId.'[]" class="tl_text" value="'.StringUtil::specialchars($this->varValue[$i]).'"' . $this->getAttributes() . '> ';

			// Add buttons
			foreach ($arrButtons as $button)
			{
				if ($button == 'drag')
				{
					$return .= ' <button type="button" class="drag-handle" title="' . StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['move']) . '" aria-hidden="true">' . Image::getHtml('drag.svg') . '</button>';
				}
				else
				{
					$return .= ' <button type="button" data-command="' . $button . '" title="' . StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['lw_'.$button]) . '">' . Image::getHtml($button.'.svg') . '</button>';
				}
			}

			$return .= '</li>';
		}

		return $return.'
  </ul>
  <script>Backend.listWizard("ctrl_'.$this->strId.'")</script>';
	}
public function generate()
	{
		$arrButtons = array('copy', 'delete', 'drag');

		// Make sure there is at least an empty array
		if (empty($this->varValue) || !\is_array($this->varValue))
		{
			$this->varValue = array('');
		}

		// Initialize the tab index
		if (!Cache::has('tabindex'))
		{
			Cache::set('tabindex', 1);
		}

		$return = '<ul id="ctrl_'.$this->strId.'" class="tl_listwizard">';

		// Add input fields
		for ($i=0, $c=\count($this->varValue); $i<$c; $i++)
		{
			$return .= '
    <li><input type="text" name="'.$this->strId.'[]" class="tl_text" value="'.StringUtil::specialchars($this->varValue[$i]).'"' . $this->getAttributes() . '> ';

			// Add buttons
			foreach ($arrButtons as $button)
			{
				if ($button == 'drag')
				{
					$return .= ' <button type="button" class="drag-handle" title="' . StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['move']) . '" aria-hidden="true">' . Image::getHtml('drag.svg') . '</button>';
				}
				else
				{
					$return .= ' <button type="button" data-command="' . $button . '" title="' . StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['lw_'.$button]) . '">' . Image::getHtml($button.'.svg') . '</button>';
				}
			}

			$return .= '</li>';
		}

		return $return.'
  </ul>
  <script>Backend.listWizard("ctrl_'.$this->strId.'")</script>';
	}
public function generate ( ) { $ arrButtons = array ( 'copy' , 'delete' , 'drag' ) ; // Make sure there is at least an empty array if ( empty ( $ this -> varValue ) || ! \ is_array ( $ this -> varValue ) ) { $ this -> varValue = array ( '' ) ; } // Initialize the tab index if ( ! Cache :: has ( 'tabindex' ) ) { Cache :: set ( 'tabindex' , 1 ) ; } $ return = '<ul id="ctrl_' . $ this -> strId . '" class="tl_listwizard">' ; // Add input fields for ( $ i = 0 , $ c = \ count ( $ this -> varValue ) ; $ i < $ c ; $ i ++ ) { $ return .= '
    <li><input type="text" name="' . $ this -> strId . '[]" class="tl_text" value="' . StringUtil :: specialchars ( $ this -> varValue [ $ i ] ) . '"' . $ this -> getAttributes ( ) . '> ' ; // Add buttons foreach ( $ arrButtons as $ button ) { if ( $ button == 'drag' ) { $ return .= ' <button type="button" class="drag-handle" title="' . StringUtil :: specialchars ( $ GLOBALS [ 'TL_LANG' ] [ 'MSC' ] [ 'move' ] ) . '" aria-hidden="true">' . Image :: getHtml ( 'drag.svg' ) . '</button>' ; } else { $ return .= ' <button type="button" data-command="' . $ button . '" title="' . StringUtil :: specialchars ( $ GLOBALS [ 'TL_LANG' ] [ 'MSC' ] [ 'lw_' . $ button ] ) . '">' . Image :: getHtml ( $ button . '.svg' ) . '</button>' ; } } $ return .= '</li>' ; } return $ return . '
  </ul>
  <script>Backend.listWizard("ctrl_' . $ this -> strId . '")</script>' ; }
Generate the widget and return it as string

@return string
Generate the widget and return it as string