Created
November 29, 2010 20:20
-
-
Save simekadam/720543 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' => '#', | |
); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{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