[symfony-users] Two Foreign keys refferencing same primary key

2011-02-11 Thread Ali
HI Guys i am new to symfony and i have a simple data model. There is a Team model and Match model , and a match is played by two teams i want to store the date and venue which is another Model Venue my schema is as follows Team: actAs: { Timestampable: ~ } columns: title: { type: string(

[symfony-users] [symfony2] init:bundle

2011-02-11 Thread wickass
I just created an new bundle using the console init:bundle command. Works like a charm for setting up a skeleton structure for a new bundle, however I noticed that in the config/ folder it only generated a routing.xml no .php and no .yml. Is there a setting somewhere where I can specify which form

[symfony-users] [Symfony2] - Choicefield empty_value

2011-02-11 Thread jdewit
empty_value doesn't seem to work in for choiceField. in choicefield.php protected function initializeChoices() { if (!$this->choices) { $this->choices = $this->getInitializedChoices(); if (!$this->isRequired()) { $this->choices = array(''

Re: [symfony-users] [symfony2] - entity manager in forms

2011-02-11 Thread jdewit
This fixed it. Property needed to be assigned. $this->add(new EntityChoiceField('salesRep', array( 'em' => $em, 'class' => 'Sensio\HelloBundle\Entity\User', 'property' => 'firstName', 'query_builder' => function ($repository) { return $reposit

Re: [symfony-users] [symfony2] - entity manager in forms

2011-02-11 Thread jdewit
Ok. The choice field shows up, but that's it. It doesn't populate with my data and it causes the form fields after it to disappear. Here's the attempt... namespace Sensio\HelloBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\HelloBundle\Form\JobForm; use

[symfony-users] [Symonfy2] Simple form seems never valid, no error messages?

2011-02-11 Thread Frenck
Hi, I've got a small little issue with Symfony2 PR6. I'm trying to create a small and simple form. Input is an barcode (entered by a barcode scanner). The form does not generate any error's. It's display, I can submit it, but nothing happens. I've added an simple else{} statement with an echo "IN

[symfony-users] Re: Logging security events (syslog)

2011-02-11 Thread Manfred Dohmen
> What is a "security event" for you? http://docs.symfony-reloaded.org/guides/security/authentication.html When I use form based authentication the user only gets redirected to my custom SecurityController if he is not authenticated. The actual authentication following a form post gets triggered

Re: [symfony-users] [symfony2] - entity manager in forms

2011-02-11 Thread Christophe COEVOET
Le 11/02/2011 20:30, jdewit a écrit : I'm trying to use the entityToIdTransformer in a form so I can populate a choiceField dynamically. Here's my code. namespace Sensio\HelloBundle\Form; use Symfony\Component\Form\Form; use Symfony\Bundle\DoctrineBundle\Form\ValueTransformer\EntityToIDTrans

[symfony-users] [symfony2] - entity manager in forms

2011-02-11 Thread jdewit
I'm trying to use the entityToIdTransformer in a form so I can populate a choiceField dynamically. Here's my code. namespace Sensio\HelloBundle\Form; use Symfony\Component\Form\Form; use Symfony\Bundle\DoctrineBundle\Form\ValueTransformer\EntityToIDTransformer; use Symfony\Component\Form\Choic

[symfony-users] [Symfony2] - entity manager in forms

2011-02-11 Thread jdewit
I'm trying to use the entityToIdTransformer in a form so I can populate a choiceField dynamically. Here's my code. namespace Sensio\HelloBundle\Form; use Symfony\Component\Form\Form; use Symfony\Bundle\DoctrineBundle\Form\ValueTransformer\EntityToIDTransformer; use Symfony\Component\Form\Choic

Re: [symfony-users] Updating existing project (Newbie to symfony)

2011-02-11 Thread Alex Pilon
Do what you would do if this was a normal php app. Check the apache logs and then return with a question about what is in there if that doesn't lead you to the solution. On Fri, Feb 11, 2011 at 10:45, stof wrote: > On Thu, 10 Feb 2011 15:27:53 -0430, Amador Antonio Cuenca > wrote: > > Hi all, I

[symfony-users] [Symfony2] How are you would divide your website on Applications and Bundles?

2011-02-11 Thread Nikita Korotaev
HI everyone, Screening through the presentations from the San-Francisco conference http://www.symfony-project.org/blog/2011/02/10/symfony-live-san-francisco-day-2 there were a few slides that suggesting you to how to divide you website on Applications and Bundles. They mention that it is bette

Re: [symfony-users] Creating database SQL and Class Entities from a yaml file

2011-02-11 Thread stof
On Fri, 11 Feb 2011 11:34:23 -0500, Tac Tacelosky wrote: > Any suggestions for a video tutorial or a step by step "Here's how to get a > table in MySQL into a sf2 model using doctrine2". I see where it says > things like "MyBundle", but I'm still not sure if that's supposed to be a > directory or

Re: [symfony-users] Creating database SQL and Class Entities from a yaml file

2011-02-11 Thread Tac Tacelosky
Any suggestions for a video tutorial or a step by step "Here's how to get a table in MySQL into a sf2 model using doctrine2". I see where it says things like "MyBundle", but I'm still not sure if that's supposed to be a directory or what. Again, sorry for the newbie question! The propel stuff is

Re: [symfony-users] Creating database SQL and Class Entities from a yaml file

2011-02-11 Thread stof
On Fri, 11 Feb 2011 11:11:11 -0500, Tac Tacelosky wrote: > This is a newbie question, but I've read the page at > > http://docs.symfony-reloaded.org/guides/doctrine/orm/console.html > > several times and I'm missing some of the basic steps in getting from YAML > to the set of Base / Peer classes

[symfony-users] Creating database SQL and Class Entities from a yaml file

2011-02-11 Thread Tac Tacelosky
This is a newbie question, but I've read the page at http://docs.symfony-reloaded.org/guides/doctrine/orm/console.html several times and I'm missing some of the basic steps in getting from YAML to the set of Base / Peer classes. I want to generate the MySQL schema from a yaml file, what command

Re: [symfony-users] Re: How to check if a file exist before uploading it ?

2011-02-11 Thread Informations
Hi Lionel, Anything common with Patrice Fristot ? .. - Original Message - From: Lionel Fristot To: Symfony users Sent: Thursday, February 10, 2011 12:33 PM Subject: [symfony-users] Re: How to check if a file exist before uploading it ? Maybe you can try the post-validato

Re: [symfony-users] Re: Logging security events (syslog)

2011-02-11 Thread Johannes Schmitt
What is a "security event" for you? Kind regards, Johannes On Fri, Feb 11, 2011 at 8:14 AM, Manfred Dohmen wrote: > Thanks Leon, but the question relates more to how to hook into > Symfony2 in order to observe security events (and then having them > logged). > > -- > If you want to report a vul

Re: [symfony-users] Updating existing project (Newbie to symfony)

2011-02-11 Thread stof
On Thu, 10 Feb 2011 15:27:53 -0430, Amador Antonio Cuenca wrote: > Hi all, I'm a junior developer, with experience in C#, Java, Ruby and some > Scala and PHP, I've assigned to extend a existing symfony project (I've > never work with symfony). Well, Here my problem: > > I readed the quickstart an

Re: [symfony-users] Merge Form..

2011-02-11 Thread Erkhembayar Gantulga
HI, Vaibhav Rajput It think that you need to embed your UserProfile form in UserForm. In order to do that, you need to 1. In your schema: > > User: > columns: id: { type: integer, primary: true, autoincrement: true } >username: { type: string(255), notnull: true, unique: true } >

[symfony-users] Shared Hostmonster: error Mime/type & custom Tasks for cronjob. Please help!

2011-02-11 Thread Diego
(sorry my english) Hi, i have a full working Symfony 1.4 Doctrine Project, in my localhost. Ubuntu 10.10 php 5.3.3 I uploaded it to my hostmonster on a subdomain, it works almost fine but I have some issues like * Symfony do not recognize a task class so the command line at a cronjob: php /home1

[symfony-users] Updating existing project (Newbie to symfony)

2011-02-11 Thread Amador Antonio Cuenca
Hi all, I'm a junior developer, with experience in C#, Java, Ruby and some Scala and PHP, I've assigned to extend a existing symfony project (I've never work with symfony). Well, Here my problem: I readed the quickstart and I copy the project from the server to my personal computer. I've changed:

[symfony-users] Re: Logging security events (syslog)

2011-02-11 Thread Manfred Dohmen
Thanks Leon, but the question relates more to how to hook into Symfony2 in order to observe security events (and then having them logged). -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subsc

[symfony-users] How to save form data into database ?

2011-02-11 Thread Erkhembayar Gantulga
Hi guys, I've created News model and it's related form, repository. Now, I can't save my posting data into my database. code: $form->bind($this->get('request')); // If the form has been submitted and is valid... if ($form->isValid()) { $em = $this->getEm(); $

[symfony-users] Using Symfony, sfDoctrineGuardPlugin plugin, How can i customise sf_content? Using partials?

2011-02-11 Thread erman taylan
Anyone cal help me about my question below. thanks, Hi there, I am using symfony 1.4.8 with sfDoctrineGuardPlugin for my backend. My question is how can i customise sfDoctrineGuardPlugin's default content? For example, how can i do something on the page between filter and table (on the left han

Re: [symfony-users] Problem setting up authentication in symfony2

2011-02-11 Thread Klaas Naaijkens
Ok, I have set this now: security.config: encoders: Symfony\Component\Security\Core\User\User: algorithm: plaintext providers: main: users: foo: { password: foo } firewalls: main: http-basic: true and it works.

[symfony-users] Symfony Doctrine Oracle Connection problem

2011-02-11 Thread Altansuh A
Symfony 1.4.8 Doctrine Oracle not connection problem. Database.yml all: doctrine: class: sfDoctrineDatabase phptype: oci8 param: dsn: oracle:host=192.168.0.105:1521;dbname=oracle username: test password: test Error: Use of undefined constant OCI_COMMIT_ON_SUCCE

[symfony-users] Re: How to check if a file exist before uploading it ?

2011-02-11 Thread Lionel Fristot
Maybe you can try the post-validator way : #Add something like that in your Form class protected function checkFile() { $file = $this->getValue('file');//your file input name $dir = $this->getValue('choosen_upload_dir'); if // check if file exists // throw an error (or

[symfony-users] Re: Problem setting up authentication in symfony2

2011-02-11 Thread Frenck
Try it with this in your config first: encoders: Symfony\Component\Security\Core\User\AccountInterface: algorithm: plaintext And work from there... ../Frenck On 10 feb, 05:26, Klaas Naaijkens wrote: > Hi, I am struggling with the security system in symfony2 for about a > day now.

Re: [symfony-users] Re: Problem setting up authentication in symfony2

2011-02-11 Thread Klaas Naaijkens
Justin, is this with PR6 or the latest symfony version from git? On Thu, Feb 10, 2011 at 2:44 PM, Justin Fortier wrote: > First make sure have the Bundle enabled in your AppKernel. So add this > line: > > new Symfony\Bundle\SecurityBundle\SecurityBundle(), > > > Then here's an example of my worki

[symfony-users] Sandbox PR6 - Override Twig in child template

2011-02-11 Thread LionelFristot
Hi, I'm trying to get this to work without any success : {% extends "::base.html.twig" %} {% block title %}Expediteur{% endblock %} {% block head %} {{ parent() }} {% endblock %} I'm in a bundle, "js" folder is in /web. The title block works fine but not the head block, what a

[symfony-users] Re: How to let the user choose the upload directory ?

2011-02-11 Thread Felds Liscia
I think the better way to do this is by saving the file always on a temp folder (could be the /web/uploads itself) and moving it to it's final location on the Model::save() so the model can keep track of the file's final location. If you really want to manage this process on the Form class, you co

[symfony-users] Re: Detect the environment in the template

2011-02-11 Thread Manu
Well, that was easy. :) Thanks ! -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googl

Re: [symfony-users] Detect the environment in the template

2011-02-11 Thread Michał Piotrowski
Hi, 2011/2/11 Manu : > Is it possible to detect the environment in a template file ? ? > I would like to show a warning when the user is using the production > admin, and not when he's on the development one. > > -- > If you want to report a vulnerability issue on symfony, please send it to >

[symfony-users] Detect the environment in the template

2011-02-11 Thread Manu
Is it possible to detect the environment in a template file ? I would like to show a warning when the user is using the production admin, and not when he's on the development one. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You re

Re: [symfony-users] Re: Is it possible to check the filesize of an image *before* uploading it ?

2011-02-11 Thread Stéphane
Using File API for HTML 5 it's possible. But it needs File API enabled browser (FF 4 for example). Using JS of course. Regards, Before Printing, Think about Your Environmental Responsibility! Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale! On Fri, Feb 11, 2011 at 4:07 PM, Gab

[symfony-users] Re: Is it possible to check the filesize of an image *before* uploading it ?

2011-02-11 Thread Gabriel Petchesi
Look into flash (sfWidgetFormInputSWFUploadPlugin) or java applet uploaders. Those are capable of checking the size, I don't think it's technically possible using stock browser file upload. gabriel -- If you want to report a vulnerability issue on symfony, please send it to security at sy

[symfony-users] Re: The helper "javascripts" is not defined

2011-02-11 Thread Justin Fortier
Thanks for the heads up Christophe, looking forward to it after seeing the presentation up on the blog. On Feb 10, 4:53 pm, Christophe COEVOET wrote: > Le 10/02/2011 21:32, Justin Fortier a crit : > > > Yeah this is kind of a mess. It's been taken out because it did not > > work as "intended". Or

[symfony-users] Is it possible to check the filesize of an image *before* uploading it ?

2011-02-11 Thread Manu
Is it possible to check the filesize of an image *before* uploading it ? Maybe using javascript ? -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users

Re: [symfony-users] Question about block

2011-02-11 Thread stof
On Fri, 11 Feb 2011 14:25:00 +0100, Christophe Beyer wrote: > This works great : >> {% block title %}My title - {{ parent() }}{% endblock %} > > > Nothing about this tip in the documentation, I could'nt know this. > > Thanks ! > The Twig documentation clearly says that the "parent" function e

Re: [symfony-users] Question about block

2011-02-11 Thread Christophe Beyer
This works great : > {% block title %}My title - {{ parent() }}{% endblock %} Nothing about this tip in the documentation, I could'nt know this. Thanks ! -- Christophe Le 11 févr. 2011 à 14:00, stof a écrit : > On Fri, 11 Feb 2011 13:53:00 +0100, Christophe Beyer > wrote: >> My main HTM

[symfony-users] Re: Redirect with method POST

2011-02-11 Thread Massimiliano Arione
If you need to post a page without user interaction, use sfBrowser (in sfBrowserPlugin) cheers Massimiliano -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "s

Re: [symfony-users] [PR6] Using ESI tag renders nothing

2011-02-11 Thread Christophe Beyer
Thanks, but the result is the same... :( -- Christophe Le 11 févr. 2011 à 13:50, stof a écrit : > On Fri, 11 Feb 2011 13:45:31 +0100, Christophe Beyer > wrote: >> No, I didn't modify my config file in this way. >> >> What should I add in the config file ? >> >> >> I found nothing in th

Re: [symfony-users] Question about block

2011-02-11 Thread stof
On Fri, 11 Feb 2011 13:53:00 +0100, Christophe Beyer wrote: > My main HTML layout looks like that : > > > > > /> > {% block title 'Default title - example.com' %} > > > I want to have only to write this in my controller layout : > {% block title %}My title{% endb

[symfony-users] Question about block

2011-02-11 Thread Christophe Beyer
My main HTML layout looks like that : {% block title 'Default title - example.com' %} I want to have only to write this in my controller layout : {% block title %}My title{% endblock %} instead {% block title %}My title - Default title - example.com{% endblock %} Ton re

Re: [symfony-users] [PR6] Using ESI tag renders nothing

2011-02-11 Thread stof
On Fri, 11 Feb 2011 13:45:31 +0100, Christophe Beyer wrote: > No, I didn't modify my config file in this way. > > What should I add in the config file ? > > > I found nothing in the documentation :( > Seems like the doc has not been updated on this point. Here is the config: app.config: e

Re: [symfony-users] [PR6] Using ESI tag renders nothing

2011-02-11 Thread Christophe Beyer
No, I didn't modify my config file in this way. What should I add in the config file ? I found nothing in the documentation :( -- Christophe Beyer cbe...@cap-tic.fr Le 11 févr. 2011 à 13:32, stof a écrit : > On Fri, 11 Feb 2011 13:07:49 +0100, Christophe Beyer > wrote: >> Hi, >> >> Sin

Re: [symfony-users] [PR6] Using ESI tag renders nothing

2011-02-11 Thread stof
On Fri, 11 Feb 2011 13:07:49 +0100, Christophe Beyer wrote: > Hi, > > Since PR6, my zones where I want to display content using ESI tags display > nothing. This was OK in PR5. > Did you enable the esi explicitly in your configuration file ? This is now necessary when using esi (to avoid loading

[symfony-users] [PR6] Using ESI tag renders nothing

2011-02-11 Thread Christophe Beyer
Hi, Since PR6, my zones where I want to display content using ESI tags display nothing. This was OK in PR5. -- main layout : {% render 'MyBundle:Match:cadre' with {}, { 'standalone': true} %} -- controller : $response = $this->container->get('response'); $resp

Re: [symfony-users] Re: [Symfony2] How to create Forms in PR6?

2011-02-11 Thread stof
On Fri, 11 Feb 2011 03:08:10 -0800 (PST), stfalcon wrote: > What is "$this->get('form.context')" and where it set? > This gets the service named "form.context" in the container (it is a shortcut for "$this->container->get('form.context')" in the controllers) which is set in Symfony\Bundle\Framew

[symfony-users] Re: [Symfony2] How to create Forms in PR6?

2011-02-11 Thread stfalcon
What is "$this->get('form.context')" and where it set? On 8 Лют, 20:23, Nikita Korotaev wrote: > Bernhard, thanks for your suggestion. After playing around with different > configurations, I've finally made it working. > >         // Code in controller >      $relationUserUniversity = new Relatio

Re: [symfony-users] Auto-filling caches

2011-02-11 Thread Robert Gründler
this approach could work too, but you don't know in advance which page the user clicks next, so you'd have to pre-load all currently available pages, which would lead to unnecessary server requests. The hostname thing was solved by this if anyone runs into the same problem: view_cache_manage

Re: [symfony-users] Auto-filling caches

2011-02-11 Thread Gareth McCumskey
Why not just chain ajax requests? Have two divs, one visible one invisible. Load what the person wants to see with one ajax request. When that completes it calls another ajax request which loads the next page into the invisible div. When the person goes to the next page, the act of making that page

Re: [symfony-users] Auto-filling caches

2011-02-11 Thread Robert Gründler
should have rtfm: factories.yml: view_cache_manager: param: cache_key_use_host_name: false just in case if anyone runs into the same problem... On 2/11/11 9:49 AM, Robert Gründler wrote: thanks for the tip. This is what i've come up with so far: // in the template the sf_cache_ke

Re: [symfony-users] Auto-filling caches

2011-02-11 Thread Robert Gründler
thanks for the tip. This is what i've come up with so far: // in the template the sf_cache_key is set containing the current page include_component('article','articles',array('page' => $page, 'sf_cache_key' => 'articles_' . $page)) // in the task the cached version of the first 10 pages shou