[typo] Not wanting to reinvent the wheel

Denis Lamotte dlamotte at bamboo.lu
Mon Oct 3 13:59:10 EDT 2005


you can create your own dynamic include
with

require 'net/http'

@content_to_be_included = Net::HTTP.get_response("www.xxx.com","index.php")

Then you can use it as a var inside your template. Beware that If the 
page is not found or if any error occur you got the error code instead.

Lanfeust

Kevin Ballard wrote:
> No, it's not possible. That would require a round-trip through Apache  
> to evaluate the PHP file. The nearest you could do is an <iframe>  that 
> points to the PHP file as the source to load, which is far from  ideal.
> 
> On Oct 3, 2005, at 12:36 PM, gpshewan wrote:
> 
>> I know it's possible to run PHP scripts from within the public
>> directory.  Not wanting to reinvent the wheel every time I want to
>> test something,  is it possible to successfully include() a PHP file
>> from within the default.rhtml?  Or am I missing the mark by a country
>> mile?
>>
>> I'd prefer RoR functionality, but I still would like some legacy
>> functionality while I (or someone) else figures out how to recode
>> apps and scripts.
>>
>> It's been a really long day and I might not realise I'm trying to
>> bash a banana and an apple together to make an orange ... so be
>> gentle ;)
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Typo-list mailing list
> Typo-list at rubyforge.org
> http://rubyforge.org/mailman/listinfo/typo-list



More information about the Typo-list mailing list