[Flow] TYPO3 Flow for a new project?
Roberto Torresani
erreti at gmail.com
Thu Jul 3 08:58:17 CEST 2014
Hi Bastian
Thank you for your replay.
Yes, we used a DTO with the collection of users
Bye
Roberto
2014-07-02 14:03 GMT+02:00 Bastian Waidelich <bastian at typo3.org>:
> Roberto Torresani wrote:
>
> Hi Roberto,
>
> I forgot to respond it seems.. Did you get around the problem in the
> meantime?
>
>
> I read the page you sent me, but it's not exactly what I need.
>> I have a model User with userdata. I want, for example, edit/update in one
>> page phones, email and status of all users from Italy.
>>
>
> That are two challenges here:
> * You need a way to filter your users based on some input (e.g.
> country=italiy)
> * You need to be able to batch-process a collection of users
>
> For the filter I'd suggest to introduce a "demand" DTO, s.th. like this:
>
> class UserFilter {
>
> protected $country;
>
> // ...
> }
>
> class UserController {
>
> public function indexAction(UserFilter $filter) {
> $users = $this->userRepository->findByFilter($filter);
> }
> }
>
> This is a very extensible way and you can re-assign the filter to the view
> in order to populate the <f:form.* /> ViewHelpers properly:
>
> <f:form action="index" method="get" object="{filter}" objectName="filter">
> <f:form.textfield property="country" />
> <!-- ... -->
> </f:form>
>
>
>
> For the second challenge (batch-processing) I think the link at least
> points in the right direction: Just create a "batch" DTO that contains a
> collection of users.. The corresponding Fluid template might look like:
> <f:form action="batchprocess" object="{users}" objectName="users">
> <f:for each="{filteredUsers}" as="user" iteration="iteration">
> <f:form.checkbox property="users.{iteration.index}" value="{user}" />
> </f:for>
> <!-- ... -->
> </f:form>
>
>
> (all untested)
> HTH,
>
>
>
> --
> Bastian Waidelich
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
>
--
Certified TYPO3 Integrator
More information about the Flow
mailing list