korzystam z tutka ze strony http://akrabat.com/wp-content/uploads/Gett...Framework-2.pdf .
Wprowadzam adres do przeglądarki:
http://zf2-tutorial.localhost/album
dostaję error:
Kod
Fatal error: Namespace declaration statement has to be the very first statement in the script in C:\wamp\www\zf2-tutorial\module\Album\src\Album\Model\AlbumTable.php on line 3
AlbumTable.php
<?php namespace Album\Model; use Zend\Db\TableGateway\TableGateway, Zend\Db\Adapter\Adapter, Zend\Db\ResultSet\ResultSet; class AlbumTable extends TableGateway { public function __construct(Adapter $adapter = null, $databaseSchema = null, ResultSet $selectResultPrototype = null) { return parent::__construct('album', $adapter, $databaseSchema, $selectResultPrototype); } public function fetchAll() { $resultSet = $this->select(); return $resultSet; } public function getAlbum($id) { $id = (int) $id; $row = $rowset->current(); if (!$row) { throw new \Exception("Could not find row $id"); } return $row; } public function addAlbum($artist, $title) { 'artist' => $artist, 'title' => $title, ); $this->insert($data); } public function updateAlbum($id, $artist, $title) { 'artist' => $artist, 'title' => $title, ); } public function deleteAlbum($id) { } }
Ok, rozwiązanie znalazłem https://github.com/FriendsOfSymfony/FOSFace...undle/issues/70