Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Description of BlogPresenter
- *
- * @author Dave
- */
- use Nette\Application\UI\Form;
- use Nette\Database\Connection;
- class BlogPresenter extends BasePresenter {
- /**
- * (non-phpDoc)
- *
- * @see Nette\Application\Presenter#startup()
- */
- protected function startup() {
- parent::startup();
- }
- public function actionDefault() {
- }
- protected function createComponentSignInForm()
- {
- $form = new Form;
- $form->addText('name', 'Jmeno:')
- ->setRequired('Zadejte prosim jmeno');
- $form->addPassword('password', 'Heslo:')
- ->setRequired('Zvolte si heslo')
- ->addRule(Form::MIN_LENGTH,'Heslo musi mit 3 znaky', 3);
- $form->addSubmit('login', 'Login');
- $form->onSuccess[] = callback($this, 'signInFormSubmitted');
- return $form;
- }
- public function signInFormSubmitted($form)
- {
- // volá se po odeslání formuláře
- $values = $form->getValues();
- dump($values);
- }
- function barDump($var, $title = NULL)
- {
- Nette\Diagnostics\Debugger::barDump($var, $title);
- }
- public function renderDefault($id) {
- $this->template->promenna = "blog motherfucking post1 #" . $id;
- $dsn = "mysql:host=localhost;dbname=example";
- $user = "root";
- $password = "";
- $database = new Connection($dsn, $user, $password);
- $database->table('users');
- barDump ($database);
- // $text = $_POST['text'];
- // echo $text;
- }
- }
Add Comment
Please, Sign In to add comment