Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. return [
  2. 'db' => [
  3. 'driver' => 'Pdo',
  4. 'dsn' => sprintf('sqlite:%s/data/zftutorial.db', realpath(getcwd())),
  5. ],
  6. ];
  7.  
  8. 'db' => [
  9. 'driver' => 'Pdo_Mysql',
  10. 'dsn' => 'mysql:dbname=dbname;host=localhost;charset=utf8;username=myuser;password=mypassword',
  11. ],
  12.  
  13. <?php
  14.  
  15. namespace AlbumController;
  16.  
  17. use AlbumModelAlbumTable;
  18. use ZendMvcControllerAbstractActionController;
  19. use ZendViewModelViewModel;
  20.  
  21. class AlbumController extends AbstractActionController
  22. {
  23. private $table;
  24. public function __construct(AlbumTable $table)
  25. {
  26. $htis->table=$table;
  27. }
  28.  
  29.  
  30. public function indexAction()
  31. {
  32. return new ViewModel([
  33. 'albums' => $this->table->fetchAll(),
  34. ]);
  35. }}
  36.  
  37. 'controllers' => [
  38. 'factories' => [
  39. ControllerAlbumController::class => ControllerFactoryAlbumControllerFactory::class,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement