Bernhard Schussek
e1fc5a5c8c
[Form] Restricted form names to specific characters to (1) fix generation of HTML IDs and to (2) avoid problems with property paths.
...
ad (1): HTML4 "id" attributes are limited to strings starting with a letter and containing only letters, digits, underscores, hyphens, periods and colons.
ad (2): Property paths contain three special characters needed for correct parsing: left/right bracket and period.
The rules for form naming are:
* Names may start with a letter, a digit or an underscore. Leading digits or underscores will be stripped from the "id" attributes.
* Names must only contain letters, digits, underscores, hyphens and colons.
* Root forms may have an empty name.
Solves #1919 and #3021 on a wider scope.
2012-01-23 18:28:25 +01:00
Fabien Potencier
7ee2f6da75
fixed some phpdoc
2012-01-11 15:46:50 +01:00
stloyd
c29fa9d64e
[Form] Fix for treatment zero as empty data. Closes #1986
2011-08-22 15:19:31 +02:00
Fabien Potencier
c6cc427e4b
[EventDispatcher] added a way to set the priority for event subscribers
2011-06-14 14:40:27 +02:00
Fabien Potencier
ea93e4cafa
[Form] added a circular reference safeguard for form type
2011-06-09 17:58:22 +02:00
Fabien Potencier
2ee0c284bc
[Form] fixed CS
2011-06-09 11:40:24 +02:00
Fabien Potencier
fd97dd0059
[Form] text is now the default type when not explicitely set and when no data class is set
2011-06-09 11:37:06 +02:00
Fabien Potencier
a6a3789a54
[Form] tweaked an error message
2011-06-09 11:33:25 +02:00
Fabien Potencier
d9500418cd
[Form] tweaked an error message
2011-06-09 11:32:20 +02:00
Fabien Potencier
1aabc5da64
fixed CS
2011-06-08 12:16:48 +02:00
Fabien Potencier
c8034c04a8
Merge remote branch 'vicb/form-rendering'
...
* vicb/form-rendering:
[Form] The variable stack should not persist between section rendering (fixes #1157 )
[Twig][Form] Tweak form extension phpDoc and code
[Form] Tweak phpDoc
[FormView] fix phpDoc
[Form] Some tweaks
2011-06-01 10:32:40 +02:00
Victor Berchet
cbfc146ac8
[Form] Tweak phpDoc
2011-05-30 15:21:15 +02:00
Fabien Potencier
9b7e14dd10
[Form] converted code to the new event dispatcher
2011-05-30 09:37:42 +02:00
Jordi Boggiano
1246503e55
[EventDispatcher] Allow registration of arbitrary callbacks
...
This in effect removes the direct link between event name and the method name on the handler.
Any callback can be given as a handler and the event name becomes an arbitrary string. Allowing for easier namespacing (see next commit)
2011-05-26 11:54:06 +02:00
Fabien Potencier
75f0ab5d40
Merge remote branch 'vicb/form-fluid'
...
* vicb/form-fluid:
[Form] Fix the Form fluid interface
[Form] Fix the fluid interface of FormBuilder
[Form] Fix the fluid interface of FormBuilder
2011-05-17 09:45:29 +02:00
Victor Berchet
5536d41906
[Form] Add phpDoc for form builder and fix method declaration order to conform to the CS
2011-05-11 11:00:32 +02:00
Victor Berchet
daccf9bc17
[Form] Fix adding transformers in the FormBuilder
2011-05-10 20:25:30 +02:00
Victor Berchet
eca6453558
[Form] Fix the fluid interface of FormBuilder
2011-05-10 20:09:37 +02:00
Bernhard Schussek
675e5ded9e
[Form] Changed FormBuilder::build() to FormBuilder::create(). You hvae to pass the resulting builder to FormBuilder::add() manually now
...
$builder->add(
$builder->create('child', 'form')
->add('foo', 'text')
->add('bar', 'text')
);
2011-04-24 12:08:50 +02:00
Pascal Borreli
8c0beea677
[Phpdoc] Cleaning/fixing
2011-04-23 15:18:47 +00:00
Bernhard Schussek
54e66c518f
[Form] Reorganized code into "form extensions"
...
The extension classes are now the only constructor argument of the FormFactory class. They replace the existing "type loader" classes.
new FormFactory(array(
new CoreExtension($validator, $storage),
new CsrfExtension($csrfProvider),
new DoctrineOrmExtension($em),
));
Together with a few upcoming commits this mechanism will make
* extension of the form framework in bundles and
* usage of the forms outside of Symfony2
much easier.
2011-04-22 17:41:21 +02:00
Bernhard Schussek
a97366fbcb
[Form] Split signature of FormFactory::create() into create() and createNamed()
...
The data can now be passed to all creation methods:
$form = $factory->create('form', $data);
By default, a form will receive the name of its type ("form" in above example). If you wish to pass a custom name, use createNamed():
$form = $factory->createNamed('form', 'myform', $data);
2011-04-22 10:42:21 +02:00
Bernhard Schussek
e3db366116
[Form] Passing FormFactory to FormBuilder in its constructor
2011-04-14 15:25:30 +02:00
Bernhard Schussek
e476231e8a
[Form] Removed invalid tests, cleaned up some tests, added test coverage
2011-04-06 15:58:53 +02:00
Bernhard Schussek
a5d0b3aea6
[Form] Changed FormBuilder::set(Client|Norm)Transformer to FormBuilder::prepend(Client|Norm)Transformer and FormBuilder::append(Client|Norm)Transformer to facilitate extension of types
2011-04-02 16:39:19 +02:00
Bernhard Schussek
33b0011f86
[Form] Improved test coverage of Form
2011-04-02 11:22:29 +02:00
Bernhard Schussek
c864d7fae1
[Form] Improved test coverage of Form class
2011-03-31 15:23:33 +02:00
Bernhard Schussek
1ef18360fa
[Form] Made name immutable in FormBuilder to avoid synchronization problems with name and property path
2011-03-31 13:48:06 +02:00
Bernhard Schussek
b180319371
[Form] Moved creation of empty data to Form to clean up DataMapperInterface
2011-03-27 15:12:35 +02:00
Bernhard Schussek
6588a47ba7
[Form] Removed FormBuilder::setDataClass(). Use the FieldType option "data_class" instead.
...
The problem was that "data_class" was used in two places: FormBuilder::build() and PropertyPathMapper.
PropertyPathMapper was already constructed during FormType::buildForm(), so any data class changes made to the FormBuilder wouldn't affect the data class of the PropertyPathMapper anymore and so lead to an inconsistent state.
2011-03-27 14:34:48 +02:00
Bernhard Schussek
364b0f5208
[Form] Fixed: FormBuilder::add() accepts FormTypeInterface instances
2011-03-27 14:05:06 +02:00
Bernhard Schussek
c786fac303
[Form] Sample fix implementation of renderers
2011-03-26 16:03:34 +01:00
Bernhard Schussek
9b1b8cbffa
[Form] Replaced various occurences of 'field' by 'form'
2011-03-25 02:12:01 +01:00
Bernhard Schussek
15d5259eb8
[Form] Forms now remember the types used during their construction
2011-03-24 16:16:31 +01:00
Bernhard Schussek
577e106361
[Form] Implemented custom mapping of data errors to form fields
2011-03-22 01:15:48 +01:00
Bernhard Schussek
87665bc380
[Form] Decoupled FormBuilder from CSRF protection
2011-03-21 22:41:19 +01:00
Bernhard Schussek
c1abf08d9c
[Form] Implemented error bubbling
2011-03-21 22:13:02 +01:00
Bernhard Schussek
01a47457d0
[Form] Improved naming of various interfaces. Renamed DefaultRenderer to ThemeRenderer
2011-03-21 20:57:38 +01:00
Bernhard Schussek
321d40b21a
[Form] Decoupled FormBuilder from ThemeInterface
2011-03-21 20:46:43 +01:00
Bernhard Schussek
119866e06d
[Form] Renamed FormBuilder::getInstance() to getForm()
2011-03-20 15:17:25 +01:00
Bernhard Schussek
2dbb41714a
[Form] Merged Field and Form. Merged FieldBuilder and FormBuilder. After the refactoring, the distinction between the two concepts is small enough to merge them
2011-03-20 13:35:19 +01:00
Bernhard Schussek
fc7281bcab
[Form] Extracted validation logic of form. Fields can now contain multiple validators
2011-03-20 12:00:19 +01:00
Bernhard Schussek
cb599f417e
[Form] Renamed field option 'disabled' to 'read_only'. How to render read-only fields is now the responsibility of the renderer
2011-03-20 10:35:16 +01:00
Bernhard Schussek
2c6c89d898
Merge remote branch 'beberlei/forms' into beberlei-merge
2011-03-20 10:15:59 +01:00
Benjamin Eberlei
b43318ee3e
[Form] Add tests for untested classes.
2011-03-19 22:03:49 +01:00
Bernhard Schussek
fb2db58801
[Form] Added fluid interface for inline adding of sub-builders to a builder
2011-03-19 19:44:45 +01:00
Bernhard Schussek
6793bcd698
[Form] Removed magic from method signature of add()
2011-03-19 19:20:55 +01:00
Bernhard Schussek
c4b7a77ece
Merge remote branch 'beberlei/forms' into beberlei-merge
...
Conflicts:
src/Symfony/Component/Form/Type/Loader/DefaultTypeLoader.php
2011-03-19 19:01:57 +01:00
Bernhard Schussek
0259d4da1e
[Form] Moved namespace DataValidator to Validator
2011-03-19 16:54:07 +01:00
Benjamin Eberlei
32e1a7c8f9
Merge bschussek/experimental into branch forms.
2011-03-19 15:18:52 +01:00
Bernhard Schussek
3e17b26105
[Form] Moved CSRF protection into separate field
2011-03-19 15:06:54 +01:00
Benjamin Eberlei
3e2b8e5f12
Fix some missing use statements and small bugs.
2011-03-19 14:31:25 +01:00
Bernhard Schussek
6bc79a1a12
[Form] Renamed different kinds of data transformers within a field for better clarity
2011-03-18 16:59:34 +01:00
Bernhard Schussek
1c85daa56b
[Form] Split FieldBuilder into FieldBuilder and FormBuilder to make creation of classes deterministic
2011-03-18 16:34:54 +01:00