Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [Symfony2][Symfony][SF2]Twitter bootstrap, problem z filtrami
pabito
post 10.07.2014, 19:24:37
Post #1





Grupa: Zarejestrowani
Postów: 77
Pomógł: 4
Dołączył: 14.05.2013

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


Cześć,
Chciałem zainstalować twitter boostrap, aby móc je wykorzystać w projekcie.
Mam taki prosty widok testowy.
  1. {% extends '::base.html.twig' %}
  2. {% block body %}
  3. {{ 'Success'|label('success') }}
  4. {% endblock %}


Gdy uruchamiam controller dostaje taki oto błąd:
The filter "label" does not exist in LingogoAdminBundle:PartOfSpeech:index.html.twig at line 5

Tak wygląda moj plik base.html.twig
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <meta charset="utf-8">
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <meta name="description" content="">
  7. <meta name="author" content="">
  8. <link rel="shortcut icon" href="../../assets/ico/favicon.ico">
  9.  
  10. <title>Starter Template for Bootstrap</title>
  11.  
  12. <!-- Bootstrap core CSS -->
  13. {% stylesheets
  14. '../vendor/twbs/bootstrap/dist/css/bootstrap.min.css'
  15. %}
  16. <link href="{{ asset_url }}" rel="stylesheet">
  17. {% endstylesheets %}
  18.  
  19. <!--[if lt IE 9]>
  20. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  21. <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  22. <![endif]-->
  23. </head>
  24.  
  25.  
  26.  
  27. <div class="container">
  28. {% block body %}{% endblock %}
  29.  
  30. </div><!-- /.container -->
  31.  
  32.  
  33. <!-- Bootstrap core JavaScript
  34. ================================================== -->
  35. <!-- Placed at the end of the document so the pages load faster -->
  36. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  37.  
  38. </body>
  39. </html>


tak wygląda plik config.yml
  1. imports:
  2. - { resource: parameters.yml }
  3. - { resource: security.yml }
  4.  
  5. framework:
  6. #esi: ~
  7. translator: { fallback: "%locale%" }
  8. secret: "%secret%"
  9. router:
  10. resource: "%kernel.root_dir%/config/routing.yml"
  11. strict_requirements: ~
  12. form: ~
  13. csrf_protection: ~
  14. validation: { enable_annotations: true }
  15. templating:
  16. engines: ['twig']
  17. #assets_version: SomeVersionScheme
  18. default_locale: "%locale%"
  19. trusted_hosts: ~
  20. trusted_proxies: ~
  21. session:
  22. # handler_id set to null will use default session handler from php.ini
  23. handler_id: ~
  24. fragments: ~
  25. http_method_override: true
  26.  
  27. # Twig Configuration
  28. twig:
  29. debug: "%kernel.debug%"
  30. strict_variables: "%kernel.debug%"
  31.  
  32. # Assetic Configuration
  33. assetic:
  34. debug: "%kernel.debug%"
  35. use_controller: false
  36. bundles: [ ]
  37. #java: /usr/bin/java
  38. filters:
  39. cssrewrite: ~
  40. #closure:
  41. # jar: "%kernel.root_dir%/Resources/java/compiler.jar"
  42. #yui_css:
  43. # jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"
  44. lessphp:
  45. file: %kernel.root_dir%/../vendor/leafo/lessphp/lessc.inc.php
  46. apply_to: "\.less$"
  47. # Doctrine Configuration
  48. doctrine:
  49. dbal:
  50. driver: "%database_driver%"
  51. host: "%database_host%"
  52. port: "%database_port%"
  53. dbname: "%database_name%"
  54. user: "%database_user%"
  55. password: "%database_password%"
  56. charset: UTF8
  57. # if using pdo_sqlite as your database driver, add the path in parameters.yml
  58. # e.g. database_path: "%kernel.root_dir%/data/data.db3"
  59. # path: "%database_path%"
  60.  
  61. orm:
  62. auto_generate_proxy_classes: "%kernel.debug%"
  63. auto_mapping: true
  64.  
  65. # Swiftmailer Configuration
  66. swiftmailer:
  67. transport: "%mailer_transport%"
  68. host: "%mailer_host%"
  69. username: "%mailer_user%"
  70. password: "%mailer_password%"
  71. spool: { type: memory }
  72.  
  73. hwi_oauth:
  74. resource_owners:
  75. any_name:
  76. type: facebook
  77. client_id: <client_id>
  78. client_secret: <client_secret>
  79. twitter_provider:
  80. type: twitter
  81. client_id: <consumer-key>
  82. client_secret: <consumer-secret>
  83. # name of the firewall in which this bundle is active, this setting MUST be set
  84. firewall_name: secured_area
  85.  
  86. services:
  87. my.oauth_aware.user_provider.service:
  88. class: HWI\Bundle\OAuthBundle\Security\Core\User\FOSUBUserProvider
  89. arguments:
  90. userManager: "@fos_user.user_manager"
  91. properties: ["pass properties as array"]
  92.  
  93. fos_user:
  94. db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
  95. firewall_name: main
  96. user_class: Acme\DemoBundle\Entity\User
  97.  
  98. braincrafted_bootstrap:
  99. less_filter: lessphp


Męcze się z tym już drugi dzień i już nie mam pomysłów co może być nie tak.
Całość kodu można zobaczyć na https://bitbucket.org/pbrzoski/lingogo/
Go to the top of the page
+Quote Post
skowron-line
post 10.07.2014, 20:01:42
Post #2





Grupa: Zarejestrowani
Postów: 4 340
Pomógł: 542
Dołączył: 15.01.2006
Skąd: Olsztyn/Warszawa

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


blad mowi o tym ze nie masz twigowego filtra
http://symfony.com/doc/current/cookbook/te..._extension.html


--------------------
I'm so fast that last night I turned off the light switch in my hotel room and was in bed before the room was dark - Muhammad Ali.
Peg jeżeli chcesz uprawiać sex to dzieci muszą wyjść, a jeżeli chcesz żeby był dobry ty też musisz wyjść - Al Bundy.

QueryBuilder, Mootools.net, bbcradio1::MistaJam
http://www.phpbench.com/
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 Wersja Lo-Fi Aktualny czas: 28.04.2024 - 08:53