Working with Attributes - how to get options from a Select Attribute
Working on Concrete5.7.2, I am trying to get options from a Select Attribute that I have created.
I tried the code example on this page:http://www.webli.us/cheatsheet/doku.php#display_get_options_from_a_...
- but it fails with the following message: Class 'SelectAttributeTypeController' not found
Obviously this part isn't correct or working on 5.7.2:
$sa = new SelectAttributeTypeController(AttributeType::getByHandle('select'));
How can I do this in 5.7.2?
Just to clarify - you made a select attribute, added it to a page type, and want to know how to access it?
did you find a solution for this? I'm trying to do the same
Argument 1 passed to Concrete\Core\Attribute\Controller::__construct() must be an instance of Doctrine\ORM\EntityManager, instance of DoctrineProxies\__CG__\Concrete\Core\Entity\Attribute\Type given, called in /var/www/c5/concrete5-8.1.0/packages/firstforwellbeing/controllers/single_page/ffw/pathways.php on line 32
When following other half-complete examples I'm trying to scavenge documentation from
This will get you the available options from a user attribute key (in my case, collections should be the same bar changing UserKey hopefully).
$attr = \Concrete\Core\Attribute\Key\UserKey::getByHandle('userprovidertype'); $atc = $attr->getController(); $options = $atc->getOptions();