Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [inne] Symfony2 - : Call to a member function addResource() on a non-object in
Pi0tR
post
Post #1





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 25.07.2014

Ostrzeżenie: (0%)
-----


Witam Symfony2 wyrzuca mi następujący bład



Fatal error: Call to a member function addResource() on a non-object in /virtual/2_mikrobit/2006/_http/www/pomocpw.dev.mbnet.pl/mPomoc/trunk/vendor/symfony/symfony/src/Symfony/Component/Routing/Loader/PhpFileLoader.php on line 48

podejrzewam ze bład tkwi gdzies tutaj lecz nie potrafie go zlokalizowac

  1. <?php
  2. namespace Mb\TaskBundle\Form\Task;
  3.  
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\FormBuilderInterface;
  6. use Symfony\Component\OptionsResolver\OptionsResolverInterface;
  7.  
  8. class TaskType extends TaskType
  9. {
  10. private $request;
  11.  
  12. public function __construct($request) {
  13. $this->request = $request;
  14. }
  15.  
  16. public function buildForm(FormBuilderInterface $builder, array $options)
  17. {
  18. $builder->add('title', 'text', array('label' => 'Tytuł', 'required' => true));
  19. $builder->add('alias', 'text', array('label' => 'Alias', 'required' => true));
  20. $builder->add('isActive', 'checkbox', array('label' => 'Status', 'required' => false));
  21. $builder->add('text', 'textarea', array('label' => 'Treść', 'required' => true));
  22. $builder->add('submit', 'submit')
  23. ->add('reset', 'reset');
  24. }
  25. public function setDefaultOptions(OptionsResolverInterface $resolver)
  26. {
  27. $resolver->setDefaults(array(
  28. 'data_class' => 'Mb\TaskBundle\Entity\Task',
  29. 'validation_groups' => array('task'),
  30. 'context' => ''
  31. ));
  32. }
  33. public function getName()
  34. {
  35. return 'mb_task';
  36. }
  37. }
  38.  
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
semafor1985
post
Post #2





Grupa: Zarejestrowani
Postów: 61
Pomógł: 3
Dołączył: 18.10.2012
Skąd: Zagłębie Dąbrowskie

Ostrzeżenie: (0%)
-----


Po pierwsze masz błąd w dziedziczeniu.
Po drugie to chyba nie tu.
Go to the top of the page
+Quote Post
Pi0tR
post
Post #3





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 25.07.2014

Ostrzeżenie: (0%)
-----


problem roziwazanay
brakowało poprostu w encji pola alias

oraz zamiast
  1. class TaskType extends TaskType

powinno byc
  1. class TaskType extends AbstraktType


Ten post edytował Pi0tR 29.07.2014, 11:51:32
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 02:53