snipt

Ctrl+h for KB shortcuts

PHP

Inject data into a module position

1
2
3
4
// Inject data from your component into the right module position
JFactory::getDocument()->setBuffer($data, 'modules', 'right');

// Note: Data will not be shown unless there are "real" modules present in position right
https://snipt.net/embed/59aaa7762502d28b3510bf05eeff312f/
/raw/59aaa7762502d28b3510bf05eeff312f/
59aaa7762502d28b3510bf05eeff312f
php
PHP
4
2019-07-12T21:39:20
True
False
False
/api/public/snipt/27729/
inject-data-into-a-module-position
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="x">// Inject data from your component into the right module position</span> </span><span id="L-2"><a name="L-2"></a><span class="x">JFactory::getDocument()-&gt;setBuffer($data, &#39;modules&#39;, &#39;right&#39;);</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="x">// Note: Data will not be shown unless there are &quot;real&quot; modules present in position right</span> </span></pre></div> </td></tr></table>
joomla, modules