I am very new to phalcon and I have to use some common variables or functions in the whole project then where I have to write these? For example I have to use phalcon logging and I have written the following code in public/index.php file as:
use Phalcon\Mvc\Controller; use Phalcon\Logger\Adapter\File as FileAdapter; $logger = new FileAdapter("../app/logs/test-".date("Y-m-d").".log", array('mode' => 'w'));
But when I use $logger->log("Test"); this in controller then it gave me an error of undefined variable.
Hence please give me a proper flow so that I can write common things and used them into my whole project.