url conventions and date calculations

A place for users and developers of the Xataface to discuss and receive support.

url conventions and date calculations

Postby 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:

<li>
<img src="{$ENV.DATAFACE_URL}/images/edit.gif"/>
<a href="{$ENV.DATAFACE_SITE_HREF}?-table=visits&need_interview==1&interviewer==&
date_of_visit=={$mydate} &-action=list">List waiting for interviews:</a>
</li>


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
shardison
 
Posts: 24
Joined: Wed Aug 08, 2012 12:09 pm

Re: url conventions and date calculations

Postby 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.

http://www.smarty.net/docsv2/en/languag ... ate.format
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 23 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved