From: sergey l. <ccp...@gm...> - 2012-09-30 11:40:54
Dear All!
I need to check in template if file exists.
What is the best practise to do this?
Example:
if (file_exists("<%= media %>/css/style.css")) {
<link href="<%= media %>/css/style.css" rel="stylesheet"
type="text/css" />
}
Thanks in advance!
do not do the check in the template - do the check in the method that calls
the template - and store the result of your check into the content object
you give to the view
you can even simply store the link url or the even the link element - and
hen remove the if from your template altogether
On Sun, Sep 30, 2012 at 1:40 PM, sergey lavrov <ccp...@gm...>wrote:
> Dear All!
>
> I need to check in template if file exists.
> What is the best practise to do this?
>
> Example:
> if (file_exists("<%= media %>/css/style.css")) {
> <link href="<%= media %>/css/style.css" rel="stylesheet"
> type="text/css" />
> }
>
> Thanks in advance!
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://ad.doubleclick.net/clk;258768047;13503038;j?
> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
--
--
lee
Lee Elenbaas
lee...@gm...