</body> </html> PRE; $t = new \ebi\Template(); $t->media_url('http://localhost/resources'); eq($result, $t->get($src)); $result_secure = <<<PRE <html> <body> \t<a href="http://localhost/resources/abc/def.html">link</a> \t<img src="https://localhost/resources/media/xyz.jpg" /> </body> </html> PRE; $t = new \ebi\Template(); $t->media_url('http://localhost/resources'); $t->secure(true); eq($result_secure, $t->get($src)); // imgはhttpsになる // URLが関数の場合 $link = function ($p) { return 'http://localhost/resources/' . $p; }; $src = <<<PRE <html> <body> \t<a href="{$link('abc/def.html')}">link</a> \t<img src="{$link('media/xyz.jpg')}" /> </body> </html> PRE;