60 lines
1.4 KiB
PHP
60 lines
1.4 KiB
PHP
<?php
|
|
|
|
use Joomla\CMS\Toolbar\ToolbarHelper;
|
|
use Joomla\CMS\MVC\View\HtmlView;
|
|
|
|
// No direct access.
|
|
defined('_JEXEC') or die;
|
|
|
|
JLoader::register("ClubsControllerClub", JPATH_ROOT . "/administrator/components/com_clubs/controllers/club.php");
|
|
|
|
class ClubsViewTest extends HtmlView
|
|
{
|
|
function display($tpl = null)
|
|
{
|
|
ToolbarHelper::title('Test');
|
|
|
|
$this->log = '';
|
|
|
|
$factory = new CommonClubsModelFactoryClub();
|
|
$this->clubs = $factory->loadElements();
|
|
|
|
$this->club = $this->clubs[0];
|
|
|
|
// $c = $factory->loadById(1);
|
|
// $p = $c->getPresident();
|
|
// $id = $p->getId();
|
|
|
|
// $places = $c->getPlaces();
|
|
// // $places[0]->setName("abc");
|
|
// // $places[0]->save();
|
|
|
|
// $pfactory = new CommonClubsModelFactoryPlace();
|
|
// $np = $pfactory->createNew();
|
|
// $np->setName('MyName');
|
|
// $np->setClub($c);
|
|
// // $np->save();
|
|
// $np->getId();
|
|
|
|
// $np = $c->getPlaces()[2];
|
|
// $np->getName();
|
|
// // $np->setName('foo2 with new Name');
|
|
// // $np->save();
|
|
// // $np->delete();
|
|
// $this->log = $np;
|
|
|
|
parent::display($tpl);
|
|
}
|
|
|
|
protected function getViewName()
|
|
{
|
|
return 'club';
|
|
}
|
|
protected function getElementController()
|
|
{
|
|
return new ClubsControllerClub();
|
|
}
|
|
|
|
|
|
}
|