Skip to content

Instantly share code, notes, and snippets.

View Narven's full-sized avatar
👾
Walking to the fridge...

P Ξ D R O L U Z Narven

👾
Walking to the fridge...
View GitHub Profile
/* By default, required field labels are rendered with the "required" class */
.required:after {
content: "*";
}
<?php
$lista = array_map('unserialize', array_unique(array_map('serialize', $listaAtual)));
NLS_LANG <lang> - character set, language and territory
TNS_ADMIN <path> - path to tnsnames.ora file
PATH <path> - add location of the Oracle client
$ curl --data-binary @README.md -H 'Content-Type:text/plain' https://api.github.com/markdown/raw
acme_generate_image_service:
class: Acme\Component\GenerateImageConsumer
arguments:
- @logger
<?php
namespace Acme\Component;
use OldSound\RabbitMqBundle\RabbitMq\Producer;
class UploadImage
{
protected $options = array();
protected $generateFolder = null;
(e.g. for email templates)
Just set the assets_base_urls option under framework - templating key in your app/config/config.yml:
framework:
templating:
assets_base_urls: http://www.something.com/web/
http://symfony.com/doc/current/reference/configuration/framework.html#assets-base-urls
<?php
// src/Bundle/Form/EventListener/AddExpiresAtFieldSubscriber.php
class AddExpiresAtFieldSubscriber implements EventSubscriberInterface
{
private $factory;
public function __construct(FormFactoryInterface $factory)
{
$this->factory = $factory;
<?php
try{
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->flush();
$this->get('session')->setFlash('notice', 'Article inserted!');
return $this->redirect($this->generateUrl('article_show', array('id' => $entity->getId())));
}catch(\Exception $e){
tr:nth-child(2n+1){ background: ‪#fff‬ }
tr:nth-child(2n+0){ background: ‪#ffffec‬ }