Advertisement
Guest User

Untitled

a guest
Nov 1st, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1.     //Return the JSON file as an array
  2.     protected function listSpecies() {
  3.         return json_decode(file_get_contents(__DIR__.'/../data/species.json'));
  4.     }
  5.  
  6.     // Lists species for creation/editing
  7.     public function getSpeciesOptions($keyValue = null) {
  8.  
  9.         return $this->listSpecies();
  10.     }
  11.  
  12.     // Shows the species name when displaying the model
  13.     protected function getSpeciesAttribute($value) {
  14.  
  15.         $species = $this->listSpecies();
  16.         return $species[$value];
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement