I am facing issue of toOptionArray() in widget. I tried all of the way but not fixing this issue.


<?xml version="1.0"?>
    <modulename_article type="modulename/article" translate="name description" module="modulename">
        <description type="desc">Article</description>


class Namespace_ModuleName_Model_System_Config_Source_Brands{

    public function toOptionArray(){
        $options =  array();

        $options[] = array(
            'value' => 'text',
            'label' => 'Only Text'

What is wrong in my code?

  • Hello there is a lot of possibility can you show yout config.xml (Model are defined as modulename)? – Mohamed El Mrabet Nov 9 '19 at 7:07

You declaring your source model as


but your model is missing the config folder. Please create a folder between system and source so it becomes


or declare your source model to be

modulename/system_source_brands And modify class name to Namespace_ModuleName_Model_System_Source_Brands

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.