#cp.choices

Choices Module.


#Submodules


#API Overview

Functions - API calls offered directly by the extension

Methods - API calls which can only be made on an object returned by a constructor


#API Documentation

#Functions

Signaturecp.choices.new(type) -> choices
TypeFunction
DescriptionCreates a new cp.choices instance for the specified type.
Parameters
  • type - The unique ID for the type.
Returns
  • The new choices instance.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/choices/init.lua line 105

#Methods

Signaturecp.choices:getChoices() -> array of choices
TypeMethod
DescriptionReturns the array of choices that have been added to this instance.
Parameters
  • None
Returns
  • The array of choices.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/choices/init.lua line 157

Signaturecp.choices:new(choiceType) -> choices.builder
TypeMethod
DescriptionAdds a new choice with the specified.
Parameters
  • text - The text title for the choice.
Returns
  • The choice builder, added to the choices set.
Notes
  • Additional settings can be set using the returned builder instance. E.g.:
  • </li><li>choices:add("Do Something")</li><li> :subText("Cool Actions")</li><li> :params({</li><li> one = "foo",</li><li> two = "bar",</li><li> })</li><li>
ExamplesNone
Sourcesrc/extensions/cp/choices/init.lua line 127