I have declared a method:

<?php $form=$this->beginWidget(‘CActiveForm’, array(




)); ?>

but it still outputs Calling unknown method: yii\web\View::beginWidget().

What Might be the issue?

Can someone help me know how to define and use CAvtiveforms and CHtml

CActiveForm and CHtml are classes that belong to Yii 1.1.x, while yii\web\View::beginWidget() belongs to Yii 2.0.

So, what environment are you working on?