This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Zend\Db\Sql\Select; | |
// basic table | |
$select0 = new Select; | |
$select0->from('foo'); | |
// 'SELECT "foo".* FROM "foo"'; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$slugConstraints = '[\w_-]+'; | |
$pagenumberChild = array( | |
'type' => 'segment', | |
'options' => array( | |
'route' => '/page/:page', | |
'constraints' => array( | |
'page' => '\d+' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteRule (.*\.min.css) less.php?min=yes&path=$1 | |
RewriteRule (.*\.css) less.php?min=no&path=$1 | |
</IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################# | |
## data source definitions | |
############################################################################# | |
source users | |
{ | |
# data source type. mandatory, no default value | |
# known types are mysql, pgsql, mssql, xmlpipe, xmlpipe2, odbc | |
type = mysql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\Form; | |
use Zend\Form\Form; | |
use Zend\Form\Element; | |
class FileUploadForm extends Form | |
{ | |
public function __construct($name = null, $options = array()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace SampleModule\Form; | |
use Zend\Form\Form; | |
class SampleForm extends Form | |
{ | |
public function __construct($name = null) | |
{ | |
parent::__construct('Sample Form'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function create($data = null) { | |
$json = "{ \"artist\":\"ergsern\", \"title\":\"enruy7u\" }"; | |
$array = \Zend\Json\Decoder::decode($json); | |
$artist = new Input('artist'); | |
$artist->getValidatorChain()->addValidator(new Validator\StringLength(array('min' => '5', 'max' => '20'))); | |
$title = new Input('title'); | |
$title->getValidatorChain()->addValidator(new Validator\StringLength(array('min' => '5', 'max' => '20'))); | |
$inputFilter = new InputFilter(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// module/Album/src/Album/Model/Album.php: | |
namespace Album\Model; | |
use Zend\Form\Annotation as Form; | |
class Album{ | |
/** | |
* @Form\Required(false) | |
* @Form\Attributes({"type":"hidden"}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Zend\Mvc\Router\RouteMatch; | |
// Listener on dispatch.error event | |
$listener = function ($e) { | |
$app = $e->getTarget(); | |
$events = $app->getEventManager(); | |
$event = clone $e; | |
$matches = new RouteMatch(array('controller' => 'Some\Controller\Alias')); | |
$event->setRouteMatch($matches); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace My\Validator; | |
use Zend\Validator\AbstractValidator; | |
use Zend\ServiceManager\ServiceLocatorAwareInterface; | |
use Zend\ServiceManager\ServiceLocatorInterface; | |
class Unique extends AbstractValidator |