Best way to use custom enums in my plugin templates? I am building a plugin that's uses an enum for custom statuses. The statuses are integrated within my plugin with the exception of changing the status in my template code. 

pluginname/enums/PluginStatus.php

&lt;?php
namespace Craft;

class PluginNameStatus
{
    const Approved = 'approved';
    const Denied   = 'denied';
    const Pending  = 'pending';
}


What is the best method to grab the enum values and display those in a select field for my edit template? All of my templates are rendered via controller actions so I am thinking that assigning the enums to an array and passing to the templates as $variables might be the most practical method.

pluginname/controllers/PluginNameController.php

&lt;?php
namespace Craft;

class PluginNameController extends BaseController
{
    public function actionShowIndex()
    {
        $variables['customStatuses'] = array(
            PluginStatus::Approved =&gt; 'Approved',
            PluginStatus::Denied   =&gt; 'Denied',
            PluginStatus::Pending  =&gt; 'Pending',
        ), 
        $this-&gt;renderTemplate('pluginname/_edit', $variables);
    }
}
Right now that's probably the best way to do it.

For Craft 2.2, I just added a static getConstants() method to BaseEnum, so you can do can do a PluginStatus::getConstants() call that will return an array with a key => value pair of the enum options and their values that should make that cleaner.