Skip to content

Instantly share code, notes, and snippets.

<?php
namespace MyProject\MyBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
class ImageController extends Controller
{
public function proxyAction($url)
{
0: {
code: 200,
headers: [
{
name: "Content-Type",
value: "application/json",
},
{
name: "ETag",
<?php
$fb = new Facebook(array('appId' => ..., 'secret' => ..., 'cookie' => true));
$queries = array(
array('method' => 'GET', 'relative_url' => '/8882845892'),
array('method' => 'GET', 'relative_url' => '/67226614422'),
array('method' => 'GET', 'relative_url' => '/140959058191'),
);
<?php
$fb = new Facebook(array('appId' => ..., 'secret' => ..., 'cookie' => true));
$obj_1 = $fb->api('/8882845892');
$obj_2 = $fb->api('/67226614422');
$obj_3 = $fb->api('/140959058191');
21 # FacebookBundle Configuration
22 fos_facebook:
23 file: %kernel.root_dir%/../vendor/facebook/src/facebook.php
24 alias: facebook
25 app_id: xxxxx
26 secret: xxxxx
27 cookie: true
28
29 # Security Configuration
30 security:
<span>{{ mydate|date('X') }}</span>
<?php
namespace Caefer;
use Caefer\WeekAhead;
$qb = $em->createQueryBuilder();
$qb->add('select', 'x')
->add('from', 'Caefer\Entity\Experiment x')
->add('where', 'x.date = :date')
<?php
use Caefer\WeekAhead;
$w = new WeekAhead('today');
echo $w->format('Y-m-d').PHP_EOL;
$w = new WeekAhead('tomorrow');
echo $w->format('Y-m-d').PHP_EOL;
<?php
namespace Caefer;
class WeekAhead extends \DateTime
{
protected $terms = array(
'today' => 'now',
'tomorrow' => '+1 days',
);
<?php
// ...
$qb->add('where', 'x.date = :date')
->setParameter('date', new \DateTime('+2 days'), \Doctrine\DBAL\Types\Type::DATETIME);
// ...