Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function getUsers( ){
- $users = $this->db->resource(dbMapper::USER);
- return $this->usersToArray( $users );}
- private function usersToArray( $users ){
- $result = array( );
- foreach ($users as $user){
- $result[] = array(
- 'id' => intval( $user->get('id') ),
- 'name' => $user->get('name')
- );
- }
- return $result;
- }
- public function getAllData( ){
- $result = array( );
- $result['users'] = $this->getUsers( );
- $results = print_r($result['users'], true); echo $results;
- return $result;
- }
- $data = $model->getAllData( );
- $this->_helper->json( $data );
- Array
- (
- [0] => Array
- (
- )
- [1] => Array
- (
- )
- [2] => Array
- (
- )
- [3] => Array
- (
- )
- [4] => Array
- (
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement