خرید بک لینک

Vote count: 0

I want to open profile page like www.website.com/slim/useame (where useame is unique) .

I am currently using slim php framework for routing GET requests. So when I open " www.website.com/profile/useame " it properly executes the route defined for '/useame' and gives simple json response like this

{"users":[{"id":"01","firstname":"kamron","lastname":"shaw","gender":"male","status":"Offline"}]}

From this point I wanted to integrate this data with the profile page template, so I made a profile page template at www.website.com/profile.php and from there used ajax to make a GET request to
" www.website.com/slim/useame " and receive data and display it with template.

Problem is that if a user navigates directly to " www.website.com/slim/useame ", he will only see the raw JSON response.

I want users to see the JSON response with template when they directly make a GET request from there browser.

How can I achieve this? Please correct me if I am wrong anywhere and tell me a suitable way of doing this.

Thanks.

asked 36 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 10 فروردين 1395 ساعت: 19:14

صفحه بندی