How to get a list of cms pages in Magento?
magento
Solution
With your code you are loading a new cms page model. To get a collection use following code and `toOptionArray()` will at least return something:
Mage::getModel('cms/page')->getCollection()->toOptionArray()
Problem
What i'm trying todo I have created an admin form where the user needs to select a CMS page from a drop down. What i have tried ``` $form->addField('cms_page_id', 'select', array( 'label' => Mage::helper('custom/data')->__('CMS Page'), 'class' => 'required-entry', 'required' => true, 'name' => 'cms_page_id', 'values' => Mage::getSingleton('cms/page')->toOptionArray(), 'value' => $this->getCmsPageId() )); ``` The idea is the code gets the an option array from the CMS model. However "toOptionArray" is an invalid function for the 'cms/page' model. My Question How can I get an option array of CMS pages for use in an admin form in Magento?