-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added example, sources moved to srr/
- Loading branch information
castamir
committed
Feb 6, 2014
1 parent
566046e
commit a628358
Showing
30 changed files
with
1,092 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,6 @@ | |
}, | ||
"license": "LGPL-3.0", | ||
"autoload": { | ||
"classmap": ["Joseki"] | ||
"classmap": ["src"] | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
temp/cache* |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Order Allow,Deny | ||
Deny from all |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
require __DIR__ . '/shortcuts.php'; | ||
require __DIR__ . '/../../libs/autoload.php'; | ||
|
||
$configurator = new Nette\Configurator; | ||
|
||
$configurator->enableDebugger(__DIR__ . '/../log'); | ||
|
||
$configurator->setTempDirectory(__DIR__ . '/../temp'); | ||
|
||
$configurator->createRobotLoader() | ||
->addDirectory(__DIR__) | ||
->register(); | ||
|
||
$configurator->addConfig(__DIR__ . '/config/config.neon'); | ||
$configurator->addConfig(__DIR__ . '/config/config.local.neon'); | ||
|
||
$container = $configurator->createContainer(); | ||
|
||
return $container; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
parameters: | ||
|
||
nette: |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# SECURITY WARNING: it is CRITICAL that this file & directory are NOT accessible directly via a web browser! | ||
# | ||
# If you don't protect this directory from direct web access, anybody will be able to see your passwords. | ||
# http://nette.org/security-warning | ||
# | ||
parameters: | ||
|
||
|
||
php: | ||
date.timezone: Europe/Prague | ||
# zlib.output_compression: yes | ||
|
||
|
||
nette: | ||
application: | ||
errorPresenter: Error | ||
mapping: | ||
*: App\*Module\*Presenter | ||
|
||
session: | ||
expiration: 14 days | ||
|
||
|
||
services: | ||
- App\RouterFactory | ||
router: @App\RouterFactory::createRouter |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Nette; | ||
|
||
/** | ||
* Base presenter for all application presenters. | ||
*/ | ||
abstract class BasePresenter extends Nette\Application\UI\Presenter | ||
{ | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Joseki\Application\Responses\PdfResponse; | ||
|
||
/** | ||
* Homepage presenter. | ||
*/ | ||
class HomepagePresenter extends BasePresenter | ||
{ | ||
public function actionPdf() | ||
{ | ||
$template = $this->createTemplate()->setFile(__DIR__ . "/../templates/Homepage/default.latte"); | ||
|
||
$pdf = new PdfResponse($template); | ||
|
||
$pdf->setSaveMode(PdfResponse::INLINE); | ||
|
||
$this->sendResponse($pdf); | ||
} | ||
} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Nette, | ||
Nette\Application\Routers\RouteList, | ||
Nette\Application\Routers\Route; | ||
|
||
|
||
/** | ||
* Router factory. | ||
*/ | ||
class RouterFactory | ||
{ | ||
|
||
/** | ||
* @return \Nette\Application\IRouter | ||
*/ | ||
public function createRouter() | ||
{ | ||
$router = new RouteList(); | ||
$router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default'); | ||
return $router; | ||
} | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
use Nette\Diagnostics\Debugger; | ||
|
||
|
||
/** | ||
* @return Nette\Callback | ||
*/ | ||
function callback($callback, $m = NULL) | ||
{ | ||
return new Nette\Callback($callback, $m); | ||
} | ||
|
||
|
||
/** | ||
* Nette\Diagnostics\Debugger::dump() shortcut. | ||
*/ | ||
function dump($var) | ||
{ | ||
foreach (func_get_args() as $arg) { | ||
Debugger::dump($arg); | ||
} | ||
return $var; | ||
} | ||
|
||
|
||
/** | ||
* Nette\Diagnostics\Debugger::log() shortcut. | ||
*/ | ||
function dlog($var = NULL) | ||
{ | ||
if (func_num_args() === 0) { | ||
Debugger::log(new Exception, 'dlog'); | ||
} | ||
foreach (func_get_args() as $arg) { | ||
Debugger::log($arg, 'dlog'); | ||
} | ||
return $var; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{** | ||
* My Application layout template. | ||
* | ||
* @param string $basePath web base path | ||
* @param string $robots tell robots how to index the content of a page (optional) | ||
* @param array $flashes flash messages | ||
*} | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="description" content=""> | ||
<meta name="robots" content="{$robots}" n:ifset="$robots"> | ||
|
||
<title>{block title|striptags|upper}Nette Application Skeleton{/block}</title> | ||
|
||
<link rel="stylesheet" media="screen,projection,tv" href="{$basePath}/css/screen.css"> | ||
<link rel="stylesheet" media="print" href="{$basePath}/css/print.css"> | ||
<link rel="shortcut icon" href="{$basePath}/favicon.ico"> | ||
{block head}{/block} | ||
</head> | ||
|
||
<body> | ||
<script> document.documentElement.className+=' js' </script> | ||
|
||
<div n:foreach="$flashes as $flash" class="flash {$flash->type}">{$flash->message}</div> | ||
|
||
{include content} | ||
|
||
{block scripts}{/block} | ||
</body> | ||
</html> |
Oops, something went wrong.