I'm building an app for the company I work for in symfony, non the less the app might be pretty useful outside our company so we decided to write it in a more general form so we can make it multi company. I'm facing a problem on how to define a default value for a field that is going to be in every single model (company_id) so we don't ...
I've installed the sfDoctrineGuard plugin. Everything is working, I can use the /sf_guard_user/edit/:id page to edit a user.
I didn't like the way the permissions were listed as a select list, I wanted to display them as individual checkboxes split up based on the permission name. To do this I created a custom widget that extends sfWidg...
I'm new to Symfony Framework and I ran into a problem with form validation.
I want to update data in DB including unique column, but if unique column is unchanged, an error is returned (An object with the same "domain" already exist."). Domain column must be unique, but user should be able to change it. So, if one user saves his domain ...
Got this error: Widget "password_again" does not exist.
I can't think why it has suddenly started appearing. I'm using the default generator file supplied with the sfDoctrineGuard plugin
plugins/sfDoctrineGuardPlugin/modules/sfGuardUser/config/generator.yml
generator:
class: sfDoctrineGenerator
param:
model_class: sfGuardU...
Newbie question.
I've created a very simple LoginForm class in symfony. It checks if the user inserts the username and the password in the field and It work as expected.
// UserLoginForm :: configure()
$this->setWidgets(array(
'username' => new sfWidgetFormInputText(),
'password' => new sfWidgetFormInputPassword(),
));
$this->setV...
I am using Symfony 1.3.6 on Ubuntu 10.0.4.
I am using the sfWidgetFormSelectRadio to allow a user to select a picture from a list, in a form.
In the action, the pictures are set up like this:
$this->form->setWidget('chosenpic', new sfWidgetFormSelectRadio(array(
'choices' => $this->pictures,
...
I have a doctrine model that has a method getSomethingId()
and I'm making something of an automated form generator for internal use in the company
how can I check if my model has this method?
I've tried with php's method_exists but it returns false for every method, what can I do?
thanks
...
Hi,
i want to display combo box using symfony. In the CountryForm.php i have created widget as :
$this->setWidgets(array('country' => new sfWidgetFormChoice(array('choices' => array()))));
for this validator as:
$this->setValidators(array('country' => new sfValidatorChoice(array('choices' => array(array_keys($countries))))));
I am ge...
I have added an index on a table just to ensure that a set of fields together form a composite unique key (Is this approach correct? or is there a better option with Doctrine?)
After having done that, when I try to save an object and the unique constraint fails, a SQL exception is generated. What is the best way to handle this? and to d...
Hi all,
A quick question. I have a symfony form. When I save the form, I want my created_by field to be set automatically on save.
So, i'm passing the current user id as an option in the form:
$this->form = new ContractForm(null,array("created_by"=>$this->getUser()->getId()));
And in the configure method of the form class I have:
$...
With Symfony 1.4's Forms, how can I throw a sfValidatorError in the post validator of an embedded form?
My parent form calls the following:
public function configure(){
$this->embedForm('page', $pageLinkForm);
}
And my embedded form:
public function configure(){
$this->validatorSchema->setPostValidator(new sfValidatorCallbac...
I am using Symfony 1.3.6 on Ubuntu.
I have a form with a lot of fields on it - rather than showing all the fields in one go (which may intimidate the user), I want to break up the form into stages, so that a user can fill in only the fields displayed, at each step/stage (kinda like a wizard).
In order to do that, I need to write custom...
Currently I am using ckEditor with ckFinder in Symfony. When I save a form the HTML is saved (seemingly so) properly in the database. When I query through symfony and retrieve the results, the html tags are removed and replaced. Can I prevent this? Below is an example of what is in the database. I tried putting in what the HTML Shows but...
Hi all,
I'm trying to create a form that change the validation of a field based on the select option from the html form field.
Ex: if user select a option 1 from drop down field "options", I want the field "metric" to validate as sfValidatorInteger. If user select option 2 from field "options", I want the field "metric" to validate as...
So far I have copied sfGuardRegister into my frontend app modules directory so it has taken over the default sfGuardRegister located in the sfDoctrineGuardPlugin directory in the symfony plugins directory.
I want to have the plugins sfGuardRegister signup/register form show up on my homepage template..
Thanks in advance
...
I have a multidimensional array of form data thats an been unserialized from YAML. As such it looks something like this:
Array(
'name' => 'Somone',
'email' => '[email protected]',
'billing' => Array(
'address_1' => '1234 Somewhere'
'address_2' => NULL,
'city' => 'Somewhere',
'state' => 'ST'
'country' => '...
Hi, I'm using Symfony 1.4 and am a little stuck regarding form validation. I have a validator like the one below:
$this->setValidator('mobile_number', new sfValidatorAnd(array(
new sfValidatorString(array('max_length' => 13)),
new sfValidatorRegex(array('pattern' => '/^07\d{9}$/'),
array('invalid' => 'Invalid mobile number.'...
Hi I have two forms, a Specification form and a Source form.
I'm merging the two forms into one so that users can submit a specification and the source of the specification at the same time.
The problem is that the specification table has a field called name and the source table has a field called name. So, when creating the forms and...
I am using Symfony 1.4 to create project, and i need to create dynamic forms depending upon the question set type coming from database. i have used Symfony forms in rest of my project, but in this case using symfony forms seems to be tough, as i need dynamic form.
can it be safe to use normal HTML forms..in symfony project, or it is advi...
I have created custom HTML form elements to take inputs from user, and i am not using the Symfony Form. i know that it keep me out of Symfony form validation system, Is there any way to use custom HTML element and get Symfony Form validation on that elements.
I have used Symfony forms and i know how to use validators, but this time i am ...