Joomla 后端核心是如何工作的?
在 Joomla 后端,管理员可以使用 GUI 进行修改。
假设模块已启用(只需单击复选框)。
php 级别会发生什么?(代码会发生什么?)
我提出的一些微不足道的假设是,
-评论/取消评论
-添加/删除了一些代码片段
-配置(例如:xml)文件被修改/创建
In the Joomla back-end, the administrator would do modifications using the GUI.
Say a module is enabled(just click the check box).
What happens in php-level?(what happens to the code?)
Some trivial assumptions I come up with are,
-commenting/uncommenting
-some code snippets are added/removed
-configuration(ex: xml) files are modified/created
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Joomla 本身并没有真正修改磁盘上的文件。我能想到的唯一例外是:
区域(和前端)的所有其他配置更改、输入的数据等都存储在 Joomla 数据库中。
因此,给出的示例(启用/禁用模块)不会编辑或创建任何文件。它仅对核心数据库表(
jos_modules
,如果您的数据库前缀是“jos_”)进行更改。正如 @Hanny 提到的,所有页面上的模块包含都会根据模板中的代码根据页面加载进行动态评估。Joomla itself doesn't really modify files on disk much at all. The only exceptions I can think of are:
All other configuration changes, entered data, etc from the admin area (and frontend) are stored in the Joomla database.
So the example given (enabling/disabling a module) doesn't edit or create any files. It only makes changes in a core database table (
jos_modules
, if your DB prefix is 'jos_'). Module inclusion on all pages is dynamically evaluated per page-load based on the code in your template, as @Hanny mentions.如果您阅读正在使用的模板中的 index.php 文件 - 您会发现模板的所有位置都包含在该文件中
或者类似的东西就是它会说的。通常,模板使用 CSS 来帮助确定如何根据启用的模块以及 php 级别的“if、then、else”语句来“塑造”页面。仔细阅读 index.php 文件,您可能会看到这一点。
如果“module10”则使用“rightmodule.css”类型的东西 - 然后它可能会保存对某些包含 div 的宽度和此类东西进行的更改。
不会发生注释/取消注释,不会添加任何代码片段,也不会修改/创建任何配置文件(至少据我所知,而且我之前曾为 Joomla 设计过一个组件)。这都是 if 语句,并将其与模板 index.php 文件中布置的模块位置联系在一起。
这是一个简化的答案,但我认为它回答了您的问题。
If you read the index.php file in of the template you're using - you'll find that all the positions of the template are included in that file
<jdoc include="position10" />
or something of that nature is what it will say.Usually the templates use CSS to help determine how to 'shape' the page depending on which modules are enabled, along with 'if,then,else' statements on the php level. Read through the index.php file and you'll probably see that.
if "module10" then use "rightmodule.css" type thing - which then may hold changes to be made to certain containing div's with regards to width and that sort of thing.
No commenting/uncommenting happens, no code snippets are added and no configuration files are modified/created (at least as far as I know, and I've worked to design a component for Joomla previously). It's all if statements and tying that together with the module positions that are laid out in the templates index.php file.
This is a simplified answer, but I think it answers what you've asked.