我可以通过使用“articles”轻松地将 Joomla 转换为单独的 php 脚本的精美包装吗?嵌入 html/javascript 吗?

发布于 2024-12-23 12:14:00 字数 788 浏览 1 评论 0原文

我这么问是因为我在网上看到有人说“joomla 很糟糕,因为使用 joomla 制作网络应用程序很困难,因为我的草坪上的 API/架构/文档/人员很差”。然后这些人谈论切换到 drupal、ExpressionEngine 或其他一些据称对 Web 应用程序更友好的系统。

因此,我考虑了以下(也许是天真的)简单的方法来制作一个基于 joomla 的具有任意复杂性和功能的 Web 应用程序。首先,我将应用程序编写为独立的 php 脚本。我识别出其中所有不同的页面/表单,并在 joomla 中创建相应的“文章”。所以也许如果我正在制作一个“论坛”网络应用程序,我会有一个主题列表“文章”、主题“文章”和编辑帖子“文章”。现在,我不再让这些文章成为 joomla 数据库中可通过 joomla 逻辑编辑的相对静态的文本片段,而是使用单独的 php 脚本(实际的 Web 应用程序)直接输出任何 html(或文本,或 smarty - 无论哪种抽象级别最好)进入joomla数据库中相应的文章文本记录。当然,如果该页面中有一个名为“提交”的按钮,它不会提交给 joomla,而是提交给我的脚本,很可能通过 ajax,然后重新加载 (joomla) 页面,此时该页面已经由我的剧本。

因此,从某种意义上说,我刚刚摆脱了 joomla CMS 功能中“内容”的整个概念,而是将 joomla 变成了一个 shell 或包装器,用于显示我的脚本中的页面。同时我保留了 joomla 的主题、漂亮的管理面板、用户管理、媒体支持、自定义扩展等。

好的,n00b 理论就说这么多。现在,有人愿意戳破我的泡沫吗?人们不这样做有充分的理由吗?或者不应该这样做?或者这实际上是将 CMS 转变为 Web 应用程序的众所周知的方法之一?

I am asking because I have seen people say online along the lines of "joomla sucks because making a web app using joomla is hard due to poor API/architecture/docs/people on my lawn". Then these people talk about switching to drupal, ExpressionEngine or some other allegedly more webapp-friendly system.

So, I thought about the following (naively, perhaps) straightforward approach to making a joomla based webapp of arbitrary complexity and power. First I write my app as a standalone php script. I identify all of the distinct pages/forms I have in it and I create corresponding "articles" in joomla. So maybe if I am making a "forum" webapp I would have a topic list "article", topic "article" and edit post "article". Now, instead of having these articles be relatively static pieces of text in joomla database editable by joomla's logic, I have my separate php script (the actual web app) directly output whatever html (or text, or smarty - whichever abstraction level is best) into the corresponding article text record inside joomla's database. Naturally, if there is a button called "submit" in that page, it would submit not to joomla but rather to my script, most likely via ajax, and then reload the (joomla) page which by that time will have already been updated by my script.

So in a sense I have just gotten rid of the whole notion of "content" in joomla's CMS functionality and instead turned joomla into a shell or wrapper that displays pages from my script. Meanwhile I retain joomla's themes, nice admin panel, user management, media support, custom extensions etc.

Ok, so so much for the n00b theory. Now, would anybody like to burst my bubble? Is there a good reason why people don't do it like that? Or shouldn't do it like that? Or is this in fact one of the well known ways of turning a CMS into a web app?

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

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

发布评论

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

评论(2

西瑶 2024-12-30 12:14:00

如果您可以编写 PHP 代码,那么您最好先编写 MVC 扩展。使用 Joomla 框架的全部目的是避免编写框架已经处理的一些重复代码。您将制作一个应用程序,按照您在OP中描述的方式管理和扩展它会很痛苦。

任何说“joomla 很糟糕,因为使用 joomla 制作网络应用程序很困难,因为 API/架构/文档/我的草坪上的人很差”的人都没有看过 Joomla,因为它是 v1.0 或者他们不知道它们是什么谈论。 Joomla 有一个记录良好的 API,可用于您能想到的任何事情。事实上,Joomla 中的类别/文章只是一个名为 com_content 的扩展,出于任何原因根本不需要使用。

花一点时间学习 API 和 MVC,您会很高兴您做到了。

API - http://docs.joomla.org/JDOC:API_Reference_Project

MVC 组件 - http://docs.joomla.org/Developing_a_Model-View-Controller_Component__-_Part_1

If you can code PHP, then you are better off just writing an MVC extension to begin with. The whole point of using the Joomla framework is to avoid having to write some of the repetitive code that is already handled by the framework. You'd be making an app that would be a pain to administer and extend doing it the way you described in the OP.

Anyone that says "joomla sucks because making a web app using joomla is hard due to poor API/architecture/docs/people on my lawn" hasn't looked at Joomla since it was v1.0 or they don't know what they are talking about. Joomla has a well documented API that can be used for anything you can come up with. In fact, the categories/articles in Joomla are just an extension called com_content and don't need to used at all for any reason.

Spend a little time learning the API and MVC and you will be happy you did.

API - http://docs.joomla.org/JDOC:API_Reference_Project

MVC Component - http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1

谷夏 2024-12-30 12:14:00

不确定这是否是一个好主意,但阅读你所做的事情让我想起了 Joomla 框架

人们可能不修改 CMS 的原因之一可能是因为他们可以使用该框架来构建他们需要的内容。我认为对于初学者来说,你的方法可能更容易,但由于我自己也是初学者,我不能真正说这是否是一个好主意。

摘自他们的页面

Joomla 平台是一个用于编写 Web 和命令行的平台
PHP 中的应用程序。它是免费的开源软件,分布式
根据 GNU 通用公共许可证版本 2 或更高版本。乔姆拉
内容管理系统 (CMS) 构建在 Joomla 之上
平台。

据我了解,您可以获得网络应用程序所需的基本要素,但仍然可以使用 Joomla 插件扩展。

更多信息请点击这里
http://docs.joomla.org/Platform/11.1
在这里
http://docs.joomla.org/How_to_create_a_stand-alone_application_using_the_Joomla!_Platform

Not sure if it is a good idea or not, but reading what you are doing reminded me of the Joomla Framework

One of the reasons people may not be modifying the CMS could be because they can use the framework to build what they need. I think for a beginner, your method maybe easier, but since I'm a beginner myself I can't really say if it is a good idea or not.

Taken from their page

The Joomla Platform is a platform for writing Web and command line
applications in PHP. It is free and open source software, distributed
under the GNU General Public License version 2 or later. The Joomla
Content Management System (CMS) is built on top of the Joomla
Platform
.

From what I understand you get the bare essentials needed for your web app, but can still use Joomla plugin extensions.

More info here
http://docs.joomla.org/Platform/11.1
and here
http://docs.joomla.org/How_to_create_a_stand-alone_application_using_the_Joomla!_Platform

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