[Typo3] Sorting problem in my own extension
Christian Trabold
trabold at mehrwert.de
Thu Aug 11 15:30:14 CEST 2005
>> I wrote a simple adress list extension.
>> It works fine, but i can`t sort by town
>>
>> some lines from extension :
>> // Initializing the query parameters:
>>
>> list($this->internal["orderBy"],$this->internal["descFlag"]) =
>> explode(":",$this->piVars["sort"]);
>>
>> $this->internal["results_at_a_time"]=t3lib_div::intInRange($lConf["results_at_a_time"],0,1000,20);
>> // Number of results to show in a listing.
>>
>> $this->internal["maxPages"]=t3lib_div::intInRange($lConf["maxPages"],0,1000,2);;
>> // The maximum number of "pages" in the browse-box:
>> "Page 1", "Page 2", etc.
>>
>> $this->internal["searchFieldList"]="name,zip,town,street,phone,contact,branch,province,www,email";
>>
>> $this->internal["orderByList"]="uid";
>>
>>
>> i changed uid to town in last line but it doesn't work too.
>>
>> Where is the problem?
>
> What is $this->internal["orderBy"] and $this->internal["orderByList"]
> doing?
What is your class doing?
Look at the line "class tx_###your_ext_key### extends tslib_pibase".
So you'll see that your class is a child of tslib_pibase. tslib_pibase
is the parent class.
That means: you can access every method or property of the class
tslib_pibase in your own "extension" script. That's done by setting
these "$this->"-Vars to the values you need.
tslib_pibase
^--- the filename is class.tslib_pibase.php
^---- the file is located at the folder tslib/
"The "tslib" contains PHP4-classes that generates the standard
TypoScript based frontend for TYPO3."
There you search for "orderByList" and you'll find the answer :)
Enjoy the source!
Christian
More information about the TYPO3-english
mailing list