Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /***************************************************************
- * Copyright notice
- *
- * (c) 2011 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
- *
- * All rights reserved
- *
- * This script is part of the TYPO3 project. The TYPO3 project is
- * free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * The GNU General Public License can be found at
- * http://www.gnu.org/copyleft/gpl.html.
- *
- * This script is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
- /**
- * This class contains some usefull viewhelpers
- *
- * @package TYPO3
- * @subpackage Fluid
- * @version
- */
- class Tx_In2university_ViewHelpers_ImplodeViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
- /**
- * Generates list from array
- *
- * @param array Any Object with some objects for an Implode
- * @param string Field name - title for getTitle()
- * @param string Glue sign - like ", "
- * @return string Imploded List
- */
- public function render($array, $field, $glue) {
- $string = '';
- foreach ($array as $object) {
- $string .= $object->{'get' . ucfirst($field)}();
- $string .= $glue;
- }
- return substr($string, 0, (-1 * strlen($glue)));
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement