<?php

namespace App\Presenters;

use App\Forms\GeneratorFormFactory;
use Nette;
use App\Forms\SignFormFactory;
use App\Model;


class HomepagePresenter extends BasePresenter
{

	public function actionDefault()
	{
		/*
		if($this->user->isLoggedIn())
		{
			// p�esm�rovat na aktu�ln� vypl�ov�n�
			$this->redirect('First:');
		}*/
		
	}


	/** @var SignFormFactory @inject */
	public $factory;
	

	
	
	/**
	 * Sign-in form factory.
	 * @return Nette\Application\UI\Form
	 */
	protected function createComponentSignInForm()
	{
		$form = $this->factory->create();
		$form->onSuccess[] = function ($form) {
			$form->getPresenter()->redirect('First:');
		};
		return $form;
	}

	public function renderTop()
	{
		
	}
	
}
