 |
Smarty
The discussions here are for Smarty, a template engine for the PHP programming language. Dedicated server web hosting provided by Guru-host.eu. |
| View previous topic :: View next topic |
| Author |
Message |
bimal Smarty Elite

Joined: 19 Apr 2007 Posts: 345 Location: Kathmandu, Nepal
|
Posted: Sun Jul 04, 2010 11:11 am Post subject: callable modifier |
|
|
I have problems using below codes:
| Code: | | {'http://www.smarty.net'|print} |
The callables (print, echo) were probably working in older versions of Smarty, and now, not.
Unfortunately, print_r works. Please note that I am using immediate, hard quoted values, like in this example, 'http://www.smarty.net' instead of a variable like $domain. (I needed this to avoid dreamweaver downloading the images from a real website, in my case.)
In the error message, I see:
| Code: | | unknown modifier "print"' |
Any help? _________________ Project Manager and Senior Programmer (Bimal Poudel)
Smarty Framework - use it now
Sanjaal Corps, Organized freelancing provider
Hire me in oDesk immediately | Professional support | Personal URL |
|
| Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 2318 Location: Hamburg / Germany
|
Posted: Sun Jul 04, 2010 7:57 pm Post subject: |
|
|
I think print and echo did never work as modifier as they are language constructs and no real function. is_callable() does return false for print and echo.
It did not work with Snarty2 either. |
|
| Back to top |
|
bimal Smarty Elite

Joined: 19 Apr 2007 Posts: 345 Location: Kathmandu, Nepal
|
Posted: Sun Jul 04, 2010 8:18 pm Post subject: It did not work earlier. |
|
|
They may not work in the earlier version. But I found a solution with:
| Code: | {assign var='domain' value='http://www.domain.com'}
...style="background-image:url({$domain}/data/thumbnails/{$thumbs[t].cat_id}/{$thumbs[t].image_code}.jpg)"... |
just instead of:
| Code: | | ...style="background-image:url({'http://www.domain.com'|print}/data/thumbnails/{$thumbs[t].cat_id}/{$thumbs[t].image_code}.jpg)"... |
There is no real need for this work. But when I switch to the design mode, Dreamwever tries to download the real images from the server. And using this small tweak, it fails - saving the download time. _________________ Project Manager and Senior Programmer (Bimal Poudel)
Smarty Framework - use it now
Sanjaal Corps, Organized freelancing provider
Hire me in oDesk immediately | Professional support | Personal URL |
|
| Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 2318 Location: Hamburg / Germany
|
Posted: Sun Jul 04, 2010 8:28 pm Post subject: |
|
|
| Why do you need {'http://www.domain.com'|print} at all and not simply {'http://www.domain.com'} ? |
|
| Back to top |
|
bimal Smarty Elite

Joined: 19 Apr 2007 Posts: 345 Location: Kathmandu, Nepal
|
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|