开发者

Magnet links and CakePHP's Html Helper

开发者 https://www.devze.com 2023-02-27 11:23 出处:网络
I want to be able 开发者_C百科to create a magnet link using CakePHP\'s Html Helper. How would I go about doing that?

I want to be able 开发者_C百科to create a magnet link using CakePHP's Html Helper. How would I go about doing that?

I've already tried something like:

<?php
echo $this->Html->link($name, 'magnet:.....');
?>

My point: CakePHP sees anything that does not start with 'http://' as a relative URL. At least that's what the manual states.

Of course I could go and hammer (filter) out the 'http://' after having put it there before the 'magnet'-part.

But is there some (better) way for this without resorting to non-CakePHP-assisted HTML code?


You're forcing something that you don't need to do. The largest draw to using Cake's $html->url() function is to quickly and easily generate dynamic urls that work with Cake's routing. That has little to do with magnet urls. I'd say just go old-school here.

<a href='magnet:<?php echo $magnet_url; ?>'>Magnet Link</a>
0

精彩评论

暂无评论...
验证码 换一张
取 消