Advertisement
djuro95

Bundles

Feb 22nd, 2019
541
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.82 KB | None | 0 0
  1. bundles
  2.  
  3. create your own bundle
  4.  
  5. php bin/console generate:bundle
  6. 1.enter
  7. 2.name of bundle : CarBundle
  8. 3. lokacija na koju smjestamo bundle => default (enter)
  9. 4. enter
  10.  
  11. ------------------------
  12.  
  13. third part bundle
  14.  
  15. composer require knplabs/knp-menu-bundle dev-master
  16.  
  17.  
  18. =>
  19.  
  20. in AppKernel
  21.  
  22. $bundles = array(
  23. ...............
  24. new \Knp\Bundle\MenuBundle\KnpMenuBundle()
  25. );
  26.  
  27. -------------------------
  28. https://symfony.com/doc/current/bundles/FOSUserBundle/index.html
  29.  
  30. FOSUserBundle
  31.  
  32. php app/console fos:user:create codereview
  33.  
  34. security.yml
  35.  
  36.  
  37. role_hierarchy:
  38. ROLE_ADMIN: ROLE_USER
  39. ROLE_SUPER_ADMIN: ROLE_ADMIN
  40.  
  41. app/console fos:user:promote codereview ROLE_ADMIN
  42. app/console fos:user:demote codereview ROLE_ADMIN
  43. app/console fos:user:promote codereview --super
  44.  
  45. -------------------------------------
  46. KnpPaginatorBundle
  47.  
  48. https://github.com/KnpLabs/KnpPaginatorBundle
  49.  
  50. composer require knplabs/knp-paginator-bundle
  51.  
  52. da bi dobili klasu koristimo
  53.  
  54. dump(get_class($paginator))
  55.  
  56. zati stavljamo anotaciu klase
  57.  
  58. /**
  59. * @var $paginator \Knp\Component\Pager\Paginator
  60. */
  61.  
  62. ***********
  63. $paginator = $this->get('knp-paginator');
  64. $paginator -> paginate(
  65. $list,
  66. $request->query->getInt('page', 1),
  67. $request->query->getInt('limit', 5)
  68. );
  69. **************
  70. in twig
  71.  
  72. <div class="navigation text-center">
  73. {{ knp_pagination_render(pagination) }}
  74. </div>
  75.  
  76.  
  77. ---------------------------
  78. StofDoctrineExtensionsBundle
  79.  
  80. -Omogucuje integraciju za DoctrineExtensions
  81.  
  82. Karakteristike:
  83. *Tree - dodatne funkcionalnosti nad repoitorijumom (closure, nestedset or materialized path)
  84. *Translatable - rijesenje za prevodjenje na razlicite stane jezike
  85. *Sluggable - urlizes vasa polja u jedinstven slug (token)
  86. *Timestampable - azurira polja datuma za kreiranje, azuriranje i promjenu svojstava
  87. *Blameable - azurira nazive ili polja na kreiranje, azuriranje ili promjenu svojstava sa korisnickim imenom resp. reference
  88. *Loggable - pomaze u pracenju promjena i istorije objekata, takodje podrzava upravljanje verzijama
  89. *Sortable - sortita bilo koji dokument ili entitet
  90. *Translator - eksplicitan nacin obrade prevoda
  91. *Softdeleteable - omogucava ekslicitnoimplicitno
  92. *Uploadable - omogucava rukovanjem ucitavanjem datoteka u poljima entiteta
  93. *Reference Integrity - obezbjedjuje referentni integritet za MongoDB, podrzava nullify i ogranicavanje
  94.  
  95.  
  96. https://symfony.com/doc/master/bundles/StofDoctrineExtensionsBundle/index.html
  97. https://symfony.com/doc/master/bundles/StofDoctrineExtensionsBundle/installation.html#installation-without-symfony-flex
  98.  
  99. composer require stof/doctrine-extensions-bundle
  100.  
  101. ------------------------------------------
  102. KnpTimeBundle
  103. https://github.com/KnpLabs/KnpTimeBundle
  104.  
  105. *ovaj bundle uzima datume i daje poruke tima "2 sata ranije"
  106.  
  107. composer require knplabs/knp-time-bundle
  108.  
  109.  
  110.  
  111.  
  112. -------------------------
  113. LexikFormFilterBundle
  114.  
  115. koristi se za filtriranje entiteta u formama
  116.  
  117. https://github.com/lexik/LexikFormFilterBundle
  118.  
  119. *koristi se za izgradnju nekih tipova formi posvecenih filtriranju entiteta
  120. *prvo se kreira tip forme kao ekstenzija Symfony\Component\Form\AbstractType
  121. *dodaju se polja forme koristeci providet filter type - TextFilterType::class instead of a TextType::class type
  122. *zatim se poziva servis da napravi upit iz instance forme i izvrsi svoj upit da biste dobili svoj rezultat
  123. *u stvari mozemo da koristimo bilo koju filter klasu ali moramo da napravimo svoju listener classu da primeni filter za ovaj tip
  124.  
  125. ----------------------
  126.  
  127. LiipImagineBundle
  128.  
  129. manipulacije sa slikama
  130.  
  131. https://symfony.com/doc/2.0/bundles/LiipImagineBundle/index.html
  132.  
  133. -----------------------------------
  134.  
  135. VichUploaderBundle
  136.  
  137. uploading slika dokumenata ...
  138.  
  139. https://symfony.com/doc/master/bundles/EasyAdminBundle/integration/vichuploaderbundle.html
  140.  
  141. https://www.youtube.com/watch?v=JyB33vyJxAk
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement