Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. string 'The class 'AppBundleEntityPractice_Words' was not found in the
  2. chain configured namespaces ' (length=93)
  3.  
  4. <?php
  5.  
  6. namespace AppBundleController;
  7.  
  8. use SensioBundleFrameworkExtraBundleConfigurationRoute;
  9. use SymfonyBundleFrameworkBundleControllerController;
  10. use SymfonyComponentHttpFoundationRequest;
  11. use AppBundleEntityPractice_Words;
  12.  
  13. class DefaultController extends Controller
  14. {
  15. /**
  16. * @Route("/", name="homepage")
  17. */
  18.  
  19.  
  20. public function indexAction()
  21. {
  22.  
  23. $practiceWords = new Practice_Words();
  24. $practiceWords->setEnglishWord("kind");
  25. $practiceWords->setPolishWord("rodzaj");
  26.  
  27. $em = $this->getDoctrine()->getManager();
  28.  
  29. try{
  30. $em->persist($practiceWords);
  31. $em->flush();
  32. }catch(Exception $e) {
  33. var_dump($e->getMessage());
  34. }
  35.  
  36. return $this->render('AppBundle:Default:index.html.twig');
  37. }
  38. }
  39.  
  40. <?php
  41.  
  42. namespace AppBundleEntity;
  43.  
  44. /**
  45. * Practice_Words
  46. */
  47. class Practice_Words
  48. {
  49. /**
  50. * @var int
  51. */
  52. private $id;
  53.  
  54. /**
  55. * @var string
  56. */
  57. private $englishWord;
  58.  
  59. /**
  60. * @var string
  61. */
  62. private $polishWord;
  63.  
  64. /**
  65. * Get id
  66. *
  67. * @return int
  68. */
  69. public function getId()
  70. {
  71. return $this->id;
  72. }
  73.  
  74. /**
  75. * Set englishWord
  76. *
  77. * @param string $englishWord
  78. *
  79. * @return Practice_Words
  80. */
  81.  
  82. public function setEnglishWord($englishWord)
  83. {
  84. $this->englishWord = $englishWord;
  85.  
  86. return $this;
  87. }
  88.  
  89. /**
  90. * Get englishWord
  91. *
  92. * @return string
  93. */
  94. public function getEnglishWord()
  95. {
  96. return $this->englishWord;
  97. }
  98.  
  99. /**
  100. * Set polishWord
  101. *
  102. * @param string $polishWord
  103. *
  104. * @return Practice_Words
  105. */
  106. public function setPolishWord($polishWord)
  107. {
  108. $this->polishWord = $polishWord;
  109.  
  110. return $this;
  111. }
  112.  
  113. /**
  114. * Get polishWord
  115. *
  116. * @return string
  117. */
  118. public function getPolishWord()
  119. {
  120. return $this->polishWord;
  121. }
  122.  
  123. imports:
  124. - { resource: parameters.yml }
  125. - { resource: security.yml }
  126. - { resource: services.yml }
  127.  
  128. # Put parameters here that don't need to change on each machine where
  129. the app is deployed
  130.  
  131. # http://symfony.com/doc/current/best_practices
  132. /configuration.html#application-related-configuration
  133. parameters:
  134. locale: en
  135.  
  136. framework:
  137. #esi: ~
  138. #translator: { fallbacks: ["%locale%"] }
  139. secret: "%secret%"
  140. router:
  141. resource: "%kernel.root_dir%/config/routing.yml"
  142. strict_requirements: ~
  143. form: ~
  144. csrf_protection: ~
  145. validation: { enable_annotations: true }
  146. #serializer: { enable_annotations: true }
  147. templating:
  148. engines: ['twig']
  149. #assets_version: SomeVersionScheme
  150. default_locale: "%locale%"
  151. trusted_hosts: ~
  152. trusted_proxies: ~
  153. session:
  154. # http://symfony.com/doc/current/reference/configuration/framework.html#handler-id
  155. handler_id: session.handler.native_file
  156. save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%"
  157. fragments: ~
  158. http_method_override: true
  159. assets: ~
  160.  
  161. # Twig Configuration
  162. twig:
  163. debug: "%kernel.debug%"
  164. strict_variables: "%kernel.debug%"
  165.  
  166.  
  167.  
  168. # Doctrine Configuration
  169. doctrine:
  170. dbal:
  171. driver: pdo_mysql
  172. host: "%database_host%"
  173. port: "%database_port%"
  174. dbname: "%database_name%"
  175. user: "%database_user%"
  176. password: "%database_password%"
  177. charset: UTF8
  178. # if using pdo_sqlite as your database driver:
  179. # 1. add the path in parameters.yml
  180. # e.g. database_path: "%kernel.root_dir%/data/data.db3"
  181. # 2. Uncomment database_path in parameters.yml.dist
  182. # 3. Uncomment next line:
  183. # path: "%database_path%"
  184.  
  185. orm:
  186. auto_generate_proxy_classes: "%kernel.debug%"
  187. naming_strategy: doctrine.orm.naming_strategy.underscore
  188. auto_mapping: true
  189.  
  190. # Swiftmailer Configuration
  191. swiftmailer:
  192. transport: "%mailer_transport%"
  193. host: "%mailer_host%"
  194. username: "%mailer_user%"
  195. password: "%mailer_password%"
  196. spool: { type: memory }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement