[TYPO3-dev] Filter and mapping for Array

Daniel Pötzinger operation-lan at gmx.de
Sun Mar 2 00:57:29 CET 2008


Dr. Ronald P. Steiner schrieb:
> Hi group,
> 
> this question is not about programming or coding but about logic, ideas 
> and brainstorming.
> 
> Situation:
> I'm programming an extension that covers most functionality of tt_news 
> but includes more flexibility for displaying various database tables. 
> The first start was the purpose to create an DAM-Gallery. Now various 
> data can be displayed.
> 
> Anyway, here my question:
> I read an database table into an 2D-array:
> 0 {
>    title = test title
>    description = a test description
>    image_file = file.jpg
> }
> 1 {
>    title = test title 2
>    description = a test description
>    image_file = file2.jpg
> }
> ...
> 
> Now:
> 1)
> I want to give some possibility to filter this array. How would a 
> BE-User want to input filter rules? I played around with:
> filter = exclude
> filter {
>    field = image_file
>    method = regex or lte for lower then, gte, lt, gt
>    rule = /some regular expression/i or some number if lte, gte, ...
> }
> But I think this is a ugly way to select how to filter data. Has anybody 
> done something similar in a more elegant way? Is there any extension 
> that does something similar in a more elegant way?
I dont know what you want to achieve.
But its not the badest way in my eyes - just not userfriendly if normal 
BE user should do this.
There was a pattern to abstract SQLs which is related:
http://www.drewnoakes.com/code/util/Filter.html

> 
> 2)
> Same way I want to give the BE-user possibility to ad data. The way I'm 
> doing it now is to allow him to create an TS-ARRAY in each element there 
> is again a filter to define where the information should be added.
Why not create new records in a sysfolder then?





More information about the TYPO3-dev mailing list