Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Working from home...

Massimiliano Arione garak

:octocat:
Working from home...
View GitHub Profile
@garak
garak / DefaultControllerTest.php
Last active Aug 29, 2015
Testing facebook login with FOSFacebookBundle (functional test)
View DefaultControllerTest.php
<?php
namespace Acme\DemoBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class DefaultControllerTest extends WebTestCase
{
public function testLoginOK()
{
View ContactType.php
<?php
namespace Acme\DemoBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Validator\Constraints;
class ContactType extends AbstractType
View gist:549660
<?php
/**
* healthstate actions.
*
* @package ordinativi
* @subpackage healthstate
* @author KEY5
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
View gist:595620
<?php
class frontendConfiguration extends sfApplicationConfiguration
{
protected $requestFormat = null;
public function configure()
{
$this->dispatcher->connect('request.filter_parameters', array($this, 'filterRequestParameters'));
View actions.class.php
<?php
class itemActions extends sfActions
{
/**
* @param sfRequest $request
*/
public function executeIndex(sfWebRequest $request)
{
$this->form = new ItemForm();
View schema_doctrine.yml
Item:
columns:
name: { type: string(255), notnull: true }
address: { type: string(255), notnull: true }
city: { type: string(255), notnull: true }
latitude: { type: decimal, scale: 6, size: 10, notnull: true }
longitude: { type: decimal, scale: 6, size: 10, notnull: true }
View schema_propel.yml
classes:
Item:
columns:
id: ~
name: { type: varchar, required: true }
address: { type: varchar, required: true }
city: { type: varchar, required: true }
latitude: { type: decimal, scale: 6, size: 10, required: true }
longitude: { type: decimal, scale: 6, size: 10, required: true }
View model_doctrine.php
<?php
// lib/model/doctrine/ItemTable.php
class ItemTable extends Doctrine_Table
{
/**
* @param array $values
* @param integer $limit
* @return Doctrine_Collection
View model_propel.php
<?php
// lib/model/ItemQuery.php
class ItemQuery extends BaseItemQuery
{
/**
* @param array $values
* @param integer $limit
* @return PropelCollection
View gist:1583690
/**
* @Route("/search/prova")
* @Template()
* @return array
*/
public function provaAction()
{
$form = $this->createFormBuilder()
->add('type', 'choice', array('required' => false, 'choices' => array(
'' => '',