会员网站 codeigniter
我是 codeigniter 的新手。我被要求建立一个-dooid-like-site 或-aboutme 是我当地大学的类似网站,这样他们就可以制作自己的身份证。我计划使用 codeigniter 构建这个网站,因为我听说 codeigniter 是最容易理解的,而且我没有超过 2 周的时间来完成任务。
我的问题是:
如果 dooid 是用 codeigniter 构建的,我怎样才能创建一个函数 这允许人们选择他们的直接网址。我的意思是,如果我有一个 类“User”并且有一个“show”方法需要 “用户名”作为参数。 URL 应如下所示:
<块引用>www.Mysite.com/User/show/<用户名>
他们怎么能创建一个像这样的自己的网址:
<块引用>www.Mysite.com/<用户名>
我计划限制一些“方法”客人,这会 当用户登录站点时启用。我的意思是如果我有课 “user”有一个“edit_profiles”方法。客人可以看到 “show”方法,但登录用户将能够 登录后“edit_profiles”。在同一个班级。
- 你能告诉我codeigniter会话库类的概念吗?我对本机会话 php 感到困惑。有没有人可以向我展示一些包含将会话存储到数据库的会话类教程的链接?
i am newbie here in codeigniter. i was asked to build a-dooid-like-site or a-aboutme-like-site for my local college so they can make their own identity card. i plan building this website using codeigniter since i heard codeigniter is the most easy to understand and i dont have more than 2 weeks to complete the task.
my questions is :
if the dooid build up with codeigniter, how could i make a function
that allows people choosing their direct url. i mean, if i have a
class "User" and there is a "show" method that need
"username" as a parameter. the URL should seems like this one:www.Mysite.com/User/show/<username>
how could they make a their own url like this one:
www.Mysite.com/<username>
i plan to restrict some "method" guest and it will
be enabled when user login into site. i mean if i have a class
"user" there is a "edit_profiles" method. guest can see the
"show" method but logged in users will be able to
"edit_profiles" after login. on the same class.- can you tell me how the codeigniter session library class concept? i confused with native session php. is there anybody that can show me some links contains session class tutorial that stores session into databases?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这是可能的,请查看自定义路由的文档:
http://codeigniter.com/user_guide/general/routing.html
对于访问控制最简单的是使用预构建的登录库
例如 ionauth 或 tankauth 两者或提供
您需要的功能。
CI 使用的会话不使用 PHP 本机会话。最好的指南在文档中: http://codeigniter.com/user_guide/libraries/sessions.html 数据的存储位置由配置文件中的会话决定,并在文档中进行了描述。
Yes this is possible, look into the documentation for custom routes:
http://codeigniter.com/user_guide/general/routing.html
For access control it is simplest to use a prebuilt login library
such as ionauth or tankauth both or which provide the
features you'll require.
The sessions used by CI do not use PHP native sessions. The best guide is in the dosumentation: http://codeigniter.com/user_guide/libraries/sessions.html Where the data is stored is determined by the sessions in the config file and is described in the documentation.