Codeigniter 关于创建后端的建议

发布于 2024-12-11 10:09:25 字数 431 浏览 0 评论 0原文

我想基于 codeigniter 制作一个非常小的 CMS。

我想从更有经验的开发人员那里得到一些建议。

我浏览了很多论坛,什么是最好的方法,但我遇到的更像是争论而不是提供有用的信息。

所以我想做的事情对我来说似乎是合乎逻辑的,将后端和前端分开。

你认为这是个好主意吗?

文件夹结构

[frontend]
  / controllers
  / views
  / models

[backend]
  / config
  / controllers
  / views
  / models
[sysetem]
index.php

我正在考虑另一种结构,比如在控制器、模型和视图中创建一个管理文件夹,但我有点害怕。

那么如果可能的话有人可以给我一些建议吗?

谢谢

I wold like to make a really small CMS based on codeigniter.

And i would like to get some advice from a more experienced developer.

I was reading through a lot of forums, what would be the best way but i bumped in more like of arguing rather than giving useful info.

So what i would like to do that seems logical to me that have the backend and frontend separated.

Do you think is a good idea?

folder structure

[frontend]
  / controllers
  / views
  / models

[backend]
  / config
  / controllers
  / views
  / models
[sysetem]
index.php

I was thinking another one, like creating an admin folder in the controllers, models and views but I'm a bit scared of that.

So could someone give me some advice if its possible?

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半﹌身腐败 2024-12-18 10:09:25

否 您应该在每个控制器、模型和视图文件夹中单独创建管理文件夹。这是一个很好的做法。这将使您更轻松地访问控制器、视图和模型,因为它们将具有集中的单个文件夹。

您的目录结构应该是这样的:

[system]
index.php

[controllers]
   [admin](backend)
   [frontend]

[models]
   [admin](backend)
   [frontend]

[views]
   [admin](backend)
   [frontend]

拥有这样的目录结构不是一个好主意,它会使它变得更加复杂:

[frontend]
  / controllers
  / views
  / models

[backend]
  / config
  / controllers
  / views
  / models
[sysetem]
index.php

希望这会有所帮助。

No You should create admin folder separatly in each controllers, models and views folders. Thats is a good practice. This will make it easier for you to access your controllers, views and models as they will have a centralized single folders.

You should have your directory structure like this:

[system]
index.php

[controllers]
   [admin](backend)
   [frontend]

[models]
   [admin](backend)
   [frontend]

[views]
   [admin](backend)
   [frontend]

Having directory structure like this is not a good idea and it will make it more complex:

[frontend]
  / controllers
  / views
  / models

[backend]
  / config
  / controllers
  / views
  / models
[sysetem]
index.php

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文