standalone action

I want to create a standalone action so I create a folder named components and I save there the action and setting at controller


public function actions()

    {

        return [

 'CreatePost' => [

                'class' => 'app\components\CreatePost',

            ],]

but there is the error Unable to find ‘app\components\CreatePost’

Where I have to save the standalone action, so not to have this error?

I managed to solve it.