how to load txt data in zf2

For programming and general questions on Zend Framework

how to load txt data in zf2

Postby jobsfan on Sat Dec 22, 2012 6:02 pm

Hi Friends, I knew we can load data from a no-database file, like txt file, js file, or other format to a string by file_get_contents() function, I wanna to know how this work in zf2, I don't want to use file_get_contents() in zf2, because it seem not zf2 style, right? what about file_put_contents() in zf2?

I found a file folder in library, like the attached picture.

As well, what about the file_put_contents() funciton in zf2?

in my project, I create a data.js which store a json format data, then I can use the data (maybe array) in this data.js from php or javascript. so I need to use file_get_contents similar function in zf2 to load the array to php. by the way, where should I place this data.js? under public/js/ or in application/src/data or other place.

I hope I have express my problems clear, anyone who knows pls tell me, very appreciated!!
Attachments
1111.jpg
1111.jpg (19.52 KiB) Viewed 793 times
jobsfan
 
Posts: 23
Joined: Sat Sep 08, 2012 3:15 am

Re: how to load txt data in zf2

Postby jobsfan on Tue Dec 25, 2012 6:55 am

why nobody answer my question? puzzled
jobsfan
 
Posts: 23
Joined: Sat Sep 08, 2012 3:15 am

Re: how to load txt data in zf2

Postby jobsfan on Tue Dec 25, 2012 7:27 am

I search the whole project with file_get_contents, there is no one likely to be the right one, so I dont't think zf2 enclosure the function file_get_contents, I gave up.
jobsfan
 
Posts: 23
Joined: Sat Sep 08, 2012 3:15 am


Return to Zend Framework

Who is online

Users browsing this forum: Yahoo [Bot] and 12 guests