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

Commit15d8ab8

Browse files
committed
minorsymfony#3553 Minimize horizontal scrolling in code blocks to improve readability (ifdattic)
This PR was merged into the 2.3 branch.Discussion----------Minimize horizontal scrolling in code blocks to improve readability| Q | A| ------------- | ---| Doc fix? | yes| New docs? | no| Applies to | 2.3| Fixed tickets |Commits-------473969f Minimize horizontal scrolling in code blocks to improve readability
2 parents5120863 +473969f commit15d8ab8

File tree

6 files changed

+50
-22
lines changed

6 files changed

+50
-22
lines changed

‎book/controller.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,10 @@ value to each variable.
508508
$subRequest = $request->duplicate(array(), null, $path);
509509

510510
$httpKernel = $this->container->get('http_kernel');
511-
$response = $httpKernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
511+
$response = $httpKernel->handle(
512+
$subRequest,
513+
HttpKernelInterface::SUB_REQUEST
514+
);
512515

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

579583
..index::
580584
single: Controller; Accessing services

‎book/doctrine.rst

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,10 @@ Once you have your repository, you have access to all sorts of helpful methods::
622622
You can also take advantage of the useful ``findBy`` and ``findOneBy`` methods
623623
to easily fetch objects based on multiple conditions::
624624

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

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

11461148
return new Response(
1147-
'Created product id: '.$product->getId().' and category id: '.$category->getId()
1149+
'Created product id: '.$product->getId()
1150+
.' and category id: '.$category->getId()
11481151
);
11491152
}
11501153
}
@@ -1478,8 +1481,8 @@ and ``nullable``. Take a few examples:
14781481
protected $name;
14791482
14801483
/**
1481-
* A string field of length 150 that persists to an "email_address" column
1482-
* and has a unique index.
1484+
* A string field of length 150 that persists to an
1485+
*"email_address" columnand has a unique index.
14831486
*
14841487
* @ORM\Column(name="email_address", unique=true, length=150)
14851488
*/
@@ -1489,13 +1492,14 @@ and ``nullable``. Take a few examples:
14891492
14901493
fields:
14911494
# A string field length 255 that cannot be null
1492-
# (reflecting the default values for the "length" and *nullable* options)
1493-
# type attribute is necessary in YAML definitions
1495+
# (reflecting the default values for the "length"
1496+
# and *nullable* options) type attribute is
1497+
# necessary in YAML definitions
14941498
name:
14951499
type:string
14961500
1497-
# A string field of length 150 that persists to an "email_address" column
1498-
# and has a unique index.
1501+
# A string field of length 150 that persists to
1502+
#an "email_address" columnand has a unique index.
14991503
email:
15001504
type:string
15011505
column:email_address
@@ -1506,8 +1510,9 @@ and ``nullable``. Take a few examples:
15061510
15071511
<!--
15081512
A string field length 255 that cannot be null
1509-
(reflecting the default values for the "length" and *nullable* options)
1510-
type attribute is necessary in XML definitions
1513+
(reflecting the default values for the "length"
1514+
and *nullable* options) type attribute is
1515+
necessary in XML definitions
15111516
-->
15121517
<fieldname="name"type="string" />
15131518
<fieldname="email"

‎components/form/introduction.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,10 @@ to bootstrap or access Twig and add the :class:`Symfony\\Bridge\\Twig\\Extension
181181
$defaultFormTheme = 'form_div_layout.html.twig';
182182

183183
$vendorDir = realpath(__DIR__ . '/../vendor');
184-
// the path to TwigBridge so Twig can locate the form_div_layout.html.twig file
185-
$vendorTwigBridgeDir = $vendorDir . '/symfony/twig-bridge/Symfony/Bridge/Twig';
184+
// the path to TwigBridge so Twig can locate the
185+
// form_div_layout.html.twig file
186+
$vendorTwigBridgeDir =
187+
$vendorDir . '/symfony/twig-bridge/Symfony/Bridge/Twig';
186188
// the path to your other templates
187189
$viewsDir = realpath(__DIR__ . '/../views');
188190

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

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

308312
$vendorDir = realpath(__DIR__ . '/../vendor');
309313
$vendorFormDir = $vendorDir . '/symfony/form/Symfony/Component/Form';
310-
$vendorValidatorDir = $vendorDir . '/symfony/validator/Symfony/Component/Validator';
314+
$vendorValidatorDir =
315+
$vendorDir . '/symfony/validator/Symfony/Component/Validator';
311316

312317
// create the validator - details will vary
313318
$validator = Validation::createValidator();

‎components/http_foundation/introduction.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ If you need to get full access to parsed data from ``Accept``, ``Accept-Language
259259
}
260260

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

264265
Accessing other Data
265266
~~~~~~~~~~~~~~~~~~~~
@@ -432,7 +433,10 @@ abstracts the hard work behind a simple API::
432433

433434
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
434435

435-
$d = $response->headers->makeDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, 'foo.pdf');
436+
$d = $response->headers->makeDisposition(
437+
ResponseHeaderBag::DISPOSITION_ATTACHMENT,
438+
'foo.pdf'
439+
);
436440

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

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

462466
$response->headers->set('Content-Type', 'text/plain');
463-
$response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, 'filename.txt');
467+
$response->setContentDisposition(
468+
ResponseHeaderBag::DISPOSITION_ATTACHMENT,
469+
'filename.txt'
470+
);
464471

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

‎components/http_kernel/introduction.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,9 @@ a built-in ControllerResolver that can be used to create a working example::
610610
$routes = new RouteCollection();
611611
$routes->add('hello', new Route('/hello/{name}', array(
612612
'_controller' => function (Request $request) {
613-
return new Response(sprintf("Hello %s", $request->get('name')));
613+
return new Response(
614+
sprintf("Hello %s", $request->get('name'))
615+
);
614616
}
615617
)
616618
));

‎components/intl.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,12 @@ multi-valued entries (arrays), the values of the more specific and the fallback
282282
locale will be merged. In order to suppress this behavior, the last parameter
283283
``$fallback`` can be set to ``false``::
284284

285-
echo $reader->readEntry('/path/to/bundle', 'en', array('Data', 'entry1'), false);
285+
echo $reader->readEntry(
286+
'/path/to/bundle',
287+
'en',
288+
array('Data', 'entry1'),
289+
false
290+
);
286291

287292
Accessing ICU Data
288293
------------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp