Closed hoangtrongphuc closed 8 years ago
Add a variable $table_columns_name
in the $app->match('/access_logins', function () use ($app)
in file /web/controllers/MODULE/index.php
This variable need to be an array with all field display in your list page.
Exemple :
$table_columns = array(
'id',
'type_id',
'name',
'description',
'created_at',
'modified_at',
);
$table_columns_name = array(
'N°',
'Project',
'Type',
'Name',
'Description',
'Created at',
'Modified at',
);
Add "table_columns_name" => $table_columns_name,
in the return array.
Exemple :
return $app['twig']->render('MODULE/list.html.twig', array(
"table_columns" => $table_columns,
"table_columns_name" => $table_columns_name,
"primary_key" => $primary_key
));
In /web/view/MODULE/list.html.twig
Replace :
<thead>
<tr>
{% for table_column in table_columns %}
<th>{{ table_column }}</th>
{% endfor %}
<th>Actions</th>
</tr>
</thead>
By :
<thead>
<tr>
{% for table_column in table_columns_name %}
<th>{{ table_column }}</th>
{% endfor %}
<th>Actions</th>
</tr>
</thead>
Sorry for my english. Bye !
How to change column' name in table ?