|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
starsin Smarty n00b
Joined: 08 Feb 2004 Posts: 1
|
Posted: Sun Feb 08, 2004 4:41 pm Post subject: include_php: include a remote php file? |
|
|
hi
i am using smarty and i want to include some php file from other server. can i use include_php function to do that? if not how shoud i solve my problem? on maybe i can not do it in smarts?
is it possible to include remote html file?
thx 4 ur help |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Sun Feb 08, 2004 11:47 pm Post subject: Re: include_php: include a remote php file? |
|
|
starsin wrote: | i am using smarty and i want to include some php file from other server. can i use include_php function to do that? if not how shoud i solve my problem? on maybe i can not do it in smarts? |
AFAIK include_php cannot include files via http directly. include_php uses the same resource-mechanism that is used for retrieving templates. you could write a resource-plugin that fetches resources via http, then you can use such resources in the file-attribute of {include} or {include_php}.
an easier way would be using php:
{php} include("http://...'); /* use url_fopen_wrapper */ {/php}
or write a custom-plugin that contains the include-call:
function smarty_function_my_include($params, &$smarty) { include($params['file']); }
Quote: | is it possible to include remote html file? | .
yes, you can use the {fetch}-plugin for that: http://smarty.php.net/manual/en/language.function.fetch.php |
|
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
|