Hi Vektor, and welcome to the Akelos forum!
Column names are provided by AkActiveRecord::getColumnNames() so you can override it in your controller like this:
function getColumnNames()
{
$column_names = parent::getColumnNames();
$column_names['name'] = $this->t('Company name');
return $column_names;
}
In case you don't want column name translations, you can just define the attribute _columnNames in your model with a column => description array
Regards,
Bermi
Ok, the sortable link generated by the scaffold uses the keys returned by getContentColumns(), try to use this instead in your views
$content_columns = $Post->getColumnNames();
In share model .php we can add this function in order that all models could use it
function getContentColumnsVariable($list)
{
$result=array();
$contact_column=$this->getContentColumns();
for($i=0;$i<count($list);$i++)
{
if (in_array($list[$i],$contact_column))
{
$result[]=$contact_column[$list[$i]];
}
}
return $list;
}
And the in the template file we can add this
<?php
$list=array('title','firstname','lastname','address','town','zip','telephone','email');
$content_columns = $Contact->getContentColumnsVariable($list);
?>
{loop contacts}
isn't this simply
array_intersect($list,$this->getContentColumns)
[or another of those hundreds of array_*-functions]
1 to 8 of 8