Run frontend web controller method in console controller method for cronjob yii2
<p>I have a index method in <strong>frontend/controllers/FollowupcandidteclientController</strong>
where i am returning some values after running this controller method.</p>

<p>below is my code(just for reference)</p>

<p>class FollowupcandidteclientController extends \yii\web\Controller
{</p>

<pre><code>    public function actionIndex()
     {

     $a=2;
     $b=3;
     $c=$a + $b;
     return $c;

 }
</code></pre>

<p>}</p>

<p>I have set cronjob with the controller name CronjobController in console/controllers/CronjobController.</p>

<p>In this I have a method called runcron().</p>

<p>I want to run the followupcandidateclient/index in this <strong>cronjob controller</strong> <strong>runcron</strong> method</p>

<p>Below is my code for cronjob</p>

<p><strong>namespace console\controllers;</strong></p>

<p><strong>use Yii;</strong></p>

<p><strong>use yii\console\Controller;</strong></p>

<p>Class CronjobController extends Controller
{</p>

<pre><code>public function actionRuncron(){
</code></pre>

<p>here this action should run <strong>index.php?r=followupcandidateclient/index</strong> when the cronjob is executed</p>

<pre><code>      }
</code></pre>

<p><strong>}</strong></p>

<p><strong>?></strong></p>

<p><strong>It would be great and very thankfull if any body helps me on this issue.
Thanks in advance.</strong></p>