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

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -