-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new feature: using model methods for table render with custom formatting. #19
base: master
Are you sure you want to change the base?
Conversation
Usage example: $builder = $this->getDI()->get('modelsManager')
->createBuilder()
// если нужны коллбеки, то не использовать!
//->columns('id, name, email, status, created_at')
->from('Phalcon\UserPlugin\Models\User\User');
$columns = [
'id', 'name', 'email', 'status', ['created_at' => ['tableCreatedAt' => ['d.m.Y H:i']]]
];
$dataTables = new \DataTables\DataTable();
$dataTables->fromBuilder($builder, $columns)->sendResponse(); In User model public function tableCreatedAt($format = 'd.m.Y H:i:s')
{
return date($format, strtotime($this->created_at));
} |
…assigned to any field Example['actions' => ['tableActions' => ['param']], 'fake' => true]
Is this work with I don't think so! |
@mzf i test it but i can't get anything! It dosn't work! |
@alimo2 work only with builder |
@mzf if we have a join & custom format method is in joint table model, what should i do ? when using |
Would you please fix this |
I think the problem is with using * in columns don't work either! |
For existed issue #7