Skip to content

Instantly share code, notes, and snippets.

View ahonymous's full-sized avatar
💭
I may be slow to respond.

Oleksandr Moshta ahonymous

💭
I may be slow to respond.
  • Ukraine, Cherkasy
View GitHub Profile
<?php
require_once 'vendor/autoload.php';
use Filipac\Ip;
PHP_Timer::start();
$ip = Ip::get();
echo "Hello, your ip is: {$ip} </br> ";
@ahonymous
ahonymous / 000-default.conf
Last active October 19, 2016 16:18
Example of config APACHE2 with virtual hosts
<VirtualHost *:80>
#ServerName www.example.com
ServerAdmin ahonymous@gmail.com
DocumentRoot /home/alex/extra/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /home/alex/extra/www/html>
public function addCommentAction(Request $request)
{
$comment = new Comment();
$form = $this->createForm(new CommentFormType(),$comment);
if ($request->isMethod('POST')) {
$form->handleRequest($request);
if ($form->isValid()) {

11.11.2014 Symfony overview, Controller, Routing, Twig

  • Install Symfony standart edition
  • Symfony Bundles
  • Symfony Components
  • Create Bundle, route and controller
  • Add twig view

18.11.2014 Databases and Doctrine

<?php
namespace <dsaaffa>;
use Symfony\Bundle\FrameworkBundle\Client;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\ConsoleOutput;
<?php
namespace <Organization>\AppBundle\Tests;
use Symfony\Component\Form\Extension\Core\CoreExtension;
use Symfony\Component\Form\Extension\Validator\Type\FormTypeValidatorExtension;
use Symfony\Component\Form\Forms;
use Symfony\Component\Form\Test\TypeTestCase;
use Symfony\Component\Validator\ConstraintViolationList;