I loading a file from a controller and trying to find a string from that file inside a model.
The function in the controller i have written has:
<?php
    public function file() {
        $filename = "C:/Users/Declan/Desktop/foo.txt";
    }
?>
And In the model I would have:
<?php
    function find{
        if( exec('grep '.escapeshellarg($_GET['bar']).'$filename')) {
            echo "string found";
        }
    }
?>
I am using This Question as reference.
Any help would be appreciated.
 
     
    