Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
File/zip creation
  • Hi All,

    I'm trying to work out a way to write an app for users to create a specific file format for a mobile app (like a customised epub format). I've gotten a fair way to building an interface to manage and create content however I need to have the user render a bunch of views as files on the server, package and zip them up and then have the user download them.

    I'm having trouble working out how to render views to actual files so I can compress them using a similar method to the one outlined here

    Does anyone have any suggestions how to go about this kind of behaviour in fuel? Ideally I'm wanting to create something that will allow

    files[] = create_file_to_zip(View::forge('home/something', $data));
    files[] = create_file_to_zip(View::forge('home/somethingelse', $data));

    foreach($files as $file) {

    Any help would be really appreciated

  • I would use

    File::create('/some/file/path', 'test.txt', View::forge('home/somethingelse', $data)->render());

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion