OctoberCMS Get plugin's Dropdown values at frontend

- 1 answer

Ad

I have created one plugin (call it Product) using Builder Plugin and inside it, i have a dropdown (call it product_category (Product Category))

Using Builder Plugin, i have added few Key => Value (Dropdown Category options) like below.

Added Dropdown Options:

enter image description here

Showing Dropdown Options:

enter image description here

Now i have one CMS page (call it products) which i am showing in front end, and in which i am showing the list of the products, which works fine using the code like below.

enter image description here

Now here comes my question/query, i have a Product Category Dropdown in front end as well in a same page and i want to get all the Product Categories which i have added using my Builder Plugin.

How can i get those ?

Ad

Answer

Ad

Ok guys, eventually i have found out a solution thanks to alxy's help though and here what i have come up with.

$parser = new October\Rain\Parse\Yaml;
$fields = $parser->ParseFile('/path/to/fields.yaml');

var_dump($fields);

Go here for more.

Thank you

Ad
source: stackoverflow.com
Ad