Skip to content

Commit

Permalink
updating nette
Browse files Browse the repository at this point in the history
  • Loading branch information
Spamercz committed Jun 27, 2017
1 parent 6fd4694 commit 1aaa857
Show file tree
Hide file tree
Showing 129 changed files with 1,782 additions and 56 deletions.
21 changes: 0 additions & 21 deletions App/Bootstrap.php

This file was deleted.

20 changes: 10 additions & 10 deletions App/Router/routeFactory.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?php
namespace App;

use Nette;
use Nette\Application\Routers\RouteList;
use Nette\Application\Routers\Route;
namespace App\Router;


class RouterFactory
{
/**
* @return Nette\Application\IRouter
*/
public static function createRouter()

public static function createRouter() : \Nette\Application\IRouter
{
$router = new RouteList;
$router = new \Nette\Application\Routers\RouteList();

$router[] = new Route('<module>/<presenter>[/<action>][/<id>]', 'Front:Homepage:default');
$router[] = new \Nette\Application\Routers\Route('<module>/<presenter>[/<action>][/<id>]', [
'model' => 'Front',
'presenter' => 'Homepage',
'action' => 'default',
]);

return $router;
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

namespace App\FrontModule\Presenters;

use Nette;

class HomepagePresenter extends Nette\Application\UI\Presenter
class HomepagePresenter extends \Nette\Application\UI\Presenter
{
public function actionDefault()
{

}


public function renderDefault()
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

namespace App\FrontModule\Presenters;

use App;
use Nette;

class LoginPresenter extends Nette\Application\UI\Presenter
class LoginPresenter extends \Nette\Application\UI\Presenter
{

/** @var App\FrontModule\Model\User\LoginService @inject */
/**
* @var \App\FrontModule\Model\User\LoginService @inject
*/
public $loginService;


public function actionDefault()
{

Expand All @@ -23,9 +24,9 @@ public function renderDefault()
}


protected function createComponentLoginForm()
protected function createComponentLoginForm() : \Nette\Application\UI\Form
{
$form = new Nette\Application\UI\Form();
$form = new \Nette\Application\UI\Form();

$form->addText('nickname', 'Nickname')
->setRequired();
Expand All @@ -41,7 +42,7 @@ protected function createComponentLoginForm()
}


public function processLogin(Nette\Application\UI\Form $form)
public function processLogin(\Nette\Application\UI\Form $form)
{
$values = $form->getValues();

Expand All @@ -54,8 +55,8 @@ public function processLogin(Nette\Application\UI\Form $form)

$this->redirect(':Game:InnerVillage:default');

} catch (Nette\Security\AuthenticationException $e) {
} catch (\Nette\Security\AuthenticationException $e) {
$this->flashMessage($e->getMessage(), 'red');
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

namespace App\FrontModule\Presenters;

use App;
use Nette;

class RegisterPresenter extends Nette\Application\UI\Presenter
class RegisterPresenter extends \Nette\Application\UI\Presenter
{
/** @var App\FrontModule\Model\User\UserModel @inject */
/**
* @var \App\FrontModule\Model\User\UserModel @inject
*/
public $userModel;

/** @var App\FrontModule\Model\User\RegisterService @inject */
/**
* @var \App\FrontModule\Model\User\RegisterService @inject
*/
public $registerService;

public function actionDefault()
Expand All @@ -24,9 +26,10 @@ public function renderDefault()

}


protected function createComponentRegisterForm()
{
$form = new Nette\Application\UI\Form();
$form = new \Nette\Application\UI\Form();

$form->addText('nickname', 'Nickname')
->setRequired();
Expand Down Expand Up @@ -65,7 +68,7 @@ protected function createComponentRegisterForm()
}


public function processRegistration(Nette\Application\UI\Form $form)
public function processRegistration(\Nette\Application\UI\Form $form)
{
$values = $form->getValues();

Expand All @@ -79,4 +82,4 @@ public function processRegistration(Nette\Application\UI\Form $form)

$this->redirect(':Front:Login:default');
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 6 additions & 2 deletions App/Model/BaseModel.php → app/Model/BaseModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@

abstract class BaseModel
{
/** @var string */
/**
* @var string
*/
protected $table;

/** @var Dibi\Connection */
/**
* @var Dibi\Connection
*/
protected $database;


Expand Down
21 changes: 21 additions & 0 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

require_once __DIR__ . '/../vendor/autoload.php';

$configurator = new \Nette\Configurator;
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->enableDebugger(__DIR__ . '/../log');

$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/install.neon');

if (file_exists(__DIR__ . '/config/local.neon')) {
$configurator->addConfig(__DIR__ . '/config/local.neon');

} else {
$configurator->addConfig(__DIR__ . '/config/default.neon');
}

$configurator->setDebugMode(TRUE);

return $configurator->createContainer();
2 changes: 1 addition & 1 deletion App/Config/config.neon → app/config/config.neon
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ session:


services:
router: App\RouterFactory::createRouter
router: App\Router\RouterFactory::createRouter

latte.latteFactory:
setup:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 10 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@
],
"require": {
"dibi/dibi": "^3.0",
"tracy/tracy": "^2.3",
"nette/nette": "^2.3",
"nette/nette": "^2.4",
"kdyby/clock": "^0.3.0",
"kdyby/console": "^2.5"
},
"autoload": {
"psr-4": {
"App\\": "app/"
}
},
"config": {
"optimize-autoloader": true,
"classmap-authoritative": true
}
}
Loading

0 comments on commit 1aaa857

Please sign in to comment.