@@ -1,21 +1,21 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$data = $this->get( 'data', array() ); |
|
| 3 | +$data = $this->get('data', array()); |
|
| 4 | 4 | $entries = array(); |
| 5 | 5 | |
| 6 | -foreach( $data as $key => $value ) { |
|
| 7 | - $entries[] = array( 'id' => $key, 'type' => 'aggregate', 'attributes' => $value ); |
|
| 6 | +foreach ($data as $key => $value) { |
|
| 7 | + $entries[] = array('id' => $key, 'type' => 'aggregate', 'attributes' => $value); |
|
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | ?> |
| 11 | 11 | { |
| 12 | 12 | "meta": { |
| 13 | - "total": <?php echo count( $data ); ?> |
|
| 13 | + "total": <?php echo count($data); ?> |
|
| 14 | 14 | |
| 15 | 15 | }, |
| 16 | -<?php if( isset( $this->errors ) ) : ?> |
|
| 17 | - "errors": <?php echo $this->partial( $this->config( $this->get( 'partial-errors', 'admin/jsonadm/partials/template-errors' ), 'partials/errors-standard.php' ), array( 'errors' => $this->errors ) ); ?> |
|
| 18 | -<?php elseif( isset( $this->data ) ) : ?> |
|
| 19 | - "data": <?php echo json_encode( $entries ); ?> |
|
| 16 | +<?php if (isset($this->errors)) : ?> |
|
| 17 | + "errors": <?php echo $this->partial($this->config($this->get('partial-errors', 'admin/jsonadm/partials/template-errors'), 'partials/errors-standard.php'), array('errors' => $this->errors)); ?> |
|
| 18 | +<?php elseif (isset($this->data)) : ?> |
|
| 19 | + "data": <?php echo json_encode($entries); ?> |
|
| 20 | 20 | <?php endif; ?> |
| 21 | 21 | } |