Skip to content

Instantly share code, notes, and snippets.

Ryan Weaver weaverryan

Block or report user

Report or block weaverryan

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
@weaverryan
weaverryan / console.php
Last active May 14, 2018
working on console
View console.php
#!/usr/bin/env php
<?php
use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
use Symfony\Component\Dotenv\Dotenv;
set_time_limit(0);
@weaverryan
weaverryan / deets.md
Created Feb 8, 2018
PhpStorm Users with Symfony!
View deets.md

PhpStorm has some AWESOME plugins for Symfony.

To install them:

  1. Open the PhpStorm "Preferences"
  2. Search "Symfony" and select the top-level Plugin menu item
  3. Near the bottom, click the "Browse Repositories" button

Browse Repositories

@weaverryan
weaverryan / Comment.php
Last active Feb 8, 2018
Symfony Demo with make:entity --regenerate --overwrite
View Comment.php
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@weaverryan
weaverryan / test-maker.md
Created Feb 8, 2018
How to help test the new make:entity Command
View test-maker.md
  1. In your composer.json file, add the weaverryan fork:
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/weaverryan/maker-bundle"
        }
    ],
View ProductuController.php
<?php
namespace App\Controller;
use App\Repository\ProdutoRepository;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class ProdutoController extends Controller
{
@weaverryan
weaverryan / the_form.html.twig
Last active Jan 13, 2018
fosU registration form
View the_form.html.twig
{# ... #}
{% block body %}
{{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr': {'class': 'fos_user_registration_register'}}) }}
{{ form_row(form.email, {
attr: { class: 'some-custom-class'}
}) }}
{{ form_row(form.username) }}
{{ form_row(form.plainPassword) }}
<div>
@weaverryan
weaverryan / framework.yml
Last active Jan 7, 2018
different caching
View framework.yml
framework:
# ...
cache:
app: cache.adapter.apcu
# or you could use cache.adapter.redis
# and configure below via
# default_redis_provider: redis://localhost
@weaverryan
weaverryan / details.md
Created Nov 18, 2017
SymfonyCon Hackday Details
View details.md
@weaverryan
weaverryan / CoolStuff.php
Last active Nov 6, 2017
Autowireable & Auto-registered Repository Services in Doctrine 1.8
View CoolStuff.php
<?php
// Coming in DoctrineBundle 1.8: https://github.com/doctrine/DoctrineBundle/pull/727
/* *********************
src/Entity/CoolStuff.php
/* ********************* */
/**
* @ORM\Entity(repositoryClass="App\Repository\CoolStuffRepository")
*/
class CoolStuff
@weaverryan
weaverryan / FooController.php
Last active Apr 18, 2017
Autowiring controller args
View FooController.php
<?php
namespace AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Psr\Log\LoggerInterface;
/**
* This class is now a service, so you can use normal __construct DI if you want!
*/
You can’t perform that action at this time.