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>
精彩评论