Codeigniter - Check whether a Controller function exists or not, from the routes file
<p>Is there any way to check whether a <strong>function</strong> or <strong>method</strong> exists in a <strong>controller</strong> from <strong>routes</strong> file. I have tried as shown below, but stuck when the controller uses the <strong>session</strong> libraries which I couldn't add in the routes file.</p>

<pre><code>$urlArr = array_values(array_filter(explode('/', $_SERVER['PATH_INFO'])));
$folderName = $urlArr[0];
$controllerName = $urlArr[1];
$actionName = !empty($urlArr[2]) ? $urlArr[2] : 'index';

include_once FCPATH."system/core/Controller.php";
include_once FCPATH."application/core/MY_Controller.php";
include_once FCPATH."application/controllers/$folderName/$controllerName.php";

// Here I need to check whether the function ($actionName) exists or not
</code></pre>

<p><strong>Note</strong>: Don't suggest solutions to check the file as a string and check the function definition string exists or not.</p>

<p>Any help is appreciated. Thanks :)</p>