new problem : )
my funtion
function showPDF($id) {
$record = DataObject::get_by_id("File", $id);
return $record;
}
in template
<% if PDFID %>
<% control showPDF() %>
<a href="$Filename"><img src="/themes/tutorial/images/pdf_ikon.gif" width="32" height="32" /></a>
<% end_control %>
<% end_if %>
and everything works great when i execute showPDF like this: <% control showPDF(204) %>
but when i have: <% control showPDF($PDFID) %> i got an error:
Parse error: syntax error, unexpected '}' in C:\Windows\Temp\silverstripe-cacheC--serwer-strony-ernesto\.cacheC..serwer.strony.ernesto.themes.tutorial.templates.Layout.EnPielgrzymkaPage.ss on line ....
$PDFID is variable form database