Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Return the JSON file as an array
- protected function listSpecies() {
- return json_decode(file_get_contents(__DIR__.'/../data/species.json'));
- }
- // Lists species for creation/editing
- public function getSpeciesOptions($keyValue = null) {
- return $this->listSpecies();
- }
- // Shows the species name when displaying the model
- protected function getSpeciesAttribute($value) {
- $species = $this->listSpecies();
- return $species[$value];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement