Skip to content
Snippets Groups Projects
AccessArrayViewHelper.php 624 B
Newer Older
<?php

namespace SGalinski\TypoScriptReferenceFrontend\ViewHelpers;

use TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper;

/**
 * Class AccessArrayViewHelper renders value of the specified array at the specified index position.
 *
 * @package SGalinski\TypoScriptReferenceFrontend\ViewHelpers
 */
class AccessArrayViewHelper extends AbstractViewHelper {
	/**
	 * Renders content of $array's element with index $index
	 *
	 * @param array $array
	 * @param string|int $index
damjan's avatar
damjan committed
	 * @return string
damjan's avatar
damjan committed
	public function render($array, $index) {
		if (gettype($array) !== 'array') {
			return '';
		}