php - zend framework 2 How do i link a file in the controller (What is the path) -
how link file in controller
$openuuserpersonalfile = fopen("/zendebayapp/data/usersinformationin/userpersonal.txt", "r"); echo fgets($openuuserpersonalfile) . "<br />"; fclose($openuuserpersonalfile);
would corrent?
here how link file in layout /zendebayapp/public/css/mainpagelayout.css
this controller is: \zendebayapp\module\application\src\application\controller
assuming you're using zf2 skeleton application, you'll notice public/index.php contains line like:
chdir(dirname(__dir__));
that's changes directory root of project.
so reference file in example, you'd do:
$fp = fopen('data/usersinformationin/file.txt', 'r');
Comments
Post a Comment