在php中使用带有表的jtext

时间:2017-08-07 07:02:41

标签: php joomla

我的joomla网站中有一个模块,显示一个包含一些元素的表,我想用joomla jtext helper将这个模块本地化为英语; 默认代码是:

<table dir="rtl" id="gold-table" class="table table-hover table-responsive" style="margin-bottom: 0"><thead><tr><?php



if($title == 'true'  ){echo '<th data-field="forks_count" data-sortable="true">'. 'عنوان محصول'.'</th>' ;}

if($code == 'true')   {echo '<th>'. 'کد محصول'.'</th>'  ;}

if($cat == 'true')    {echo '<th>'. 'مجموعه محصول'.'</th>'  ;}

if($grade == 'true')    {echo '<th>'. 'گرید محصول'.'</th>'  ;}

if($unit == 'true')    {echo '<th>'. 'واحد قیمت گذاری'.'</th>'  ;}

if($packing == 'true')    {echo '<th>'. 'بسته بندی محصول'.'</th>'  ;}

if($ryal == 'true')   {echo '<th>'. 'قیمت ریالی'.'</th>'  ;}

if($dollar == 'true') {echo '<th>'. 'قیمت دلاری'.'</th>'  ;}

if($pdate == 'true')  {echo '<th>'. 'تاریخ'.'</th>'  ;} ?>

我试图将波斯语单词更改为jtext以使用覆盖功能使其使用以下代码多语言但我收到错误

   <table dir="rtl" id="gold-table" class="table table-hover table-responsive" style="margin-bottom: 0"><thead><tr><?php



if($title == 'true'  ){echo '<th data-field="forks_count" data-sortable="true">'. 'JText::_( 'COM_PROD_TITLE' );'.'</th>' ;}

if($code == 'true')   {echo '<th>'. 'JText::_( 'COM_PROD_SKU' );'.'</th>'  ;}

if($cat == 'true')    {echo '<th>'. 'JText::_( 'COM_PROD_CAT' );'.'</th>'  ;}

if($grade == 'true')    {echo '<th>'. 'JText::_( 'COM_PROD_GRADE' );'.'</th>'  ;}

if($unit == 'true')    {echo '<th>'. 'JText::_( 'COM_PROD_UNIT' );'.'</th>'  ;}

if($packing == 'true')    {echo '<th>'. 'JText::_( 'COM_PROD_PAKING' );'.'</th>'  ;}

if($ryal == 'true')   {echo '<th>'. 'JText::_( 'COM_PROD_IRR' );'.'</th>'  ;}

if($dollar == 'true') {echo '<th>'. 'JText::_( 'COM_PROD_DLR' );'.'</th>'  ;}

if($pdate == 'true')  {echo '<th>'. 'JText::_( 'COM_PROD_DATE' );'.'</th>'  ;} ?>

感谢您的光临。

1 个答案:

答案 0 :(得分:0)

我认为你不要划定JText:

<table dir="rtl" id="gold-table" class="table table-hover table-responsive" style="margin-bottom: 0"><thead><tr><?php

if($title == 'true'  ){echo '<th data-field="forks_count" data-sortable="true">'. JText::_( 'COM_PROD_TITLE' ).'</th>' ;}

if($code == 'true')   {echo '<th>'. JText::_( 'COM_PROD_SKU' ).'</th>'  ;}

if($cat == 'true')    {echo '<th>'. JText::_( 'COM_PROD_CAT' ).'</th>'  ;}

if($grade == 'true')    {echo '<th>'. JText::_( 'COM_PROD_GRADE' ).'</th>'  ;}

if($unit == 'true')    {echo '<th>'. JText::_( 'COM_PROD_UNIT' ).'</th>'  ;}

if($packing == 'true')    {echo '<th>'. JText::_( 'COM_PROD_PAKING' ).'</th>'  ;}

if($ryal == 'true')   {echo '<th>'. JText::_( 'COM_PROD_IRR' ).'</th>'  ;}

if($dollar == 'true') {echo '<th>'. JText::_( 'COM_PROD_DLR' ).'</th>'  ;}

if($pdate == 'true')  {echo '<th>'. JText::_( 'COM_PROD_DATE' ).'</th>'  ;} ?>