View more context

 

kinglozzer

@Mo Anonymous classes seem to work, albeit not via add_extension(), just tested in a page controller:

  1. $page = $this->data();
  2. $page->extension_instances[] = new Class extends Extension {
  3. public function extensionTest() {
  4. die('hello');
  5. }
  6. };
  7. $page->extend('extensionTest');

Mo

@kinglozzer I am getting Indirect modification of overloaded property SilverCommerce\TaxAdmin\Tests\Model\TestProduct::$extension_instances has no effect

kinglozzer

That’s weird… I don’t know what might be overloading it 😬