3212 Posts in 847 Topics by 809 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 400 Views |
-
How to formulate <% if $File %>

13 September 2011 at 10:38pm Last edited: 14 September 2011 1:16am
Hello,
I am wondering how to formulate the following:
I am using uploadify to upload files, and it works, but now in template i need the <% if $File %> as in If $File is uploaded then show sth, if not don't
how would you do it? Asking cause
<% if $Rezultati %>
<p>Rezultati izazova:</p>
<p> <a href="$Razultati.URL">Rezultati</a></p>
<% end_if %>$Rezultati being the $File, doesn't work
EDIT:
Been trying with return file_exists($this->Rezultati); in some function but it doesn't work also, always returns bool(false) so I rly don't know how to check if there is a file uploaded or not.
-
Re: How to formulate <% if $File %>

13 September 2011 at 10:46pm
For <% if %> you don't need to include the $ symbol i.e <% if Rezultati %>
-
Re: How to formulate <% if $File %>

13 September 2011 at 11:47pm Last edited: 14 September 2011 1:46am
Yes, I have tried that, but for some reason that ALWAYS returns false value (even for one test challenge i uploaded sth in $Rezultati) and the text inside <% if %> , along with download link for the $Rezultati file is never displayed.
EDIT:
Been trying with return file_exists($this->Rezultati); in some function but it doesn't work also, always returns bool(false) so I rly don't know how to check if there is a file uploaded or not.
EDIT2:
works, had a typo in filename
-
Re: How to formulate <% if $File %>

3 November 2011 at 12:55pm
You should be able to test if a file exist by addin ID to the Object.
Please try (untested):<% if RezultatiID %>
<p>Rezultati izazova:</p>
<p> <a href="$Razultati.URL">Rezultati</a></p>
<% end_if %>
| 400 Views | ||
|
Page:
1
|
Go to Top |



