frontiex

So from what I read, are extensions usually only used to extend a single class while traits can be used to add functionality to multiple classes?

👍 (1)
frontiex

Right and it seems like DataExtensions can be used to introduce new methods without having to actually change the code of the class you’re modifying through the config layer? While traits, you need to use a use statement in the class you’re changing? Is that correct?

frontiex

Hey, just wanted to ask if anyone could explain the use case/differences between using Traits and Extensions in SilverStripe? 🙂 They seem to do similar things, but I’m pretty sure they’re different (just not sure how) 😅

frontiex

Its not too bad, issue is its syntax is more verbose than some of the other languages, meaning you have to type more code

frontiex

@StefanO I remember doing something similar but can’t remember the correct syntax. i think it was something along the lines of $Fields.FieldByName('SomeName')

👍 (1)
frontiex

Did you want the Member class to be separate from the ExtendedMember class?

frontiex

@StefanO Did you use a data extension to extend the member class?

frontiex

Hello, in SearchForm in the CMS, is there a way I can override $classesToSearch? Would a DataExtension or Injector be the way to go?

Files: Requires logging in with Slack to view/download
Pasted image at 2019-01-10, 12:16 PM