Skip to content

Instantly share code, notes, and snippets.

@avalanche123
Created February 2, 2011 15:52
Show Gist options
  • Save avalanche123/807892 to your computer and use it in GitHub Desktop.
Save avalanche123/807892 to your computer and use it in GitHub Desktop.
<?php
class DateTimeField
{
public function __construct(DateField $dateWidget = null, TimeField $timeWidget = null, BaseDateTimeTransformer $transformer = null)
{
$this->dateWidget = isset($dateWidget) ? $dateWidget : new DateField();
$this->timeWidget = isset($timeWidget) ? $timeWidget : new TimeField();
$this->valueTransformer = isset($transformer) ? $transformer : new DateTimeToArrayTransformer();
}
}
<?php
class Form
{
public function __construct($name, ValidatorInterface $validator, FieldFactory $fieldFactory, CsrfProviderInterface $csrfProvider = null, $csrfProviderField = null)
{
$this->name = $name,
$this->validator = $validator;
$this->fieldFactory = $fieldFactory;
$this->csrfProvider = isset($csrfProvider) ? $csrfProvider : new NullCsrfProvider();
$this->csrfProviderField = $csrfProviderField;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment