yii2 custom REST api issue
<p>I have tried all the way to make these run but no use.There is lots of problem and confusion i m going through.
I have make api which return all the countries which is working fine.Now need to write api function to list all the states of perticular country.</p>

<p>api : <a href="http://phpserver:8090/ssn-project/newzit/api/web/state/customstate?country_id=102" rel="nofollow">http://phpserver:8090/ssn-project/newzit/api/web/state/customstate?country_id=102</a></p>

<p>StateController.php</p>

<pre><code>class StateController extends ActiveController{

public $modelClass = 'api\modules\state\models\State'; 

public function actionCustomState($country_id)
{
    $model = new $this-&gt;modelClass;
    $result = $model::find()
              -&gt;where(['country_id' =&gt; $country_id])
              -&gt;all();
    return $result;
}  
}
</code></pre>

<p>main.php</p>

<pre><code>'urlManager' =&gt; [
        'enablePrettyUrl' =&gt; true,
        'enableStrictParsing' =&gt; true,
        'showScriptName' =&gt; false,
        'rules' =&gt; [
            [
                'class' =&gt; 'yii\rest\UrlRule', 
                'controller' =&gt; ['country/country','state/state','category/category','seller/seller'],
                'extraPatterns' =&gt; [
                    'GET CustomState' =&gt; 'CustomState',
                ],  
            ]
        ],        
    ]
</code></pre>

<p>Am I doing anything wrong.Please help</p>