Zend framework 2 info
Forms and actions – Albums example
Matthew Setter Running the ZF2Skeleton with PHP’s Built-in Webserver
Zend Framework 2 CheetSheet
Zend FRamework 2 module directory structure
A route -olás, útválasztás miatt szükséges az src-n belül ismételni a modul nevét. (?)
module/ Account/ config/ src/ Account/ Controller/ CaseController.php (AccountControllerCaseController) Entity/ CaseEntity.php (AccountEntityCaseEntity) Form/ CaseForm.php (AccountFormCaseForm) Mapper/ CaseMapper.php (AccountMapperCaseMapper) Service/ CaseService.php (AccountServiceCaseService) view/ Module.php
Fájl fetöltés. (nem csak a Standard megoldás) A manual megoldást mutat a feltöltés + adat űrlap ellenőrzésre. Ha az adat, pl. email cím nem érvényes, a feltöltött képet nem dobja el. http://framework.zend.com/manual/2.1/en/modules/zend.form.file-upload.html “When using other standard form inputs (i.e. text, checkbox, select, etc.) along with file inputs in a Form, you can encounter a situation where some inputs may become invalid and the user must re-select the file and re-upload. PHP will delete uploaded files from the temporary directory at the end of the request if it has not been moved away or renamed. Re-uploading a valid file each time another form input is invalid is inefficient and annoying to users.”
$this->params()->fromPost('paramname'); // From POST
$this->params()->fromQuery('paramname'); // From GET
$this->params()->fromRoute('paramname'); // From RouteMatch
$this->params()->fromHeader('paramname'); // From header
$this->params()->fromFiles('paramname'); // From file being uploaded
Database and models¶
ZendAuthentication
Create Simple Login Authentication
Database Table Authentication¶
Using Sessions in Zend Framework 2
Zend Framework 2: Authentication + Acl using EventManager
Zend Framework 2 ACL setup in 5 minutes – tutorial