Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorPaulD
    • CommentTimeJul 31st 2008
     
    Greetings,

    I stumbled on to Akelos recently and am very impressed so far with the framework. The user/example documentation not so much, but I hope to help with that :) Bermi & Co, you guys have done an awesome job!

    I have a simple application that I'm using for testing (looking for something better than CI - how I stumbled on to Akelos :-D ) but I do not want to use the auto render functionality.
    Essentially, I get a result from a mysql DB and parse in to an XML output via xmlwriter. However, I'm doing this all in my controller, and I only want clean xml output.

    When running my test, I get my xml document and also the HTML code stating "warning: missing template ... index.tpl" & "fatal error: no tpl.php... or delegate template found for index..."

    so, my question: is there a way to turn off or disable the render function?

    Thanks in advance!
    -Paul
    • CommentAuthorPaulD
    • CommentTimeJul 31st 2008
     
    BTW- I'm using akelos v0.8
    • CommentAuthorKaste
    • CommentTimeJul 31st 2008
     

    as soon as you invoke a render by yourself inside an action, the default action will be dismissed.

    so you could

     $this->renderText('<xml ...');
    

    and f.i.

    $this->Response->addHeader(array('content-type'=>'text/xml'));
    

    (I highly recommend using a newer version than 0.8)

    • CommentAuthorPaulD
    • CommentTimeJul 31st 2008
     
    Kaste - Thanks for the response.

    Since I'm echoing the output from a controller, I get 'can't modify headers' errors. any other way to change or disable the default action?

    I plan on switching to SVN - there are no other tarballs to download from the main site.
    • CommentAuthorKaste
    • CommentTimeJul 31st 2008
     

    The problem here is that we're flushing the Response-object. echo'ing is not a way to go. Either render a string with ->renderText() or work in another way directly with $this->Response.

     //that would be
     $this->Response->addHeader(array(...
     $this->Response->body = [...]
    

    You can assign an object to the ->body which implements ->stream() if you must. Otherwise it takes text.

    //e.g.
    public function stream()
    {
        echo .... //set implicit flush
    }
    
    • CommentAuthorPaulD
    • CommentTimeAug 2nd 2008
     
    Thanks Kaste. I appreciate the input.

    I'm looking forward to building some great apps w/ Akelos.

    -Paul
Add your comments
    Username Password
  • Format comments as