【问题标题】:Get the Contents of the Component Area Joomla获取组件区 Joomla 的内容
【发布时间】:2013-02-19 08:26:19
【问题描述】:

是否可以在内容插件中获取当前页面<jdoc:include type="component" />区域的内容,并用fwrite($ourFileHandle, $component);写入html文件

【问题讨论】:

  • 不确定,但可行的替代方法是将 包含在具有某些 id 的 div 中,然后使用插件的 javascript 捕获其内容并通过ajax 到一个 php 文件,它将内容保存到一个文件中。

标签: php html plugins joomla joomla2.5


【解决方案1】:

您可以通过将&tmpl=component 附加到资源URL 来提取组件内容。

例子:

http://example.com/index.php?option=com_yourcomponent&view=viewname&tmpl=component

【讨论】:

    【解决方案2】:

    是的,您有两个事件 onBeforeContentPrepare() 和 onAfterContentPrepare() 都保存组件的内容,您可以从那里登录到磁盘甚至更改内容。

    【讨论】:

      猜你喜欢
      • 2012-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多