Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
解释PHPFox中的URL路由_Php_Url_Routing_Url Routing_Phpfox - Fatal编程技术网

解释PHPFox中的URL路由

解释PHPFox中的URL路由,php,url,routing,url-routing,phpfox,Php,Url,Routing,Url Routing,Phpfox,我正在为我的网站使用PHPFox。假设我想查看用户id为126的用户的配置文件。每当我点击任何用户名时,地址栏中就会出现以下URLhttp://34.144.60.142/profile-126/(对于用户id为126的情况。对于其他用户,对于用户id为244的用户,一些其他号码可能会显示为profile-244) 从上面的URL,我根本不了解如何处理配置文件请求和获取配置文件数据 有人能详细解释一下如何在PHPFox中完成路由吗 谢谢。这件事我已经知道了,但我的问题是如何使用哪些类和方法获取配

我正在为我的网站使用PHPFox。假设我想查看用户id为126的用户的配置文件。每当我点击任何用户名时,地址栏中就会出现以下URL
http://34.144.60.142/profile-126/
(对于用户id为126的情况。对于其他用户,对于用户id为244的用户,一些其他号码可能会显示为profile-244)

从上面的URL,我根本不了解如何处理配置文件请求和获取配置文件数据

有人能详细解释一下如何在PHPFox中完成路由吗


谢谢。

这件事我已经知道了,但我的问题是如何使用哪些类和方法获取配置文件数据?如果你能专注于这件事,那就太好了。$aRow=Phpfox::getService('user')->get($mUser,false);谢谢你的大力帮助。但我还有一个疑问。它对已登录和未登录的用户都有效。我是说登录后我能看到其他人的个人资料吗?还有一件事,我怎样才能得到关于其他用户与登录用户关系的数据?你可以在函数中传递特定用户的用户id或用户名。不,你没有明白我的意思。我想获取已登录用户与所有其他用户的关系状态。我该怎么得到这个?谢谢你的回答。但我想要的不止这些。我需要特定用户的自定义数据。如何得到它?你能简单地解释一下你刚才提到的获取用户配置文件的方式吗?这对我帮助很大。您可以从这个函数$aCustomFields=Phpfox::getService('custom')->getForEdit(数组('user_main','user_panel','profile_panel'),$iUserId,$iUserGroupId,false,Phpfox::getUserId())获取所有自定义数据;谢谢你的大力帮助。但我还有一个疑问。它对已登录和未登录的用户都有效。我是说登录后我能看到其他人的个人资料吗?还有一件事,我怎样才能得到关于其他用户与登录用户关系的数据?
actually when we didn't allow user name in registration then phpfox automatically set a user name "profile-user_id" for eg : if any user have user_id 126 then it's username must be "profile-126" and it's unique.

when you visit any user profile page like 

http://34.144.60.142/profile-126/

http://34.144.60.142/profile-244/

so phpfox fetch data from that username and particular profile will display.
on profile.index controller

system get user name by using this syntax

$mUser = $this->request()->get('req1');

now system fetch user data from user name by using predefine function.

$aRow = Phpfox::getService('user')->get($mUser, false);

this function exists in module/user/include/service/user.class.php service class.