symfony-2.1

Symfony 2.1 Session Local Value and Master Value (read on phpinfo)

帅比萌擦擦* 提交于 2019-12-13 17:18:12
问题 I'm having problems with sessions when i sarted migration from symfony 2.0 to symfony 2.1. I'm using simplesamlphp for authentication and everything was working ok on symfony 2.0. On Symfony 2.1 it is NOT OK. I checked the diferences between them on phpinfo->session and this what i got: symfony2.1 symfony 2.0 Master Value session.save_handler user files files session.save_path (..)/symproject/app (..)/wamp/tmp (..)/wamp/tmp /cache/dev/sessions This values must be equal to php.ini since

How can i put condition in doctrine query builder

谁说胖子不能爱 提交于 2019-12-12 15:58:37
问题 I have this query $qb->select('u') ->from('UserBundle:User', 'u') ->where('u.location = :identifier') ->orderBy('u.firstName', 'ASC') ->setParameter('identifier', 2); I want that if $identifier is present then it should filter the results otherwise i get all the results like $qb->select('u') ->from('UserBundle:User', 'u') if($identifier) ->where('u.location = :identifier') ->orderBy('u.firstName', 'ASC') if($identifier) ->setParameter('identifier', 2); Is it possible 回答1: It is possible, you

Impossible to generate the table “user”

余生颓废 提交于 2019-12-12 11:48:04
问题 When I install FOSUserBundle (official documentation), I try to generate my table fos_user using this command: php app/console doctrine:schema:update --force But console returns the following message Nothing to update - your database is already in sync with the current entity metadata I use Symfony 2.1 and the last version to FOSUserBundle. app/AppKernel.php contains new FOS\UserBundle\FOSUserBundle(), app/config/config.yml contains fos_user: db_driver: orm # other valid values are 'mongodb',

doctrine2: undefined index - many-to-one with non default referencedColumnName does not persist entity

和自甴很熟 提交于 2019-12-12 10:59:12
问题 I'm using Symfony 2.1.2. I have two entities and define a [many-to-one (bidirectional)] (1) association between them. I don't want to use the primary key for the foreign key (referencedColumnName). I want to use another integer unique column: customer_no /** * @ORM\Entity * @ORM\Table(name="t_myuser") */ class MyUser extends BaseEntity // provides an id (pk) { /** * @ORM\ManyToOne(targetEntity="Customer", inversedBy="user") * @ORM\JoinColumn(name="customer_no", referencedColumnName="customer

Symfony2 FOSUserBundle not setting authenticated user to session?

放肆的年华 提交于 2019-12-12 10:16:09
问题 I have a very basic Symfony2.1 setup with FOSUserBundle installed. When registering all is well and I am redirected to my target path and the debug bar shows that I am authenticated as myself. When logging in however, submitting the form with bad creds will reflect as such, but if I login with the correct creds, I get redirected to my target path but I'm still anon, so authentication is successful but not persisted in the session. Am I missing something? I have followed the basic

set role for users in edit form of sonata admin

微笑、不失礼 提交于 2019-12-12 09:46:25
问题 I'm using Symfony 2.1 for a project. I use the FOSUserBundle for managing users & SonataAdminBundle for administration usage. I have some questions about that: As an admin, I want to set roles from users in users edit form. How can I have access to roles in role_hierarchy ? And how can I use them as choice fields so the admin can set roles to users? When I show roles in a list, it is shown as string like this: [0 => ROLE_SUPER_ADMIN] [1 => ROLE_USER] How can I change it to this? ROLE_SUPER

RegistrationFormType::buildForm() not compatible

杀马特。学长 韩版系。学妹 提交于 2019-12-12 08:07:16
问题 I just upgrade my Symfony 2.0.12 project to 2.1. I also installed FosUserBundle, but when I run command php composer.phar update then composer output an error: Loading composer repositories with package information Updating dependencies Writing lock file Generating autoload files PHP Fatal error: Declaration of User\UserBundle\Form\Type\RegistrationFormType::buildForm() must be compatible with that of Symfony\Component\Form\FormTypeInterface::buildForm() in /home/mark/dev/proj/src/User

Symfony2 : access files in folder outside web

戏子无情 提交于 2019-12-12 05:29:26
问题 I have a page in symfony2 with a java applet and javascript functions that make the java applet load files. These files are user-dependant and each file has to be stored in the user folder. Users have their folder in a directory located at the root of the symfony folder (/temp/). Now i need the files in these folders to be available (like an asset?). // Controler ( What i have now ) $filepath = $this->get('kernel')->getRootDir().'/../temp/'.$userfolder; // View ( what i would like -using twig

Capifony failed reinstalling vendors with Symfony2.1

余生颓废 提交于 2019-12-12 02:18:09
问题 I'm trying to deploy a Symfony2.1 project with Capifony2.1.14 and it failed when reinstalling vendors . Configuration: I'm on Mac OSX Montain Lion (client) and have a server on servergrove.com witch is on Ubuntu 12.04.1 LTS. My deploy.rb file looks like this: set :application, "DOA Manager Toshiba" set :domain, "root@server.me" set :deploy_to, "/var/www/vhosts/server.me" set :app_path, "app" set :user, "root" set :use_sudo, false set :repository, "git://github.com/****/****.git" set :scm,

Default Symfony User Entity with Form Class

£可爱£侵袭症+ 提交于 2019-12-11 16:47:08
问题 I wish to create A Form class for my Login form that uses the Default Symfony User class. I folowed the book here: http://symfony.com/doc/current/book/security.html#using-a-traditional-login-form Now i wish to turn that html intoa Form class wich i did: use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class LoginForm extends AbstractType { public function buildForm(FormBuilderInterface