Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [Symfony] Many-to-many backend
Forum PHP.pl > Forum > PHP > Frameworki
Daniel_K
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]
destroyerr
Co znaczy, że nie działa? Jakie pojawiają się błędy? Nie wiemy co zrobiłeś a czego nie zrobiłeś.
Daniel_K
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?
Pawel-ad
Sprobuj tak:

Kod
$this->setWidget('idTags_list', new sfWidgetFormSelectDoubleList());
Daniel_K
Kurcze no tez nie działa... a jest jakieś inne podejście w symfony 1.4 do administracji tabelami z relacjami M:M?
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.