XenConcept
Well-known member
Hello,
I have a worry. I add a column "views count" but I get the following error:
Entity :
Modification Template :
Dump :
I have a worry. I add a column "views count" but I get the following error:
Entity :
PHP:
class ResourceItem extends XFCP_ResourceItem
{
public static function getStructure(Structure $structure)
{
$structure = parent::getStructure($structure);
$structure->columns['views_count'] = ['type' => self::UINT, 'default' => 0, 'forced' => true];
return $structure;
}
}
Modification Template :
Code:
$0
<dl class="pairs pairs--justified structItem-minor structItem-metaItem structItem-metaItem--views">
<dt>{{ phrase('views') }}</dt>
<dd>{$resource.views_count|number}</dd>
</dl>
Dump :