Try
{{ form_field(form.myDate, { 'date_pattern': '{{ month }}/{{ year }}' }) }}
Bernhard
--
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
Hi Benjamin,
You can use the collection constraint for this.
use Symfony\Component\Validator\Constraints\Collection;
use Symfony\Component\Validator\Constraints\NotNull;
$defaults = array('foo' => 'bar');
$form = $factory->create('form', $defaults, array(
'validation_cons
Hi Roger,
Could you please create a ticket for this?
https://github.com/symfony/symfony/issues
Thanks,
Bernhard
--
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
Group
2011/5/13 Christophe Willemsen :
> What's the best way in the form type class to verify if it is a new
> form or an update form ?
You can't, you can only do so in listeners to the *SetData events.
What are you trying to achieve?
Bernhard
--
If you want to report a vulnerability issue on symfony
2011/5/5 Vincent Lechemin :
> On Thu, May 5, 2011 at 9:41 AM, Manu wrote:
>> How does Symfony2 handle inheritance ?
> This also interests me, what's the best way to make a form with
> inheritance having multiple possibilities for data_class?
Do you mean for field guessing?
Bernhard
--
If you w
2011/5/5 Don Pinkster :
> Awesome, thanks! Maybe possible to make a shortcut for this? Like: {{
> form.name.value }}
No, this would break consistency. Better documentation should solve
this problem.
Bernhard
--
If you want to report a vulnerability issue on symfony, please send it to
security
Which errors are you talking about?
Bernhard
--
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 symfon
You must have a typo somewhere. This is working for me.
Bernhard
--
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,
Some of your questions were answered in the other thread already. As
for completeness, you can decouple your type form EntityManager by
using a closure in the "query_builder" option:
'class' => 'Entity:Cities',
'query_builder' => function (EntityRepository $repository) use ($state) {
Hi Roger,
You should never rely on the form data in your type class (as you've
just discovered). When the form is constructed, you can never be
certain that the data is already available and won't be changed.
In your case, I recommend to add an event listener to the preBind and
preSetData events
Hi Daniel,
If you could prepare a PR with such constraints, I'd be happy to merge it.
I would prefer if the constraint had only a single option "properties"
which is also the default option. In case of LessThan, each property
in that array should be less than all properties after that. So in
simp
Hi,
Try form.vars.value.
Bernhard
--
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@go
Hi Ville,
getErrors() only returns the errors of that specific Form instance,
but not of any children. You can loop through the Form children and
call getErrors() on them to receive their errors.
Hope I helped,
Bernhard
--
If you want to report a vulnerability issue on symfony, please send it
Hi,
You can pass custom attributes in the template:
{{ form_widget(field, { 'attr': { 'class': 'foobar' } }) }}
Cheers,
Bernhard
--
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 t
Hi Geoff,
Like with createBuilder(), you can pass the $product as second
argument of create():
$form = $this->get('form.factory')->create(new ProductType(), $product);
Could you fix the documentation in this regard?
Thanks!
Bernhard
--
If you want to report a vulnerability issue on symfony,
2011/4/26 Vincent Lechemin :
>> {% if form.field.errors|length > 0 %}
> When I do that, I get "Method "errors" for object
> "Symfony\Component\Form\FormView" does not exist."
Oops, form.vars.errors, form.field.vars.errors etc. it has to be (like above).
> I'm not using any object to populate the
2011/4/26 Gediminas Morkevicius :
> And as we started about choice field, how to add @empty value into the
> entity type choice list.
> I need to be able to set the relation to NULL pointed.
Set the 'required' option to false. Additionally you can overwrite the
label of the empty value in the temp
Hi Vincent,
2011/4/26 Vincent Lechemin :
> In twig, how can I test if a field has an error?
{% if form.field.errors|length > 0 %}
> Is there a replacement to the data option with choice field type? It
> allowed to preset data.
You have to set the correct data in your *object* which is used to
p
2011/4/17 Dennis Jacobfeuerborn :
> I think the reference should be validated but not necessarily the whole
> entity the reference points to.
The reference would be validated anyway because the reference is a
property of the main object.
Bernhard
--
If you want to report a vulnerability issue o
Hi Holger,
You can use the Callback constraint for this purpose. You can see an
example of its usage in DelegatingValidator::validateFormData():
https://github.com/symfony/symfony/blob/form/src/Symfony/Component/Form/Validator/DelegatingValidator.php
What is necessary for this approach:
- a commo
Hi Matt,
The problem is that by default the data of each field is validated. For the
entity field this is the selected entity. Does it make sense to generally
disable validation for entity fields?
Bernhard
Am 16.04.2011 21:38 schrieb "Matt Johnston" :
I have two entities that are joined by a Ma
Hi Donald,
Can you verify whether this problem still occurs with the experimental
Form branch:
https://github.com/bschussek/symfony/tree/experimental
Thanks,
Bernhard
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received thi
Hi Dmitry,
What operating system do you use?
Bernhard
--
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
Hi Illya,
2011/3/30 Illya Klymov :
> Another problem is binding some validation checks to corresponding form
> fields. As far as i understand, getPropertyPath is used to retrieve data
> from ConstraintViolations and to "bind" error to corresponding form field. I
> have a method isClosureDateAfterL
Hi Dennis,
The form framework normalizes empty values to null by default. Why
would you allow empty strings but not null?
Bernhard
--
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
2011/2/28 Brocco :
> Did you have the time to look at it?
I could confirm the erroneous behaviour, but the bug is not fixed yet.
> Another question related to forms (I don't know if it's the right
> place to ask): I can't find an easy way to get access to an uploaded
> file from my request object
Hi Oscar,
There is IntegerField for exactly that purpose. This field casts every
input to an integer.
I wouldn't recommend storing phone numbers as integers though. People
may enter phone numbers with blanks in between which will result in a
mess when converted.
So instead I recommend to use a r
2011/2/28 Gustavo Adrian :
> If I have the validation method named "isAddressValid", the resulting
> property name is "addressValid". But in my case I'd it to be only "address"
> so I can map the error to my form field. Is this possible?
The answer is no. You'd have to do that mapping yourself.
B
--
Software Architect & Engineer
Blog: http://webmozarts.com
Twitter: http://twitter.com/webmozart
2011/2/21 Brocco :
> The problem is that in the array returned by getValues(), the
> validator doesn't look at the keys. What is the best way to make this
> work? Should I create a new getValuesKey
It was removed because its implementation was buggy/bad. You can copy
the old implementation into your project and use it this way. A new
version of it will come soon.
Bernhard
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You rece
Hi Lideln,
The @Date constraint checks for date strings with format "-MM-DD".
What you want is @AssertType("\DateTime"). Maybe we have a naming
issue here.
Bernhard
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received th
Oops, parentheses I mean.
/** @validation:NotNull */
and
/** @validation:NotNull() */
both are valid.
Bernhard
--
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
Group
> Correct syntax for annotation-validators is to use parents in the end:
> email(), NotBlank()...
This is not true. You can leave away the parents just as well.
Bernhard
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received t
Hi,
This is intended behaviour. An empty value is only displayed if a
field is not required. Through the "empty_value" option you can change
the label of that empty value.
Bernhard
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You
> The validator returns "This value should not be blank" two times for
> each field with @validation:NotBlank() if I submit the form empty
> This behaviour occurs only with fields of the second entity
> (translation).
This is a known bug.
Bernhard
--
If you want to report a vulnerability issue
2011/2/14 Damon Jones :
> Why not have a getFullname() accessor method in your user entity which
> returns first and last name concatenated and use that property?
This should work. If it doesn't, that's a bug.
Bernhard
--
If you want to report a vulnerability issue on symfony, please send it to
Hi Andras,
Please don't cross post. I have answered your question in your
previous thread already.
Bernhard
--
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
ned.
>
>
> --
> Christophe
>
>
>
> Le 9 févr. 2011 à 12:47, Bernhard Schussek a écrit :
>
>> It already tells you the problem. BreveRequest need to be mapped. Try
>>
>> $ app/console doctrine:schema:info
>>
>> to find out whether the c
It already tells you the problem. BreveRequest need to be mapped. Try
$ app/console doctrine:schema:info
to find out whether the class is mapped. If it is not, consult the
Doctrine documentation.
Bernhard
--
Software Architect & Engineer
Blog: http://webmozarts.com
Twitter: http://twitter.com/we
Not that I know, sorry. Maybe if you search on Google.
Bernhard
--
Software Architect & Engineer
Blog: http://webmozarts.com
Twitter: http://twitter.com/webmozart
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this mess
Hi Christophe,
In your configure() method, add the call
$this->setDataClass('Name\Space\BreveRequest');
The namespace needs to be corrected, of course.
Bernhard
--
Software Architect & Engineer
Blog: http://webmozarts.com
Twitter: http://twitter.com/webmozart
--
If you want to report a vu
Hi Soulfly,
Yes, that should be possible if you use PHP 5.3.
Bernhard
--
Software Architect & Engineer
Blog: http://webmozarts.com
Twitter: http://twitter.com/webmozart
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received th
Strange. Could you try removing $this->getOptions() when creating the subforms?
--
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 t
Hi Nikita,
$form = UniversityRegistrationForm::create($this->get('form.context'));
should be
$form = UniversityRegistrationForm::create($this->get('form.context'),
'registration');
Bernhard
--
Software Architect & Engineer
Blog: http://webmozarts.com
Twitter: http://twitter.com/webmozart
--
I
Ah you probably forgot to pass a name to Form::create(), right.
This is fixed in trunk. Now an exception will be thrown when you bind
an anonymous form. Sorry for the inconvenience.
Bernhard
--
Software Architect & Engineer
Blog: http://webmozarts.com
Twitter: http://twitter.com/webmozart
--
If
Hi Dennis,
Do you really need a Form instance for something as simple as a search form?
Bernhard
--
Software Architect & Engineer
Blog: http://webmozarts.com
Twitter: http://twitter.com/webmozart
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-p
Could you please print the output of var_dump($form->getCsrfProvider())?
In Symfony\Component\Form\CsrfProvider\DefaultCsrfProvider there is the line
return sha1($this->secret.$pageId.$this->getSessionId());
within generateCsrfToken(). Please do also output the secret, page ID
and session ID
Hi Nikita,
Yes, your field definitions go into configure(). If you want to group
fields, just use a Form as well - FieldGroup doesn't exist anymore.
There are two different ways to construct a form:
1) new Form(name, options) - this is for forms where you want to pass
all options yourself
2) For
Can you show the code of your form and the template please?
That sounds strange.
Bernhard
--
Software Architect & Engineer
Blog: http://webmozarts.com
Twitter: http://twitter.com/webmozart
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.
Hi Adrien,
2011/2/6 Adrien Mogenet :
> What's the strategy here ? What should be the namespace of Form
> classes and Domain Objects ?
There's no best practice for this yet. It depends on how you organize
your namespaces. If you organize them by your business domain
(Contact, Sales, etc.) it makes
hen you would use asserttype integer
> in a form then? How would you make it pass as an integer if it is
> automatically passing as '5'?
>
> Thanks in advance,
>
> ~Joseph Cooper
>
> On Jan 27, 11:17 pm, Bernhard Schussek wrote:
>> Hi,
>>
>&
Hi Vladimir,
Currently the validator is not integrated into Doctrine 2, so there is
nothing to protect you from that. Sorry.
You can make a feature request at doctrine-project.com and ask for
Validator support.
Cheers,
Bernhard
--
Software Architect & Engineer
Blog: http://webmozarts.com
Twitter
Hi Vladimir,
Why at all do you flush the entity/document when validation fails?
Bernhard
--
Software Architect & Engineer
Blog: http://webmozarts.com
Twitter: http://twitter.com/webmozart
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.c
Hi Donald,
This is implemented now, although waiting to be pulled into Fabien's master.
https://github.com/bschussek/symfony/commit/a2615de332480303a85b2499c4e40e33627787cf
Traversable objects will be traversed by the @Valid constraint.
Traversal can be disabled by setting the option "traverse" t
2011/1/28 Richard D Shank :
> We have spent some time thinking about it, but I'm finding the more we think
> about it, the more our ideas change :).
I highly recommend analyzing other successful e-commerce projects
(also in other programming languages). This can change your vision a
lot to the bet
Hi,
First of all, please stop cross-posting the two lists.
Second, this is intended behaviour. AssertType("integer") checks that
the actual data type of the value is integer, so if you pass the
string '5' this validation fails.
Additionally, I recommend using @Max(9) in combination with
Yes. Execute
./app/console doctrine:schema:create
respectively
./app/console doctrine:schema:update
in the CLI.
Bernhard
--
Software Architect & Engineer
Blog: http://webmozarts.com
Twitter: http://twitter.com/webmozart
--
If you want to report a vulnerability issue on symfony, please send i
2011/1/25 Donald :
> I am trying to validate a collection using the @validation:Valid()
> annotation, but it does not work with Doctrine 2's ArrayCollection
> class.
You are currently hitting a small case that's not supported yet,
sorry. It'll be done :)
Bernhard
--
Software Architect & Engineer
Could it be that the "namespace" definition of your Location class is wrong?
--
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 t
2010/11/24 Ases :
> From annotations works fine, but how I would have to call it from
> validation.yml?
>
> #Application/MyBundle/Resources/config/validation.yml
> Application\MyBundle\Entity\Anything:
> getters:
> address:
> - NotBlank: ~
> - IpAddress: ~
BTW, you can now define nam
Do you have the intl extension installed? It's supposed to be shipped
with PHP 5.3, but apparently it's not activated by default in some
configurations.
We're trying to decouple the Forms from intl, but that wasn't done yet.
Bernhard
--
Software Architect & Engineer
Blog: http://webmozarts.com
Tw
You can simply create a constructor that accepts the EntityManager as
parameter, no?
Bernhard
--
Software Architect & Engineer
Blog: http://webmozarts.com
Twitter: http://twitter.com/webmozart
2010/12/29 François :
> Hi everyone,
>
> I'm in trouble with something in the example of the Form
> do
> it isn't). This is trying with a basic NotBlank validation (but submitting
> a blank value). The subform is appearing as expected on the render, with
> field names/IDs as expected.
>
> Thanks,
>
> Rich.
>
> On Wed, Dec 15, 2010 at 10:46 AM, Bernhard Schussek
&g
Hi Rich,
You always need a domain model to process the data of the form. What
you can do though is compose a form of different forms acting on
different domain models.
I.e.
$form = new Form('base_form', $baseModel);
$dispatcher->notify('...');
and in the event handler you can add a subform
$be
Hi Dennis,
Can you show me the generated HTML code for the choice field? Do you
use Twig or PHP templating?
Also, can you show me the output of both
$form['rack']->getDisplayedData() and $server->rack?
Thanks,
Bernhard
--
Software Architect & Engineer
Blog: http://webmozarts.com
Twitter: http:/
2010/11/26 Gustavo Adrian :
> The Url constraint for instance. How could you make it optional? if you
> don't enter any value on the field, it would complain because the only way
> it returns true is if $value === null
Ok, that's a bug. Can you file a ticket please? :)
Bernhard
--
Software Archit
2010/11/26 Gustavo Adrian :
> Thanks for clarify this point. But then there's a problem with this too. I
> saw that validators check for null values like:
> if ( $value === null )
> {
> return true;
> }
> But they don't check for empty values.
That's because many validators (f.i. Min) expect a
2010/11/25 Gustavo Adrian :
> The problem is if I just use @IpAddress on that field and I don't enter a
> value, it will complain because is not a valid IP either.
All validators except NotNull and NotBlank should treat NULL values
(or empty values, in your case) as valid. Sorry, this is not
docum
> From annotations works fine, but how I would have to call it from
> validation.yml?
You currently have to provide the full namespace there.
#Application/MyBundle/Resources/config/validation.yml
Application\MyBundle\Entity\Anything:
getters:
address:
- NotBlank: ~
- Aps\Namespace\P
2010/11/24 Gustavo Adrian :
> Hi everyone,
> I've recently created a custom validator to validate IP. I have four fields
> that need a mandatory IP, and one field in that the IP is optional.
I'm not sure I understand the example. Can you put @NotBlank
constraints on all fields, and additionally @I
Hi Gustavo,
Sorry, the documentation is lacking in that part. You need to register
your constraint namespace to use it with the validation driver. Add
this to your config.yml
validation:
enabled: true
annotations:
namespaces:
myvalidation:
Applicati
2010/11/22 Gustavo Adrian :
> Ok. Then I'll keep using the standard way.
I really recommend this.
BTW: If you ever need to dynamically inject or read data from object
graphs, you can use the PropertyPath class.
foreach (array('firstName', 'address.street', 'emails[0].address',
...) as $property)
2010/11/21 Gustavo Adrian :
> I was thinking on delegating the data binding to a separated component just
> for convenience to make possible this:
>
> $dataBinder = new DataBinder( $myObject, $validator );
> $dataBinder->bind( $data );
NO. This makes your data immensely vulnerable - how do you res
Hi Gustavo,
You did exactly the right thing. Just call the setters of your object
(that's all that a Form does really). Why do you need any more
abstraction?
Bernhard
--
Software Architect & Engineer
Blog: http://webmozarts.com
Twitter: http://twitter.com/webmozart
--
If you want to report a vu
Hi Noel,
> I have a User entity, and two forms: a subscribe form, and a "edit profile"
> form. In the first one, I have two fields: the username, and the password.
> In the second, username, password, first name and last name.
> Actually, if I add the annotation "@validation:NotBlank" on the first
Hi,
Try to override the doUpdateObject() method in your form. It receives
the values of the form as parameter and is responsible for saving them
in $this->object (your record).
protected function doUpdateObject($values)
{
parent::doUpdateObject($values);
$this->object->from_city_name = $valu
Hi Gustavo,
Can you show a snippet of your code so we can find out what might be wrong?
Bernhard
--
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 user
Hi,
Simply create a new custom method and annotate it with an AssertTrue validator:
private function isValueBelowMaxLimit()
{
return $this->value < $this->maxLimit;
}
Bernhard
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You r
Hi Dennis,
I suppose $system->host is meant to contain a Doctrine proxy object?
Bernhard
--
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
I rather prefer to compose than to subclass here.
class ProductView
{
public function __construct(Product $product)
{
$this->product = $product;
}
public function setSelected($selected)...
public function getUrl()...
etc.
}
Bernhard
--
If you want to report a vulnerability is
Yes, you can do it like that.
Bernhard
--
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-user
Hi Javier,
That's because the return type of getRoute() is defined as sfRoute[1],
which doesn't have a getObject() method. Eclipse can't know that this
method returns a sfObjectRoute in this specific case.
Bernhard
[1]
http://trac.symfony-project.org/browser/branches/1.4/lib/action/sfAction.cla
What about creating a _pagination.php partial with the shared code?
Bernhard
--
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
Hi,
Try
$this->widgetSchema->setNameFormat('guest[%s]');
in the configure() method of your form.[1]
Bernhard
[1] http://www.symfony-project.org/forms/1_4/en/01-Form-Creation
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You re
Hi,
> i tried to load the ValidatorService,
> add this to my config file, but it doesn't work,
> web.config:
> validator: true
This should be
web.config:
validation: true
Bernhard
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
Probably you forgot to render the hidden fields. Check the HTML source
whether a hidden field with the name __csrf_token is present. If not,
add the following in your template:
renderHiddenField() ?>
Bernhard
--
If you want to report a vulnerability issue on symfony, please send it to
security
2010/7/11 Tarjei :
> 8. Forms
> One thing I see the form framework has addressed is grouping of
> fields. What I still miss is simple widgets for adding html around a
> set of elements or just at a point in the form.
The purpose of the form framework is not to generate the HTML for the
whole form,
Hi,
If you want to use form_tag_for(), you should omit the '@' in the
route name. Furthermore, the route is only a prefix - the actual
routes must be named _create and _update, depending on
whether the form creates/updates an object.
Example:
echo form_tag_for($form, 'user_doc', array('user_id' =
I disagree that this is a good use case for the event dispatcher. The
event dispatcher is good for providing hooks for additional,
_optional_ functionality (like logging, profiling etc.)
Sending a mail upon form submission is not optional. This has to
happen. You want to be able to test that it ha
Hi,
Unfortunately, the annotations driver doesn't work in the PR2. This is
fixed in fabpot/symfony (http://github.com/fabpot/symfony).
If you switch to that branch, you can enable the validator and the
annotation driver with the following configuration:
web.config:
validation:
enabled: tru
Hi,
As I am not familiar with Grails, could you explain what you would
like to see in Symfony2?
You can find both a quick tutorial for Symfony2 and more documentation
on the new components on http://symfony-reloaded.org
Bernhard
--
If you want to report a vulnerability issue on symfony, please
Hi,
I just noticed that the documentation is not up to date. You need to
enable the validator like this in config.yml:
web.config:
validation: true
Bernhard
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this messag
The same question has already been posted on the developer ML:
http://groups.google.com/group/symfony-devs/browse_thread/thread/667915859bc378e5
Bernhard
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message becau
Print the error schema of the form which gives you more details about
the required field:
echo $form->getErrorSchema();
Bernhard
--
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
You could, for instance, write a recursive render helper:
function render_nested_set(Doctrine_Collection $collection)
{
$output = "\n";
foreach ($collection as $record)
{
$output .= "".$record; // __toString(), or whatever you like
if ($record->getNode()->hasChildren())
{
That's no problem the form framework can solve for you, it's a
programmatic problem.
You can either:
1. Output the fields manually
echo $form['field']
2. Add conditionals in the loop
foreach ($form as $name => $field)
{
if (in_array($name, array('name', 'address')))
{
...
}
else if
Hi,
I wouldn't even use a post validator in this case, but rather a pre
validator with a callback validator:
Example:
class MyForm ...
{
public function configure()
{
...
$this->setPreValidator(new sfValidatorCallback(array(
'callback' => array($this, 'preValidate')
)));
Just do
print $form->getErrorSchema();
The error schema implements __toString().
Bernhard
--
Software Architect & Engineer
Blog: http://webmozarts.com
--
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to symfon
Hi,
>From my experience the best way to achieve this is to use in-memory
databases (f.i. with SQLite). They are fast and are created seperately
for every test process, so they don't interfere with each other.
You also have to make sure that any other physical fixtures (f.i.
files) are dealt with
Did you check whether factories.yml is configured to use the correct
user class in the test environment?
Do you maybe have several myUser classes in your project and symfony
is using the wrong one?
Bernhard
--
You received this message because you are subscribed to the Google Groups
"symfony u
1 - 100 of 286 matches
Mail list logo