-
Notifications
You must be signed in to change notification settings - Fork 111
Action Executor ignores field value for the preview function #969
Copy link
Copy link
Closed
Labels
Description
When action defines fields=['name'] - executor asks for that name and sets it before executing action (as expected)
If you have a preview, however, the value is not set for the preview:
Code:
class Client extends Model
{
public $table = 'client';
public function init()
{
parent::init();
$this->addField('name');
$this->addAction('send_statement', [ 'fields'=>['name'], 'preview'=>'send_statement_preview']);
}
public function send_statement_preview() {
return 'here goes your statement '.$this['name'];
}
public function send_statement() {
/*
if (!isset($this->app->mailer)) {
throw new ValidationException('ouch');
}
*/
return 'sent to '.$this['name'];
}
}
Reactions are currently unavailable




