Re: Use CakeResponse in Helper.

2014-06-11 Thread Dakota
Didn't know Savant had a csv plugin. Good to know, although we usually export to excel. On Wednesday, 11 June 2014 12:43:55 UTC+2, euromark wrote: > > Why are you using a view/helper for this? > Use https://github.com/josegonzalez/cakephp-csvview then you have the > full response object availabl

Re: Use CakeResponse in Helper.

2014-06-11 Thread majna
Response object *is* available in Helper, just use $this->response->type('csv'); $this->response->download($this->filename); $this->response->send(); Am Mittwoch, 11. Juni 2014 00:49:58 UTC+2 schrieb gloop: >> >> Hello i try to write an helper to create and download a CSV. >> >> Now i have the pr

Re: Use CakeResponse in Helper.

2014-06-11 Thread euromark
Why are you using a view/helper for this? Use https://github.com/josegonzalez/cakephp-csvview then you have the full response object available directly in the action. And no template needed, as the view class itself is responsable for directly transforming the array into the CSV structure. Am M

Use CakeResponse in Helper.

2014-06-10 Thread Dakota
I would actually suggest creating a view class for this rather than a helper. Helpers are for helping in the rendering of specific elements, whereas view classes are the best for rendering types of content. Take a look at my excel plugin to get an idea of a view class. You should be able to eas

Re: Use CakeResponse in Helper.

2014-06-10 Thread Reuben
Whilst the $response is not available in the Helper, it is available on the View class, and the view class is available on any Helper via $this->_View. Therefore, $this->_View->response->type('csv'); from inside any Helper method should do the trick, unless output has already commenced, and hea

RE: Use CakeResponse in Helper.

2014-06-10 Thread Advantage+
Don’t waste your time with Cake I used Cake last 5 years and it’s a dead ship. Laravel all the way. Beats Cake hands down! Sorry Mark or who ever but cake is baked it's done. I can put 100 ways Cake falls short……… slow / conventions just a waste of time -- Like Us on FaceBook

Use CakeResponse in Helper.

2014-06-10 Thread gloop
Hello i try to write an helper to create and download a CSV. Now i have the problem to set the type in the helper. I try: function renderHeaders() { $response = new CakeResponse(array( 'type' => 'csv' )); $response->download($this->filename); $response->send(); } Now i ca