Jump to content

Using tabs (WireTabs) in a module config


Robin S
 Share

Recommended Posts

  • 7 months later...
  On 8/18/2021 at 8:59 AM, netcarver said:

This requires a more recent version of PW than 3.0.165 - I'm currently using 3.0.182.

Expand  

Ta. The site is on 3.0.165. @Robin S's module is on 170. Hopefully a new core is out soon and I will move to that.

However, I am using this in my ProcessDbMigrate module (full alpha release shortly.... ?) and I have tried to make that compatible with 3.0.148 (even pre page class days). I'm not sure what the best policy is regarding the backwards compatibility of new modules.

Link to comment
Share on other sites

For the benefit of anyone else wanting their module to be comptible with earlier versions of PW, I suggest you use: 

$tab1 = $this->wire(new InputfieldWrapper());

not

$tab1 = $modules->get('InputfieldWrapper');

Also, do not use plain $tab1 = new InputfieldWrapper(); as the column widths of the contained inputfields will not work properly. Per the PW coding style guide:

  Quote

All newly-created objects that are derived from Wire SHOULD have their dependencies injected. In order to do this, pass the new object through the wire() method.

Expand  

 

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...