Twig - how use dropDownList

I have static method inside model


    public static function getPostType(){

        return [

            1 => 'Post 1',

			2 => 'Post abc',

			3 => 'Post xyz',

        ];

    }

Inside view.twig




{{ use('app/models/Post') }}

{{ form.field(model, 'type').dropDownList(Post.getPostType | raw }}

and error

What is incorrect?

Hi,

I think you can omit get , simply use postType.

$form->field($model, ‘title’)->dropDownList( $post->postType );

:)

I use Twig template.

bump :)

Hello any luck on solving this error…?