Skip to content

Instantly share code, notes, and snippets.

@simekadam
Created November 29, 2010 20:20
Show Gist options
  • Save simekadam/720543 to your computer and use it in GitHub Desktop.
Save simekadam/720543 to your computer and use it in GitHub Desktop.
<?php
use Nette\Application\Presenter;
abstract class BasePresenter extends Presenter{
//put your code here
public $oldLayoutMode = FALSE;
public function beforeRender() {
$this->template->menuItems = array(
'Domů' => 'Default',
'Nabízíme' => 'Offer',
'O Firmě' => 'About',
'Napište nám' => 'Contact',
);
$this->template->slidingItems = array(
'AAA' => 'ahoj',
'BB' => '#',
'CCA' => '#',
'DDA' => '#',
);
}
}
<?php
use Nette\Debug,
Nette\Application\Route,
Nette\Environment,
Nette\Application\SimpleRouter,
Nette\Framework,
Nette\Application\Presenter;
require LIBS_DIR . '/Nette/loader.php';
Debug::enable();
Environment::loadConfig();
$session = Environment::getSession();
$session->setSavePath(APP_DIR . '/sessions/');
$application = Environment::getApplication();
//$application->errorPresenter = 'Error';
//$application->catchExceptions = TRUE;
$router = $application->getRouter();
$router[] = new Route('index.php', array(
'presenter' => 'default',
'action' => 'default',
), Route::ONE_WAY);
$router[] = new Route('<presenter>/<action>/<id>', array(
'presenter' => 'default',
'action' => 'default',
'id' => NULL,
));
$application->run();
{foreach $menuItems as $menuItem => $link}
<div class="menu1">
{if $menuItem == "Nabízíme"}
<a href="{plink $link}">{$menuItem}<img alt="" src="./images/sipicka.png" border="none"/></a>
<div class="vysouvaci">
{foreach $slidingItems as $vslidingItem => $slidingLink}
<div class="submenu">
<a href="{$slidingLink}">{$slidingItem}</a>
</div>
{/foreach}
</div>
{else}
<a href="{plink $link}">{$menuItem}</a>
{/if}
</div>
{/foreach}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment