Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony] Many-to-many backend
Daniel_K
post
Post #1





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 25.11.2010

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


Witam serdecznie!

Od 2 dni mam pewien problem i nie mogę sobie z nim poradzić. Wygenerowałem panel administracyjny na podstawie bazy danych. W bazie występują miedzy innymi tabele blogArticle i tag, w relacji wiele do wielu. Za pomocą pluginu sfFormExtraPlugin chciałbym wykorzystać DoubleList w formularzu blogArticle, ale niestety nic nie działa... macie pomysł lub wskazówki jak to ogarnąć? Zaznaczam że Korzystam z symfony 1.4 + doctrine. Fragment bazy:

  1. blogArticle:
  2. tableName: blog_articles
  3. COLUMNS:
  4. id_blog_article:
  5. type: integer(4)
  6. PRIMARY: true
  7. notnull: true
  8. autoincrement: true
  9. title:
  10. type: string(150)
  11. notnull: true
  12. descriptions:
  13. type: string(5000)
  14. notnull: true
  15. date:
  16. type: date
  17. notnull: true
  18. author:
  19. type: string(60)
  20. notnull: true
  21.  
  22. tag:
  23. tableName: tags
  24. COLUMNS:
  25. id_tags:
  26. type: integer(4)
  27. PRIMARY: true
  28. notnull: true
  29. autoincrement: true
  30. name:
  31. type: string(60)
  32. notnull: true
  33.  
  34. TagBlogArticle:
  35. tableName: tags_has_blog_articles
  36. COLUMNS:
  37. id_tags:
  38. type: integer(4)
  39. PRIMARY: true
  40. notnull: true
  41. id_blog_article:
  42. type: integer(4)
  43. PRIMARY: true
  44. notnull: true
  45. relations:
  46. idTag:
  47. class: tag
  48. LOCAL: id_tags
  49. FOREIGN: id_tags
  50. foreignAlias: tags_has_blog_articles
  51. idBlogArticle:
  52. class: blogArticle
  53. LOCAL: id_blog_article
  54. FOREIGN: id_blog_article
  55. foreignAlias: tags_has_blog_articles
  56. indexes:
  57. fk_tags_has_blog_articles_blog_articles1:
  58. FIELDS: [id_blog_article]
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
destroyerr
post
Post #2





Grupa: Zarejestrowani
Postów: 879
Pomógł: 189
Dołączył: 14.06.2006
Skąd: Bytom

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


Co znaczy, że nie działa? Jakie pojawiają się błędy? Nie wiemy co zrobiłeś a czego nie zrobiłeś.
Go to the top of the page
+Quote Post
Daniel_K
post
Post #3





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 25.11.2010

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


w formie Articles mam:

  1. class blogArticleForm extends BaseblogArticleForm
  2. {
  3. public function configure()
  4. {
  5. $this->widgetSchema['idTags_list']->setOption('renderer_class', 'sfWidgetFormSelectDoubleList');
  6. }
  7. }


po czym w wyniku dostaje:

  1. Fatal error: Call to a member function setOption() on a non-object in C:\xampp\htdocs\company\lib\form\doctrine\blogArticleForm.class.php on line 15


może coś mam źle ze schema.yml... tyle że on generowany jest workbencha... jakaś podpowiedz?
Go to the top of the page
+Quote Post
Pawel-ad
post
Post #4





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 11.10.2011

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


Sprobuj tak:

Kod
$this->setWidget('idTags_list', new sfWidgetFormSelectDoubleList());


Ten post edytował Pawel-ad 11.10.2011, 23:12:32
Go to the top of the page
+Quote Post
Daniel_K
post
Post #5





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 25.11.2010

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


Kurcze no tez nie działa... a jest jakieś inne podejście w symfony 1.4 do administracji tabelami z relacjami M:M?
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 - 21:23