CodeIgniter路由特殊字符(CodeIgniter Routing special characters)

编程入门 行业动态 更新时间:2024-10-27 02:20:09
CodeIgniter路由特殊字符(CodeIgniter Routing special characters)

我正在尝试使用特殊字符编写CodeIgniter:

somepage.com/something#somethingelse

routes.php中的定义是:

$route['(:any)#(:any)'] = 'eshop/eshop/individual/$1/$2';

但它会引发我的错误:

消息:preg_match():未知修饰符'('

你有这方面的经验吗? 谢谢

I'm trying to make CodeIgniter with special character:

somepage.com/something#somethingelse

Definition in routes.php is:

$route['(:any)#(:any)'] = 'eshop/eshop/individual/$1/$2';

but it throws me error:

Message: preg_match(): Unknown modifier '('

Do you have any experience with this? Thank you

最满意答案

只要:

$route['(:any)'] = 'eshop/eshop/individual/$1';

在Javascript之后:

var hash = window.location.hash.substr(1);

Only:

$route['(:any)'] = 'eshop/eshop/individual/$1';

After in Javascript:

var hash = window.location.hash.substr(1);

更多推荐

本文发布于:2023-07-30 00:01:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1320805.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:路由   特殊字符   CodeIgniter   characters   special

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!