Closed kavinsky closed 13 years ago
Has nothing to do with the Parser package.
The Database returns an immutable result, but if you add it to the view it will be output encoded which will cause the error you gave as the result object is immutable.
You have to either pass the DB result unchecked or pass it in a mutable form:
// option 1: pass it mutable
$data['rows'] = \DB::select('*')
->from('table')
->execute()->as_array();
$this->response->body = View::factory('view', $data);
// option 2: pass it unchecked
$this->response->body = View::factory('view');
$this->response->body->set('rows', \DB::select('*')
->from('table')
->execute(), false);
What's wrong with this code, plz?
$data['rows'] = DB::query('SELECT * FROM table_name')->as_object()->execute(); $this->response(View::forge('search/results', $data));
Thanks, Mat
How do you expect anyone to help you without giving the error? And why do you ask support in the issue tracker? That's what the forums are for.
Trying to upgrade a existing project for use Parser package give this error: http://oi53.tinypic.com/2sb8jzm.jpg
Always when u try to pass a Database_Result into a var like this:
If i deactive Parser package that dosent happens.
Im using develop branch of fuel.( upgraded from rc1> rc2>rc3) Greetz.