Example #1
0
 public function __construct()
 {
     parent::__construct();
     $label = new Label('text', new PropertyModel($this, 'text'));
     $label->setOutputMarkupId(true);
     $this->add($label);
     $self = $this;
     $this->add(new AjaxLink('alterLink', function (AjaxRequestTarget $target) use($self, $label) {
         $self->text = 'Update in callback text';
         $target->add($label);
     }));
 }
Example #2
0
 public function __construct()
 {
     parent::__construct();
     $feedback = new FeedbackPanel('feedback');
     $feedback->setOutputMarkupId(true);
     $this->add($feedback);
     $label = new Label('text', new PropertyModel($this, 'text'));
     $label->setOutputMarkupId(true);
     $this->add($label);
     $form = new Form('form');
     $this->add($form);
     $form->add(new RequiredTextField('text', new PropertyModel($this, 'text')));
     $self = $this;
     $form->add(new AjaxButton('button', function (AjaxRequestTarget $target) use($label, $feedback) {
         $target->add($label);
         $target->add($feedback);
     }, function (AjaxRequestTarget $target) use($feedback) {
         $target->add($feedback);
     }));
 }