From 78e8cbff39d6cae1f1fdc79537aa6d040731158c Mon Sep 17 00:00:00 2001 From: Laky Date: Thu, 27 Oct 2016 21:52:26 +0200 Subject: [PATCH 1/4] =?UTF-8?q?-=20fix=20chyby=20p=C5=99i=20registraci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppBundle/Entity/User.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AppBundle/Entity/User.php b/src/AppBundle/Entity/User.php index b55cf83..6384b3b 100644 --- a/src/AppBundle/Entity/User.php +++ b/src/AppBundle/Entity/User.php @@ -44,19 +44,19 @@ class User implements UserInterface /** * @var string - * @ORM\Column(type="string") + * @ORM\Column(type="string", nullable=true) */ private $firstName; /** * @var string - * @ORM\Column(type="string") + * @ORM\Column(type="string", nullable=true) */ private $lastName; /** * @var string - * @ORM\Column(type="string") + * @ORM\Column(type="string", nullable=true) */ private $phone; From 157f0ce6cd3b0589dd86c7a81da676862df65043 Mon Sep 17 00:00:00 2001 From: Laky Date: Thu, 27 Oct 2016 22:43:08 +0200 Subject: [PATCH 2/4] - faq --- app/Resources/views/base.html.twig | 3 + app/Resources/views/faq/faq.html.twig | 13 +++ app/config/services.yml | 13 +++ src/AppBundle/Controller/FaqController.php | 46 +++++++++++ src/AppBundle/Entity/Faq.php | 92 ++++++++++++++++++++++ src/AppBundle/Facade/FaqFacade.php | 27 +++++++ src/AppBundle/Repository/FaqRepository.php | 9 +++ 7 files changed, 203 insertions(+) create mode 100644 app/Resources/views/faq/faq.html.twig create mode 100644 src/AppBundle/Controller/FaqController.php create mode 100644 src/AppBundle/Entity/Faq.php create mode 100644 src/AppBundle/Facade/FaqFacade.php create mode 100644 src/AppBundle/Repository/FaqRepository.php diff --git a/app/Resources/views/base.html.twig b/app/Resources/views/base.html.twig index 4f5d87e..14cc99c 100644 --- a/app/Resources/views/base.html.twig +++ b/app/Resources/views/base.html.twig @@ -46,6 +46,9 @@
  • Domů
  • +
  • + FAQ +
  • Žádné zajímevé otázky a odpovědi

    + {% else %} + {% for faq in faqs %} +

    {{ faq.question|raw }}

    +

    {{ faq.answer|raw }}

    +
    + {% endfor %} + {% endif %} +{% endblock %} \ No newline at end of file diff --git a/app/config/services.yml b/app/config/services.yml index 59f9fb4..9e743b1 100644 --- a/app/config/services.yml +++ b/app/config/services.yml @@ -19,6 +19,10 @@ services: app.controller.user_controller: class: AppBundle\Controller\UserController autowire: true + + app.controller.faq_controller: + class: AppBundle\Controller\FaqController + autowire: true app.facade.category_facade: class: AppBundle\Facade\CategoryFacade @@ -31,11 +35,20 @@ services: app.facade.user_facade: class: AppBundle\Facade\UserFacade autowire: true + + app.facade.faq_facade: + class: AppBundle\Facade\FaqFacade + autowire: true app.repository.category_repository: class: AppBundle\Repository\CategoryRepository factory: ['@doctrine.orm.default_entity_manager', getRepository] arguments: ['AppBundle\Entity\Category'] + + app.repository.faq_repository: + class: AppBundle\Repository\FaqRepository + factory: ['@doctrine.orm.default_entity_manager', getRepository] + arguments: ['AppBundle\Entity\Faq'] app.repository.product_repository: class: AppBundle\Repository\ProductRepository diff --git a/src/AppBundle/Controller/FaqController.php b/src/AppBundle/Controller/FaqController.php new file mode 100644 index 0000000..63af5db --- /dev/null +++ b/src/AppBundle/Controller/FaqController.php @@ -0,0 +1,46 @@ +faqFacade = $faqFacade; + $this->userFacade = $userFacade; + } + + /** + * @Route("/faq", name="faq") + * @Template("faq/faq.html.twig") + */ + public function faqAction() + { + $faqs = $this->faqFacade->getAll(); + + return [ + "faqs" => $faqs, + "user" => $this->userFacade->getUser(), + ]; + } + +} diff --git a/src/AppBundle/Entity/Faq.php b/src/AppBundle/Entity/Faq.php new file mode 100644 index 0000000..4e3eea9 --- /dev/null +++ b/src/AppBundle/Entity/Faq.php @@ -0,0 +1,92 @@ +id; + } + + /** + * Set question + * + * @param string $question + * + * @return Faq + */ + public function setQuestion($question) + { + $this->question = $question; + + return $this; + } + + /** + * Get question + * + * @return string + */ + public function getQuestion() + { + return $this->question; + } + + /** + * Set answer + * + * @param string $answer + * + * @return Faq + */ + public function setAnswer($answer) + { + $this->answer = $answer; + + return $this; + } + + /** + * Get answer + * + * @return string + */ + public function getAnswer() + { + return $this->answer; + } +} diff --git a/src/AppBundle/Facade/FaqFacade.php b/src/AppBundle/Facade/FaqFacade.php new file mode 100644 index 0000000..811d4fe --- /dev/null +++ b/src/AppBundle/Facade/FaqFacade.php @@ -0,0 +1,27 @@ +faqRepository = $faqRepository; + } + + public function getAll() + { + return $this->faqRepository->findBy( + [], [ + "question" => "asc" + ] + ); + } + +} diff --git a/src/AppBundle/Repository/FaqRepository.php b/src/AppBundle/Repository/FaqRepository.php new file mode 100644 index 0000000..a9a4e18 --- /dev/null +++ b/src/AppBundle/Repository/FaqRepository.php @@ -0,0 +1,9 @@ + Date: Fri, 28 Oct 2016 22:49:56 +0200 Subject: [PATCH 3/4] - kontaktni formular --- app/Resources/views/base.html.twig | 3 + app/Resources/views/contact/contact.html.twig | 12 + app/config/services.yml | 13 ++ .../Controller/ContactController.php | 63 +++++ src/AppBundle/Entity/ContactMsg.php | 218 ++++++++++++++++++ src/AppBundle/Entity/User.php | 1 - src/AppBundle/Facade/ContactFacade.php | 26 +++ src/AppBundle/FormType/ContactFormType.php | 51 ++++ .../Repository/ContactMsgRepository.php | 9 + 9 files changed, 395 insertions(+), 1 deletion(-) create mode 100644 app/Resources/views/contact/contact.html.twig create mode 100644 src/AppBundle/Controller/ContactController.php create mode 100644 src/AppBundle/Entity/ContactMsg.php create mode 100644 src/AppBundle/Facade/ContactFacade.php create mode 100644 src/AppBundle/FormType/ContactFormType.php create mode 100644 src/AppBundle/Repository/ContactMsgRepository.php diff --git a/app/Resources/views/base.html.twig b/app/Resources/views/base.html.twig index 14cc99c..940e10f 100644 --- a/app/Resources/views/base.html.twig +++ b/app/Resources/views/base.html.twig @@ -49,6 +49,9 @@
  • FAQ
  • +
  • + Kontakty +