+ Reply to Thread
Results 1 to 2 of 2

Thread: Reading contents of file from Controller action

  1. #1
    morthomtech is offline Junior Member
    Join Date
    Nov 2008
    Location
    Canada
    Posts
    7

    Default Reading contents of file from Controller action

    Hi All,

    How do I read the contents of a file into a string from a Controller action

    I have tried the following that give me the error No such file

    $contents = file_get_contents('verification_email.html');

    the file with placed in the same folder as the Controller and it has read access

    How should I specify the location of the file OR
    what Zend method can I use in the controller to read the file

    Help guys, anybody, I am new to Zend Framework


    Vernon

  2. #2
    rathethi is offline Junior Member
    Join Date
    Jul 2008
    Posts
    13

    Default

    HI

    $file=root path(ie d:\wamp\www\pjtfolder\public\abc.html);

    note does not give the path start with http://

    $contents = file_get_contents($file);

    will solve your problem

    by

    Ratheesh R

+ Reply to Thread

Similar Threads

  1. Front Controller treating static file request as controller request
    By Matt1776 in forum Model-View-Controller (MVC)
    Replies: 2
    Last Post: 03-09-2009, 07:45 AM
  2. reading bootstrap $db object in controller
    By squibs in forum General Q&A on Zend Framework
    Replies: 2
    Last Post: 02-05-2009, 10:03 AM
  3. Zend_Pdf --> Excepcion Can not open file for reading, writing
    By jagr in forum Mail, Formats & Search
    Replies: 1
    Last Post: 11-24-2008, 03:26 PM
  4. Use controller/action output as a string in another action
    By Snuyt in forum Model-View-Controller (MVC)
    Replies: 2
    Last Post: 04-26-2008, 11:41 PM
  5. Sorting contents of zend_controller_response
    By tig12 in forum Model-View-Controller (MVC)
    Replies: 0
    Last Post: 01-15-2008, 12:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts