Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorPaulD
     
    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
     
    BTW- I'm using akelos v0.8
    • CommentAuthorKaste
     

    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
     
    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
     

    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
     
    Thanks Kaste. I appreciate the input.

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

    -Paul