Closed evskorobogatij closed 4 years ago
Hi,
There is no attribute named people
in your Petition
entity.
Replace ['field' => 'people.lastname']
by ['field' => 'autor.lastname']
.
By the way, autor
is misspelled. It should be author
(with a h
).
Thank
And what must I do to output concatenated string like:
->add('author',TextColumn::class,["field" => "author.fam+author.im"])
?
People entity have __toString()
method, can I output his result into datatable column?
You can use the render
option to have full control over the output.
->add('author', TextColumn::class, [
'field' => 'author.lastname',
'render' => static function(string $value, Petition $petition): string {
return $petition->getAuthor()->getFirstName() . ' ' . $petition->getAuthor()->getLastName();
// return (string) $petition->getAuthor()
}
])
See the Columns section in the documentation.
Thank you very much
Hi!
I have 2 entity:
Petition:
People
Then in controller I try to out table on page:
But I get an error
Association name expected, 'people' is not an association
What must I do to resolve this?