Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi! I cleaned up your code for you! #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc

# Numerous always-ignore extensions
###################
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.vi
*~

*.sass-cache
# Folders to ignore
###################
.hg
.svn
.CVS
# OS or Editor folders
###################
.DS_Store
Icon?
Thumbs.db
ehthumbs.db
nbproject
.cache
.project
.settings
.tmproj
*.esproj
*.sublime-project
*.sublime-workspace
# Dreamweaver added files
###################
_notes
dwsync.xml
# Komodo
###################
*.komodoproject
.komodotools
14 changes: 7 additions & 7 deletions book/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ object is the end-product of the internal sub-request::
));

// further modify the response or return it directly

return $response;
}

Expand Down Expand Up @@ -449,7 +449,7 @@ value to each variable.
a shortcut for core Symfony2 functionality. A forward can be accomplished
directly via the ``http_kernel`` service. A forward returns a ``Response``
object::

$httpKernel = $this->container->get('http_kernel');
$response = $httpKernel->forward('AcmeHelloBundle:Hello:fancy', array(
'name' => $name,
Expand Down Expand Up @@ -488,7 +488,7 @@ The Symfony templating engine is explained in great detail in the

The ``renderView`` method is a shortcut to direct use of the ``templating``
service. The ``templating`` service can also be used directly::

$templating = $this->get('templating');
$content = $templating->render('AcmeHelloBundle:Hello:index.html.twig', array('name' => $name));

Expand Down Expand Up @@ -604,12 +604,12 @@ Let's show an example where we're processing a form submit::
{
if ('POST' === $this->get('request')->getMethod()) {
// do some sort of processing

$this->get('session')->setFlash('notice', 'Your changes were saved!');

return new RedirectResponse($this->generateUrl(...));
}

return $this->render(...);
}

Expand All @@ -628,7 +628,7 @@ could be used to render the message:
{% endif %}

.. code-block:: php

<?php if ($view['session']->hasFlash('notice') ?>
<div class="flash-notice">
<?php echo $view['session']->getFlash('notice') ?>
Expand All @@ -652,7 +652,7 @@ headers and content that's sent back to the client::

// create a simple Response with a 200 status code (the default)
$response = new Response('Hello '.$name, 200);

// create a JSON-response with a 200 status code
$response = new Response(json_encode(array('name' => $name)));
$response->headers->set('Content-Type', 'application/json');
Expand Down
2 changes: 1 addition & 1 deletion book/doctrine/dbal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ be added to all configured connections.
</container>

.. code-block:: php

// app/config/config.php
$container->loadFromExtension('doctrine', array(
'dbal' => array(
Expand Down
16 changes: 8 additions & 8 deletions book/doctrine/model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,42 +42,42 @@ model. If you're building a content management system, then you will
need a ``Page`` model.

.. code-block:: php

<?php

namespace Blog;

class Post
{
private $title;
private $body;
private $createdAt;
private $updatedAt;

public function __construct($title, $body)
{
$this->title = $title;
$this->body = $body;
$this->createdAt = new \DateTime();
}

public function setTitle($title)
{
$this->title = $title;
$this->updatedAt = new \DateTime();
}

public function setBody($body)
{
$this->body = $body;
$this->updatedAt = new \DateTime();
}

public function getTitle()
{
return $this->title;
}

public function getBody()
{
return $this->body;
Expand Down
Loading