Skip to content

Instantly share code, notes, and snippets.

View dancostinel's full-sized avatar

Dan Costinel dancostinel

  • Craiova, Romania
View GitHub Profile
@dancostinel
dancostinel / html
Created April 23, 2018 21:35
Quiz expected html
<div class="form-group">
<div class="col-sm-1">
<label for="answer1">Answer 1</label>
</div>
<div class="col-sm-1">
<input name="answers[]" id="answer1" class="form-control">
</div>
<div class="col-sm-10">
<input type="checkbox" name="correct" id="correct1" value="1"> <label for="correct1">Correct?</label>
</div>
@dancostinel
dancostinel / project.php
Created February 23, 2017 09:22
Could not determine access type for property "filters".
<?php
# AppBundle/Entity/Category.php ================================================================================================
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* Category
*
@dancostinel
dancostinel / controller.php
Last active January 21, 2017 19:13
Controller
public function newAction(Request $request)
{
$form = $this->createFormBuilder()
->setMethod('POST')
->setAction($this->generateUrl('admin_pic_new'))
->add('images', FileType::class, [
'data_class' => null,
'multiple' => true,
'required' => true,
'label' => false,
# app/config/config.yml ========================================================================================================
#...
fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: main
user_class: AppBundle\Entity\User
registration:
form:
type: AppBundle\Form\RegistrationType
@dancostinel
dancostinel / php
Created October 25, 2016 12:48
asdf
// ENTITY
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Person
@dancostinel
dancostinel / php
Created October 25, 2016 12:07
asd
/**
* @Route("/submit", name="submit")
* @Method("POST")
*/
public function submitAction(Request $request)
{
$person = new Person();
$form = $this->createForm(PersonType::class, $person);
$form->handleRequest($request);
@dancostinel
dancostinel / index.html
Created September 22, 2016 20:31
center div both horizontally and vertically
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>center div</title>
<style>
div#wrapper{
height: 100vh;
display: flex;
flex-direction: column;