horst Posted February 15, 2021 Share Posted February 15, 2021 Hey, I know I used it already somewhere but can not remember / find it now. ? Within an Inputfield in a PageEditor, it can be important to detect if the inputfield is on the base page or on a repeater item. Exactly I need to get the precise name of the field. For example if a user named his field foo, I can get the name by calling $this->hasField->name from within my inputfield module. When the field is on a repeater, its final name is not foo but foo_repeater1234. That's what I'm after. What method(s) can help me to get this from within the inpufield module? Link to comment Share on other sites More sharing options...
Robin S Posted February 16, 2021 Share Posted February 16, 2021 I think what you're looking for is the "name" attribute. So if $inputfield is an Inputfield object: $inputfield->name // The name of the input element within the form, which has a suffix when inside a repeater $inputfield->hasField->name // The name of the corresponding field (if the inputfield is associated with a field) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now