Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return [
- 'db' => [
- 'driver' => 'Pdo',
- 'dsn' => sprintf('sqlite:%s/data/zftutorial.db', realpath(getcwd())),
- ],
- ];
- 'db' => [
- 'driver' => 'Pdo_Mysql',
- 'dsn' => 'mysql:dbname=dbname;host=localhost;charset=utf8;username=myuser;password=mypassword',
- ],
- <?php
- namespace AlbumController;
- use AlbumModelAlbumTable;
- use ZendMvcControllerAbstractActionController;
- use ZendViewModelViewModel;
- class AlbumController extends AbstractActionController
- {
- private $table;
- public function __construct(AlbumTable $table)
- {
- $htis->table=$table;
- }
- public function indexAction()
- {
- return new ViewModel([
- 'albums' => $this->table->fetchAll(),
- ]);
- }}
- 'controllers' => [
- 'factories' => [
- ControllerAlbumController::class => ControllerFactoryAlbumControllerFactory::class,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement