跳至主要内容

博文

目前显示的是标签为“symfony 2 bundles”的博文

get or set parameter in controller

$email_address = $this->container->getParameter('email_address'); If we don’t want to use the config.yml file and want to set your own parameter through a bundle controller or service you can set a parameter using: $this->container->setParameter('email_address', 'someone.else@anybody.com');

symfony2 reverse engineering when use multi database connection

如果symfony2使用multi database的话,那么从database 生成entity就需要选择我们使用的connection,这个命令可以使我们选择我们需要的connection: php app/console doctrine:mapping:convert yml ./src/MyCo/Base/ MyBundle/Resources/config/doctrine/metadata/orm --from-database --force  --em=commun 这里的commun是自定义的connection

Unrecognized field: usernameCanonical for symfony2 FosUserbundle

I got this error when try to login to my system. I searched in internet and find this could be caused by several problems, of cause if your configuration is the following: orm: auto_generate_proxy_classes: %kernel.debug% default_entity_manager: italy entity_managers: italy: connection: italy mappings: MobMindsCoreBundle: ~ FOSUserBundle: ~ metadata_cache_driver: apc query_cache_driver: apc result_cache_driver: type: memcache host: %memcache_host% port: %memcache_port% instance_class: Memcache class: Doctrine\Common\Cache\MemcacheCache world: connection: world mappings: MobMindsCoreBundle: ~ FOSUserBundle: ~ metadata_cache_driver: apc query_cache_driver: apc result_cache_driver: type: memcache host: %memcache_host%...