This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Tschallacka
I have a relation between the model CarManager and PriceManager
in the pricemanager fields.yaml
car :
span: left
type: relation
label: exitcontrol.carmanager::lang.modelpricedata.car
in my model for pricemanager:
public $belongsTo = ['car' => ['\ExitControl\CarManager\Models\Manager','key' => 'car_id']]
How can I use the method getCarOptions($key) { }
To return fields formatted in such a way that the fields name
and code
and returned as "ECAR Economy Car blue" where the capitalised letters are the code, and the Economy Car blue is the name?
I can't find any example code where I can learn from how to set this up.
I know getCarOptions($key) is the key to doing this, but I have no idea how to get the values from the model and returning it in a way so it can be used.
1-1 of 1