<?php
/**
 * @package     SP Soccer
 * @author      JoomShaper http://www.joomshaper.com
 * @copyright   Copyright (C) 2010 - 2016 JoomShaper. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die('Restricted access');

class SpsoccerViewPlayers extends FOFViewForm{

	public function display($tpl = null){
		// Get model
		$model = $this->getModel();
		$this->items = $model->getItemList();

		foreach ($this->items as &$this->item) {
			$this->item->position 	= $model->getPositionByID($this->item->spsoccer_possition_id)->title;
			$this->item->url 		= JRoute::_('index.php?option=com_spsoccer&view=player&id=' . $this->item->spsoccer_player_id . ':' . $this->item->slug . SpsoccerHelper::getItemid('players'));
			$this->item->image 		= SpsoccerHelper::hasImg($this->item->image);
		}

		return parent::display($tpl = null);
	}


}
