For each request in Symfony2, the goal of the developer is always the same:
to construct and return a Response
object that represents the resource
being requested. This is most obvious inside a controller, which almost always
returns a Response
object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProjectConfiguration extends sfProjectConfiguration | |
{ | |
public function setup() | |
{ | |
$this->setupProjectPlugins(); | |
} | |
/** | |
* Responsible for initiating any plugins and pointing vendor plugins | |
* to the "vendor" subdirectory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Symfony Live CFP: State of the Symfony2 CMF project | |
=================================================== | |
### Title: State of the Symfony2 CMF Project | |
### Level: Beginner | |
### Brief Description | |
Let's face it: managing content is hard. Issues such as versioning, asset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="breadcrumbs"> | |
{% for breadcrumb in breadcrumbs %} | |
{% if not loop.last %} | |
{{ breadcrumb | raw }} {{ breadcrumbs.separator | raw }} | |
{% else %} | |
<strong>{{ breadcrumb.label }}</strong> | |
{% endif %} | |
{% endfor %} | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$start = microtime(true); | |
$limit = 10000; | |
for ($i = 0; $i < $limit; $i++) | |
{ | |
preg_match('#^(GET|HEAD)$#x', 'GET'); | |
preg_match('#^(GET|HEAD)$#x', 'PUT'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$start = microtime(true); | |
$limit = 10000; | |
for ($i = 0; $i < $limit; $i++) | |
{ | |
preg_match('#^(GET|HEAD)$#x', 'GET'); | |
preg_match('#^(GET|HEAD)$#x', 'PUT'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$start = microtime(true); | |
$limit = 10000; | |
for ($i = 0; $i < $limit; $i++) | |
{ | |
in_array('GET', array('GET', 'HEAD')); | |
in_array('PUT', array('GET', 'HEAD')); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Offers a way to save files as a cleaned, unique version of the original filename. | |
* | |
* Use this as the 'validated_file_class' option on sfValidatorFile. | |
* | |
* Bad characters are replaced by the replaceCharacter string. Unique filenames | |
* are created by appending an increasing -# to the end of the basename | |
* of the uploaded file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_once 'app/autoload.php'; | |
$classes = array( | |
'Acme\\FakeBundle', | |
'Zend_Log', | |
'Zend_Fake_class', | |
'Symfony\\Component\\HttpFoundation\\Response', | |
'Symfony\\Bundle\\DoctrineBundle', | |
'Acme\\HelloBundle\\AcmeHelloBundle', | |
'Doctrine\\Foo', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// current | |
$form = $this->get('form.factory')->create( | |
new ProductType(), | |
'my_form', | |
array('csrf_protection' => false, 'data_class' => 'Acme\StoreBundle\Entity\Product') | |
); |
OlderNewer