Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Vývojáři sobě: 0. sraz - PHP: Appka v Symfony

149 views

Published on

Dennis Fridrich ukázal, jak udělat TodoMVC na PHP frameworku Nette.

Záznam k prezentaci lze najít zde: https://youtu.be/d1VMfAxW92c

  • Be the first to comment

  • Be the first to like this

Vývojáři sobě: 0. sraz - PHP: Appka v Symfony

  1. 1. TodoMVC v Symfony github.com/VyvojariSobe/TodoMvcPhp-Symfony
  2. 2. Dennis Fridrich github.com/dfridrich
  3. 3. Použil jsem • PHP 7 (běží v 5.6) • Symfony 3 • Twig • Doctrine (SQLite)
  4. 4. todomvcsymfony.herokuapp.com
  5. 5. Entita ToDo • id (integer) • value (text) • isDone (boolean) • createdAt (DateTime)
  6. 6. ToDoController • index • change • remove • clearCompleted
  7. 7. ToDoType $form->add(
 'value',
 TextType::class,
 [
 'label' => false,
 'attr' => $this->data
 ? ['class' => 'edit']
 : [
 'class' => 'new-todo',
 'placeholder' => 'What needs to be done?',
 'autofocus' => 'autofocus',
 ],
 ]
 );
  8. 8. ToDoType $form = $this->get('form.factory')
 ->createNamed(
 'edit_'.$todo->getId(), 
 ToDoType::class,
 $todo
 )
  9. 9. Zkus si to composer create-project vyvojarisobe/todomvcphp-symfony
 composer setup-todos

×