Kohana之URL篇
<?php echo URL::base()."<br>"; echo URL::base(TRUE)."<br>"; echo URL::base(TRUE,"http")."<br>"; #out /* / /index.php/ http://localhost:805/index.php/ */
不解释啦~上面那个
<?php $query = URL::query(array('sort' => 'title', 'limit' => 10));
#out
"?sort=title&limit=10"
生成站点地址(链接都用这个开始,以后好升级~),我常弄到视图里用,方便~
<?php echo URL::site('foo/bar');
#out
/index.php/foo/bar
标题用-链接(没什么用)
<?php echo URL::title('My Blog Post'); // "my-blog-post"


浙公网安备 33010602011771号