dinsdag 24 augustus 2010

Response Writers

I was thinking on what if the dev wanted to output custom output from a page. Currently it is possible, but they have to know the specifics.

Therefor I added response writers. Just return an instance of a response writer, and the application will automaticly handle the request with the data that the response writer returns after processing.

Fairly simple example is this:

class Z_Page_Json extends Z_Page
{
    public function indexAction()
    {  
        $data = array();
        $data[]['name'] = 'somename';
        return new Z_Response_Writer_JSON($data);   
    }
}

The ‘regular’ usage is still rather dirty being:

$this->view = new Z_View_Smarty();               
$this->view->output('test')->handled();
       

I can’t pick between naming it Z_Response_Writer_Smarty() or Z_View_Smarty_Writer – any ideas? :)

maandag 23 augustus 2010

GoDaddy & PHP 5.2.8

Today I signed up for the ‘free’ hosting package I have at GoDaddy.com and found out they’re still using PHP 5.2.8

This made me consider building in support for this PHP version into the Z framework.

No guarantees though, since there are like a zillion thing I’ll need to check / test! But we’ll see…

edit: Think I’ll be hosting it somewhere else instead ;)

Z : The Quick ‘n Dirty PHP Framework

Today I launched a google code project, where I will maintain this project of mine.

It currently is PHP 5.3.0+ only and has a silly dependency on Zend (that I will eventually replace with some custom coding)

You can find the project @ http://code.google.com/p/zphp

Enjoy digging through the code, and if you got any comments or found any bugs, make sure to tell!