手机
当前位置:查字典教程网 >编程开发 >php教程 >Yii2针对指定url的生成及图片等的引入方法小结
Yii2针对指定url的生成及图片等的引入方法小结
摘要:本文实例讲述了Yii2针对指定url的生成及图片等的引入方法。分享给大家供大家参考,具体如下:///index?r=site/ind...

本文实例讲述了Yii2针对指定url的生成及图片等的引入方法。分享给大家供大家参考,具体如下:

// /index?r=site/index echo Url::to(['site/index']); // /index?r=site/index&src=ref1#name echo Url::to(['site/index', 'src' => 'ref1', '#' => 'name']); // the currently requested URL echo Url::to(); // /images/logo.gif echo Url::to('@web/images/logo.gif'); // images/logo.gif echo Url::to('images/logo.gif'); // http://www.example.com/images/logo.gif echo Url::to('@web/images/logo.gif', true); // https://www.example.com/images/logo.gif echo Url::to('@web/images/logo.gif', 'https'); // /index?r=site/index echo Url::toRoute('site/index'); // /index?r=site/index&src=ref1#name echo Url::toRoute(['site/index', 'src' => 'ref1', '#' => 'name']); // http://www.example.com/index.php?r=site/index echo Url::toRoute('site/index', true); // https://www.example.com/index.php?r=site/index echo Url::toRoute('site/index', 'https'); echo Yii::$app->urlManager->createUrl('site/index')

希望本文所述对大家基于Yii框架的PHP程序设计有所帮助。

【Yii2针对指定url的生成及图片等的引入方法小结】相关文章:

php截取指定2个字符之间字符串的方法

通过对服务器端特性的配置加强php的安全

PHP生成指定随机字符串的简单实现方法

PHP获取数组的键与值方法小结

PHP生成plist数据的方法

php生成圆角图片的方法

PHP递归调用数组值并用其执行指定函数的方法

php实现修改新闻时删除图片的方法

PHP生成唯一订单号的方法汇总

PHP获取photoshop写入图片文字信息的方法

精品推荐
分类导航