Tuesday, August 25, 2015

Crud View pluging and related model fields

I started using crud-view plugin https://github.com/FriendsOfCake/crud-view

I have searched but cannot find answer to my problem. In index action I am listing all my fields I want to have:

$action->config('scaffold.fields', [
            'category.description' => ['title' => 'Κατηγορία'],
            'date' => [
                'title' => 'Ημε/νια',
                'formatter' => function ($name, $value, $entity) {
                    return $value->format('Y-m-d');
                }
            ],
            'description' => ['title' => 'Περιγραφή'],
            'url' => ['title' => 'Σύνδεσμος']
        ]);


category is a related model of the current model. The current model is Actions and belongsTo Categories.

I can see that crud plugin loads my Actions with categories being contained in the resultSet. But how can I change how the appear on Paginator?

Thanks

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: