Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Minimize horizontal scrolling in code blocks to improve readability#3553

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
weaverryan merged 1 commit intosymfony:2.3fromifdattic:minimize-horizontal-scrolling
Feb 18, 2014
Merged
Show file tree
Hide file tree
Changes fromall 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
8 changes: 6 additions & 2 deletionsbook/controller.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -508,7 +508,10 @@ value to each variable.
$subRequest = $request->duplicate(array(), null, $path);

$httpKernel = $this->container->get('http_kernel');
$response = $httpKernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
$response = $httpKernel->handle(
$subRequest,
HttpKernelInterface::SUB_REQUEST
);

..index::
single: Controller; Rendering templates
Expand DownExpand Up@@ -574,7 +577,8 @@ The Symfony templating engine is explained in great detail in the
'AcmeHelloBundle:Hello/Greetings:index.html.twig',
array('name' => $name)
);
// index.html.twig found in Resources/views/Hello/Greetings is rendered.
// index.html.twig found in Resources/views/Hello/Greetings
// is rendered.

..index::
single: Controller; Accessing services
Expand Down
27 changes: 16 additions & 11 deletionsbook/doctrine.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -622,8 +622,10 @@ Once you have your repository, you have access to all sorts of helpful methods::
You can also take advantage of the useful ``findBy`` and ``findOneBy`` methods
to easily fetch objects based on multiple conditions::

// query for one product matching by name and price
$product = $repository->findOneBy(array('name' => 'foo', 'price' => 19.99));
// query for one product matching be name and price
$product = $repository->findOneBy(
array('name' => 'foo', 'price' => 19.99)
);

// query for all products matching the name, ordered by price
$products = $repository->findBy(
Expand DownExpand Up@@ -1144,7 +1146,8 @@ Now you can see this new code in action! Imagine you're inside a controller::
$em->flush();

return new Response(
'Created product id: '.$product->getId().' and category id: '.$category->getId()
'Created product id: '.$product->getId()
.' and category id: '.$category->getId()
);
}
}
Expand DownExpand Up@@ -1478,8 +1481,8 @@ and ``nullable``. Take a few examples:
protected $name;

/**
* A string field of length 150 that persists to an "email_address" column
* and has a unique index.
* A string field of length 150 that persists to an
*"email_address" columnand has a unique index.
*
* @ORM\Column(name="email_address", unique=true, length=150)
*/
Expand All@@ -1489,13 +1492,14 @@ and ``nullable``. Take a few examples:

fields:
# A string field length 255 that cannot be null
# (reflecting the default values for the "length" and *nullable* options)
# type attribute is necessary in YAML definitions
# (reflecting the default values for the "length"
# and *nullable* options) type attribute is
# necessary in YAML definitions
name:
type: string

# A string field of length 150 that persists to an "email_address" column
# and has a unique index.
# A string field of length 150 that persists to
#an "email_address" columnand has a unique index.
email:
type: string
column: email_address
Expand All@@ -1506,8 +1510,9 @@ and ``nullable``. Take a few examples:

<!--
A string field length 255 that cannot be null
(reflecting the default values for the "length" and *nullable* options)
type attribute is necessary in XML definitions
(reflecting the default values for the "length"
and *nullable* options) type attribute is
necessary in XML definitions
-->
<field name="name" type="string" />
<field name="email"
Expand Down
13 changes: 9 additions & 4 deletionscomponents/form/introduction.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -181,8 +181,10 @@ to bootstrap or access Twig and add the :class:`Symfony\\Bridge\\Twig\\Extension
$defaultFormTheme = 'form_div_layout.html.twig';

$vendorDir = realpath(__DIR__ . '/../vendor');
// the path to TwigBridge so Twig can locate the form_div_layout.html.twig file
$vendorTwigBridgeDir = $vendorDir . '/symfony/twig-bridge/Symfony/Bridge/Twig';
// the path to TwigBridge so Twig can locate the
// form_div_layout.html.twig file
$vendorTwigBridgeDir =
$vendorDir . '/symfony/twig-bridge/Symfony/Bridge/Twig';
// the path to your other templates
$viewsDir = realpath(__DIR__ . '/../views');

Expand All@@ -193,7 +195,9 @@ to bootstrap or access Twig and add the :class:`Symfony\\Bridge\\Twig\\Extension
$formEngine = new TwigRendererEngine(array($defaultFormTheme));
$formEngine->setEnvironment($twig);
// add the FormExtension to Twig
$twig->addExtension(new FormExtension(new TwigRenderer($formEngine, $csrfProvider)));
$twig->addExtension(
new FormExtension(new TwigRenderer($formEngine, $csrfProvider))
);

// create your form factory as normal
$formFactory = Forms::createFormFactoryBuilder()
Expand DownExpand Up@@ -307,7 +311,8 @@ Your integration with the Validation component will look something like this::

$vendorDir = realpath(__DIR__ . '/../vendor');
$vendorFormDir = $vendorDir . '/symfony/form/Symfony/Component/Form';
$vendorValidatorDir = $vendorDir . '/symfony/validator/Symfony/Component/Validator';
$vendorValidatorDir =
$vendorDir . '/symfony/validator/Symfony/Component/Validator';

// create the validator - details will vary
$validator = Validation::createValidator();
Expand Down
13 changes: 10 additions & 3 deletionscomponents/http_foundation/introduction.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -259,7 +259,8 @@ If you need to get full access to parsed data from ``Accept``, ``Accept-Language
}

// accepts items are sorted by descending quality
$accepts = AcceptHeader::fromString($request->headers->get('Accept'))->all();
$accepts = AcceptHeader::fromString($request->headers->get('Accept'))
->all();

Accessing other Data
~~~~~~~~~~~~~~~~~~~~
Expand DownExpand Up@@ -432,7 +433,10 @@ abstracts the hard work behind a simple API::

use Symfony\Component\HttpFoundation\ResponseHeaderBag;

$d = $response->headers->makeDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, 'foo.pdf');
$d = $response->headers->makeDisposition(
ResponseHeaderBag::DISPOSITION_ATTACHMENT,
'foo.pdf'
);

$response->headers->set('Content-Disposition', $d);

Expand DownExpand Up@@ -460,7 +464,10 @@ if it should::
You can still set the ``Content-Type`` of the sent file, or change its ``Content-Disposition``::

$response->headers->set('Content-Type', 'text/plain');
$response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, 'filename.txt');
$response->setContentDisposition(
ResponseHeaderBag::DISPOSITION_ATTACHMENT,
'filename.txt'
);

.. _component-http-foundation-json-response:

Expand Down
4 changes: 3 additions & 1 deletioncomponents/http_kernel/introduction.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -610,7 +610,9 @@ a built-in ControllerResolver that can be used to create a working example::
$routes = new RouteCollection();
$routes->add('hello', new Route('/hello/{name}', array(
'_controller' => function (Request $request) {
return new Response(sprintf("Hello %s", $request->get('name')));
return new Response(
sprintf("Hello %s", $request->get('name'))
);
}
)
));
Expand Down
7 changes: 6 additions & 1 deletioncomponents/intl.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -282,7 +282,12 @@ multi-valued entries (arrays), the values of the more specific and the fallback
locale will be merged. In order to suppress this behavior, the last parameter
``$fallback`` can be set to ``false``::

echo $reader->readEntry('/path/to/bundle', 'en', array('Data', 'entry1'), false);
echo $reader->readEntry(
'/path/to/bundle',
'en',
array('Data', 'entry1'),
false
);

Accessing ICU Data
------------------
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp