Skip to content

Instantly share code, notes, and snippets.

Michael Holm hollodk

Block or report user

Report or block hollodk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:d1fa00aff24553f16b510047edf5c2b5
mysql> select * from product; select * from category; select * from tag; select * from product_tag; +----+-----------+-------------+
| id | name | category_id |
+----+-----------+-------------+
| 1 | shampoo | 1 |
| 2 | skocreme | 1 |
| 3 | vase | 2 |
| 4 | hundesnor | 1 |
+----+-----------+-------------+
4 rows in set (0.00 sec)
View gist:b7dc4170c7be1a76a96991bb12d76b1c
mysql> select * from product; select * from category; select * from tag; select * from product_tag;
+----+----------+-------------+
| id | name | category_id |
+----+----------+-------------+
| 1 | shampoo | 1 |
| 2 | skocreme | 1 |
| 3 | vase | 2 |
+----+----------+-------------+
3 rows in set (0.01 sec)
@hollodk
hollodk / gist:7a65372d691f3d60c217
Created Dec 21, 2014
Embed symfony forms without classes
View gist:7a65372d691f3d60c217
$form = $this->createFormBuilder();
$registration = $this->get('form.factory')->createNamedBuilder('registration');
$questionary = $this->get('form.factory')->createNamedBuilder('questionary');
$registration
->add('name', 'text')
->add('city', 'text')
;
$questionary
@hollodk
hollodk / gist:6798350
Created Oct 2, 2013
Symfony2 get from repository class
View gist:6798350
Your controller:
/**
* @Route("/")
* @Template()
*/
public function indexAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
You can’t perform that action at this time.