docs
docs copied to clipboard
Modifikator viditelnosti obsluhy komponenty
URL: https://doc.nette.org/cs/quickstart/comments
private function commentFormSucceeded(\stdClass $data): void
{
$id = $this->getParameter('id');
$this->database->table('comments')->insert([
'post_id' => $id,
'name' => $data->name,
'email' => $data->email,
'content' => $data->content,
]);
$this->flashMessage('Děkuji za komentář', 'success');
$this->redirect('this');
}
callback komponenty ma modifikator private a co som skusal moze byt len public, ani privat ani protected nie je spravne
Je potÅ™eba použÃt zápis $form->onSuccess[] = $this->commentFormSucceeded(...);