Error trying zip files

Hello Im trying to zip content inside "/results/".

But yii2 shows me this error

Class 'app\controllers\ZipArchive' not found

Do you have any idea?

The error is that you are using ZipArchive class without specifying complete prefix; so you are using it referring to relative namespace.

If you use "ZipArchive", Yii2 will try to find it inside current namespace (I think you are using ZipArchive class inside app\controllers namespace);

You have to specify complete namespace, using "\" before class name to identify root namespace: "\ZipArchive"

For example:

$zip = new \ZipArchive;