Skip to content

Instantly share code, notes, and snippets.

View enricostano's full-sized avatar

Enrico Stano enricostano

View GitHub Profile
@enricostano
enricostano / DocumentInterface.php
Created June 19, 2012 22:32
document interface
<?php
namespace StanoSas\Bundle\DocumentBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* StanoSas\Bundle\DocumentBundle\Entity\DocumentInterface
*
@enricostano
enricostano / Gara.php
Created June 19, 2012 22:34
Gara Entity
<?php
namespace StanoSas\Bundle\DocumentBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\Common\Collections\ArrayCollection;
use StanoSas\Bundle\UserBundle\Entity\User;
{% extends '::base.html.twig' %}
{% block title %}{{ gara.name }}{% endblock %}
{% block body %}
<h2>{{ gara.name }}</h2>
{{ gara.ente }}
{% include 'StanoSasDocumentBundle:Attachment:index.html.twig' with { 'attachments': attachments } %}
<h3>Aggiungi file</h3>
@enricostano
enricostano / form.html.twig
Created June 19, 2012 23:05
new attachment form
<form action="{{ path('StanoSasDocumentBundle_attachment_create', { 'ownerObj': ownerObj }) }}" method="post" {{ form_enctype(form) }} class="">
{{ form_widget(form) }}
<p>
<input type="submit" value="Submit">
</p>
</form>
@enricostano
enricostano / httpd.conf
Created July 7, 2012 15:30
Directory in httpd.conf
<Directory "/srv/http">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
@enricostano
enricostano / Attachment.php
Created July 10, 2012 22:33
AttachmentController
public function createAction($ownerObj)
{
$attachment = new Attachment();
$ownerObj->addAttachment($attachment);
$request = $this->getRequest();
$form = $this->createForm(new AttachmentType(), $attachment);
if ($request->getMethod() == 'POST') {
if ($form->isValid()) {
$em = $this->getDoctrine()
->getEntityManager();
An exception has been thrown during the rendering of a template ("Unable to find template "StanoSasDocumentBundle:Attachment:form" in StanoSasDocumentBundle:Gara:show.html.twig at line 12.") in ::base.html.twig at line 13.
500 Internal Server Error - Twig_Error_Runtime
3 linked Exceptions:
InvalidArgumentException »
Twig_Error_Loader »
Twig_Error_Loader »
@enricostano
enricostano / show.html.twig
Created July 10, 2012 22:37
Gara Show view
{% extends '::base.html.twig' %}
{% block title %}{{ gara.name }}{% endblock %}
{% block body %}
<h2>{{ gara.name }}</h2>
{{ gara.ente }}
{% include 'StanoSasDocumentBundle:Attachment:index.html.twig' with { 'attachments': attachments } %}
<h3>Aggiungi file</h3>
@enricostano
enricostano / Gara.php
Created July 11, 2012 13:30
Gara Entity
<?php
namespace StanoSas\Bundle\DocumentBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\Common\Collections\ArrayCollection;
use StanoSas\Bundle\UserBundle\Entity\User;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
@enricostano
enricostano / gist:3160017
Created July 22, 2012 15:41
ls -la /lib
total 4096
drwxr-xr-x 3 root root 4096 Jul 22 16:30 .
drwxr-xr-x 21 root root 4096 Jul 6 01:02 ..
-rwxr-xr-x 1 root root 165328 Jul 2 16:33 ld-2.16.so
lrwxrwxrwx 1 root root 10 Jul 2 16:33 ld-linux-x86-64.so.2 -> ld-2.16.so
-rwxr-xr-x 1 root root 14952 Jul 2 16:33 libanl-2.16.so
lrwxrwxrwx 1 root root 14 Jul 2 16:33 libanl.so.1 -> libanl-2.16.so
-rwxr-xr-x 1 root root 6256 Jul 2 16:33 libBrokenLocale-2.16.so
lrwxrwxrwx 1 root root 23 Jul 2 16:33 libBrokenLocale.so.1 -> libBrokenLocale-2.16.so
-rwxr-xr-x 1 root root 1997041 Jul 2 16:33 libc-2.16.so