Skip to content

Instantly share code, notes, and snippets.

View nixilla's full-sized avatar

Janusz Slota nixilla

  • Nixilla Ltd
  • near London, UK
View GitHub Profile
Redirection:
columns:
path_info: { type: string(255) }
redirect_to: { type: string(255) }
<?php
// apps/frontend/modules/default/actions/actions.class.php
class defaultActions extends sfActions
{
public function executeCatchall(sfWebRequest $request)
{
// find your redirectation using $request->getPathInfo()
$redirection = Doctrine_Core::getTable('Redirection')
# apps/frontend/config/routing.yml
your_other_routes_here: ~
# generic rules
# please, remove them by adding more specific rules
# default_index:
# url: /:module
# param: { action: index }
<?php
class defaultActions extends sfActions
{
public function executeIndex(sfWebRequest $request)
{
$this->form = new UserForm();
$this->form['entry']['cars']
->getWidget()
->setOption('choices', $this->getUser()->getAttribute('cars'));
<?php
class defaultActions extends sfActions
{
public function executeIndex(sfWebRequest $request)
{
$this->form = new UserForm();
$this->form['entry']['cars']
->getWidget()
->setOption('choices', $this->getUser()->getAttribute('cars'));
<?php
class defaultActions extends sfActions
{
public function executeIndex(sfWebRequest $request)
{
$this->form = new UserForm();
$this->form->getEmbeddedForm('entry')
->getWidget('cars')
->setOption('choices', $this->getUser()->getAttribute('cars'));
<?php
class defaultActions extends sfActions
{
public function executeIndex(sfWebRequest $request)
{
$this->form = new UserForm();
$this->form->getEmbeddedForm('entry')
->getWidget('cars')
->setOption('choices', $this->getUser()->getAttribute('cars'));
<?php
class EntryForm extends BaseEntryForm
{
public function configure()
{
$this->widgetSchema['cars'] = new sfWidgetFormChoice(array(
'choices' => array(),
'expanded' => true
));
<?php
if(Validate::email($email,true))
{
// add to database
return true;
}
else
{
// return error
return false;