Hi,

Sorry for the newbie question - I'm trying to work out how to rewrite a link at 
the top of a table that sorts the table by column...


At present, I'm using:

<th tal:repeat="item fields">
  <a href="?criteria=${criteria}&amp;column=${repeat/item/key}" 
tal:content="repeat/item/key" >field name</a>
</th>

where I've captured incoming values in the GET ...

$template->column   = array_key_exists('column', $_GET)) ? 
htmlspecialchars($_GET['column']) : '';  # grab the sort column
$template->criteria =  (array_key_exists('criteria', $_GET)) ? 
htmlspecialchars($_GET['criteria']) : '';    # grab search criteria


I need to decide how to signify that a table, already sorted by 'column', 
should be reverse sorted by column. In the past I'd do this by using the case 
of 'column' - 'column' for ascending and 'COLUMN' for descending. Is there a 
way to do this without resorting to php? or is there a more idiomatic PHPTAL 
way of doing it?


Any pointers gratefully received...

dd




_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to