Привет, я новичок в Joomla. Мне нужна динамическая ссылка в файле представления.
</p>
<p>//no direct access
defined('_JEXEC') or die('Direct Access to this location is not allowed.');</p>
<p>// include the helper file
require_once(dirname(<strong>FILE</strong>).DS.'helper.php');</p>
<p>// get a parameter from the module's configuration</p>
<p>$userCount = 5;</p>
<p>// get the items to display from the helper
$items = ModNewHelper::getItems($userCount);</p>
<p>//link of the component</p>
<p>// include the template for display
require(JModuleHelper::getLayoutPath('mod_new'));</p>
<p>this is main file</p>
<p>/**
* @author Raju Gautam
* @copyright 2011
*/</p>
<p>defined('_JEXEC') or die('Direct Access to this location is not allowed.');</p>
<p>class ModNewHelper
{
/**
* Returns a list of post items
*/
public function getItems($userCount)
{
// get a reference to the database
$db = &JFactory::getDBO();</p>
<pre><code> // get a list of $userCount randomly ordered users
$query = 'SELECT name,id FROM `#__hello` ORDER BY ordering LIMIT ' . $userCount . '';
$db->setQuery($query);
$items = ($items = $db->loadObjectList())?$items:array();
return $items;
} //end getItems
</code>
} // end ModHelloWorld2Helper
это вспомогательный файл
определено (' JEXEC') или умереть ('Ограниченный доступ'); // нет прямого доступа
echo JText :: («Последние новости»);
// echo "
"; print_r($items); exit;</p>
<p>foreach ($items as $item) { </p>
<code> <a href="#"> echo JText::sprintf($item->name); </a>
</code>
} это файл просмотра
Мне нужна ссылка на echo JText :: sprintf ($ item-> name); эта линия. Могу ли я помочь, пожалуйста?