url conventions and date calculations
Archived from the Xataface Users forum.
shardison — Thu Sep 13, 2012 1:22 pm
Steve,
I want to thank you for answering my previous questions. Now I have a new question.
I have the following list element in my dashboard:
List waiting for interviews:
I want to filter for date_of_visit == TODAYS_DATE; I was thinking I could make a function in my dashboard.php file called mydate(). But I cant seem to get the implementation for my dashboard.html. I know that {……} represents a call to functions in other files but am missing exactly how the mechanics work. Anyway my main request is to be able to filter my visits table to just visits for today
shannah — Thu Sep 13, 2012 1:35 pm
You can only access variables in a template that you pass to its context. E.g. To add a variable $mydate to your template’s context, you need to add it in the array() that you pass as the first parameter to df_display().
- Code: Select all
df_display(array('mydate' => '2012-12-01'), 'path/to/mytemplate.html');
In this case, you also might want to look at the smarty.now and smarty dateformat functions.