在joomla中获取组件内容 [英] Get component content in joomla

查看:113
本文介绍了在joomla中获取组件内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个系统插件,我需要一种将html放在任何组件之前以及标头,菜单等之后的方法.换句话说,我需要将html放在模板中:

I'm making a system plugin and I need a way to put html before any components and after header,menu ecc. in other words I need to put html before this in template:

<jdoc:include type="component" />

谢谢

推荐答案

我找到了我需要的东西:

I found what I need:

  // get the document object.
  $doc = JFactory::getDocument();

  // get the buffer
  $buffer = $doc->getBuffer('component');

  // your string to insert
  $insert_string = "<p>I've been inserted</p>";

  // insert the string
  $buffer = $insert_string . $buffer;

  // reset the buffer
  $doc->setBuffer($buffer, 'component');

这篇关于在joomla中获取组件内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆