How to Submit to a new view in Yii

I have a search submit button, and I want my application to open another view on click. This is my code:

views/supermarkets/index.php:

<?php


use yii\helpers\Html;


use yii\widgets\LinkPager;


use app\views\supermarkets\search;


?>


<h1>Supermarkets</h1>


<ul>





<p> 





    Search by Name





</p>


<Form Name ="form1" Method ="POST" ACTION = "app\views\supermarkets\search.php">


<INPUT TYPE = "Text" VALUE ="search by name" NAME = "searchname">


<input type="submit" value="Search">


<h3> </h3>

views/supermarkets/search.php:

<?php


use yii\helpers\Html;


use yii\widgets\LinkPager;


?>


<h1>Supermarkets</h1>


<ul>











<?php











    if (isset($_POST['searchname']) && $_POST['searchname']!='') {





    $sname = $_POST['searchname'];











    $row = Yii::app()->db->createCommand(array(


    'select' => '*',


    'from' => 'supermarkets',


    'where' => array('like', 'Name','%'.$keyword.'')





))->queryRow();





$array = (array) $row;





    }


    echo $array;


function build_table($array){





    // start table





    $html = '<table class="altrowstable" id="alternatecolor">';





    // header row





    $html .= '<tr>';





    foreach($array[0] as $key=>$value){





            $html .= '<th>' . $key . '</th>';





        }





    $html .= '</tr>';





    // data rows





    foreach( $array as $key=>$value){





        $html .= '<tr>';





        foreach($value as $key2=>$value2){





            $html .= '<td>' . $value2 . '</td>';





        }





        $html .= '</tr>';





    }





    // finish table and return it





    $html .= '</table>';





    return $html;





}











echo build_table($array);





?>





<?= LinkPager::widget(['pagination' => $pagination]) ?>

On Submit I’m getting this error:

Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

I know there is something wrong in my code, but I just can’t figure it out. And I am not sure if this is the right way to submit the POST value to my search view.