symfony-3.2

SYMFONY3 in prod look for TWIG template in wrong folder instead of custom bundle indicated in routing.yml and AppKernel.php

故事扮演 提交于 2019-12-12 06:05:22
问题 I am implementing a SYMFONY 3 project in production mode for the first time. I follow OceanDigital tutorial and the standard doc. I went thru a bunch of issues linked to user writing rights that I've solved, and I do get now a SYMFONY ERROR page (one step closer to victory) with this message: Unable to find template "MyBundle:std_page:home.html.twig" (looked into: /[folder to symf project]/app/Resources/views, /[folder to symf project]/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources

FOSUserBundle ignore password field

巧了我就是萌 提交于 2019-12-12 04:33:53
问题 So I'm using the FOSUserBundle with LDAP as my authentication method, and I'm wondering whether there is a way to remove/ignore the password field for my FOSUser entity? I realize removal might not be ideal (in case it messes with internal logic), but the column is never used, and I'm forced to fill it when I'm creating FOSUsers from fixtures: $user = new FOSUser(); $user->setDn($item["dn"]); $user->setEnabled(1); $user->setUsername($item["samaccountname"][0]); $user->setUsernameCanonical

How do I specify default values in a Symfony form

随声附和 提交于 2019-12-11 15:18:56
问题 I am trying to specify a default value in a form so when creating an entity the form field has a value (not null or empty). However when the entity is being edited it should obviously show the stored value and not the default. My entity initializes itself as part of the construction - so when an entity is new and not yet persisted these values should be set. How do I inform the FormType to use the default value over the persisted state? Everything I try seems to suggest it's one or the other

Implementation for configureRoute() of AnnotationClassLoader

。_饼干妹妹 提交于 2019-12-11 06:11:03
问题 In my Symfony 3.2 app, I create a custom router that extends from Symfony\Bundle\FrameworkBundle\Routing\Router . As required, it implements a getRouteCollection() method: public function getRouteCollection() { $locator = new FileLocator(__DIR__ . '/../Controller'); $annotationReader = new Doctrine\Common\Annotations\AnnotationReader(); $classLoader = new AnnotationClassLoader($annotationReader); $routeLoader = new Symfony\Component\Routing\Loader\AnnotationDirectoryLoader($locator,

Get current logged in user in entity

爱⌒轻易说出口 提交于 2019-12-08 06:25:54
问题 I want to create some virtual properties for an entity in an n:m relation. I have an User , an Achievment and an AchievementUser entity. The value an user have in an Achievement is stored in the field value in the entity AchievementUser . User -------- 1:n -------- AchievementUser -------- n:1 -------- Achievement name:String value:Integer name:String [...] [...] Now I want to return the value an user have in an achievement with the achievement itself. So I need a virtual property and a

FOS/user-bundle ProxyManager\Configuration error

大城市里の小女人 提交于 2019-12-07 23:01:38
问题 After installation of friendsofsymfony/user-bundle I getting this error FatalThrowableError in Configuration.php line 124: Type error: Return value of ProxyManager\Configuration::setGeneratorStrategy() must be an instance of ProxyManager\void, none returned Using Symfony3.2 and PHP 7.1 Maybe have ideas why? EDIT I used This tut https://symfony.com/doc/master/bundles/FOSUserBundle/index.html And choose "Doctrine ORM User class" for user entity 回答1: This is because you are using the incorrect

Connection to a db with Doctrine pdo_sqlsrv

隐身守侯 提交于 2019-12-07 16:02:27
I'm trying to connect to my database in SQL Server 2000, but i get an error could not find driver when i'm using pdo_sqlsrv. But if i use sqlsrv i get an error Attempted to call function "sqlsrv_configure" from namespace "Doctrine\DBAL\Driver\SQLSrv". Here is my config.yml config.yml doctrine: dbal: default_connection: default connections: default: dbname: "%database_name%" user: "%database_user%" password: "%database_password%" host: "%database_host%" driver: pdo_mysql charset: utf8mb4 default_table_options: charset: utf8mb4 collate: utf8mb4_unicode_ci connection2: dbname: "%database_name2%"

Notice: Undefined property: DOMDocument::$documentElement

你离开我真会死。 提交于 2019-12-06 08:06:50
问题 I recently re-opened an old (1 year) Symfony project and I am having an error on every page (I don't remember having this issue a year ago) : [exception] 500 | Internal Server Error | Symfony\Component\Config\Exception\FileLoaderLoadException /var/www/[...]/wdt.xml ContextErrorException: Notice: Undefined property: DOMDocument::$documentElement If I clear the cache, the error disappear but as soon as I edit and save a file, the error is showing up again. The project was using Symfony 2.8 and

Notice: Undefined property: DOMDocument::$documentElement

≡放荡痞女 提交于 2019-12-04 12:20:31
I recently re-opened an old (1 year) Symfony project and I am having an error on every page (I don't remember having this issue a year ago) : [exception] 500 | Internal Server Error | Symfony\Component\Config\Exception\FileLoaderLoadException /var/www/[...]/wdt.xml ContextErrorException: Notice: Undefined property: DOMDocument::$documentElement If I clear the cache, the error disappear but as soon as I edit and save a file, the error is showing up again. The project was using Symfony 2.8 and I updated to Symfony 3.2 but it didn't solve the issue. I don't think the problem is related to the wdt

Symfony 3.2 A circular reference has been detected (configured limit: 1)

百般思念 提交于 2019-11-30 08:43:33
I have this two entities in my project class PoliceGroupe { /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string * * @ORM\Column(name="code", type="string", length=50) */ private $code; /** * @ORM\ManyToMany(targetEntity="PointVente", inversedBy="policegroupe") * @ORM\JoinTable(name="police_groupe_point_vente", * joinColumns={@ORM\JoinColumn(name="police_groupe_id", referencedColumnName="id")}, * inverseJoinColumns={@ORM\JoinColumn(name="point_vente_id", referencedColumnName="id")} * ) */ private