Have an account? Sign in
Login  Register  Facebook
i have suggest about raintpl
hello,
now i want make my copyright in the footer
but i want it dynamic
such as
Copyright © 2008-<?php echo date(\"Y\"); ?>.
its works by the PHP now i cant make it in the RAINTPL because i must assign the Y in the PHP file first i mean php file
$tpl->assign(\"Y\",\"Y\");
to use it in the html
Copyright © 2008-{$Y|date}.
this becuase
{$var|function_name:par_1,par_2}
is there any way to make it
{\"Y\"|date}
Started: September 15, 2011 Latest Activity: November 2, 2011 raintpl php
2 Answers
Another solution that works, but make ugly your template code:
{if condition=\"$year=date(\'Y\')\"}{/if}
Copyright 2008-{$year}

Posted: raintpl
In: September 15, 2011

good work
November 2, 2011

its not important to make it like that {\"Y\"|date}
according to:
raintpl_1.7.6/example.php on line 28
the programmer made it by differant way.
you can make it like that
$tpl->assign( \'copyright\', \'Copyright 2008-\'.date(\"Y\") );
and see also you can make a function like this
function templete_date($value,$format = \'M jS, Y\'){
return date($format,$value);	
}
and in tpl use
{$date|templete_date}

Posted: MacOS
In: September 15, 2011

Your Answer

xDo you want to answer this question? Please login or create an account to post your answer