Containers
The containers will help to store objects that will be used in many parts
- Create a folder named Repositories in app/
- Inside the folder create your class as <Name>Repository.php
- Create a method to return your values
public getValues(){
return $values;
}
Controller
- Create your controller and receive as parameter your Container class
- If you will invoke many times the method you can call it in the constructor
public function _construct( <Name>Repository $repository){
return $repository->getValues();
}
Comentarios
Publicar un comentario