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

Fix action name in controller#9152

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
javiereguiluz merged 1 commit intosymfony:masterfromfdespier:fix/action-controller
Jan 28, 2018
Merged
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
16 changes: 8 additions & 8 deletionscontroller.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -145,7 +145,7 @@ and ``redirect()`` methods::
use Symfony\Component\HttpFoundation\RedirectResponse;

// ...
public functionindexAction()
public functionindex()
{
// redirect to the "homepage" route
return $this->redirectToRoute('homepage');
Expand DownExpand Up@@ -209,7 +209,7 @@ If you need a service in a controller, just type-hint an argument with its class
/**
* @Route("/lucky/number/{max}")
*/
public functionnumberAction($max, LoggerInterface $logger)
public functionnumber($max, LoggerInterface $logger)
{
$logger->info('We are logging!');
// ...
Expand DownExpand Up@@ -303,7 +303,7 @@ special type of exception::
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

// ...
public functionindexAction()
public functionindex()
{
// retrieve the object from database
$product = ...;
Expand DownExpand Up@@ -348,7 +348,7 @@ object. To get it in your controller, just add it as an argument and

use Symfony\Component\HttpFoundation\Request;

public functionindexAction(Request $request, $firstName, $lastName)
public functionindex(Request $request, $firstName, $lastName)
{
$page = $request->query->get('page', 1);

Expand DownExpand Up@@ -392,7 +392,7 @@ To get the session, add an argument and type-hint it with

use Symfony\Component\HttpFoundation\Session\SessionInterface;

public functionindexAction(SessionInterface $session)
public functionindex(SessionInterface $session)
{
// store an attribute for reuse during a later user request
$session->set('foo', 'bar');
Expand DownExpand Up@@ -432,7 +432,7 @@ For example, imagine you're processing a :doc:`form </forms>` submission::

use Symfony\Component\HttpFoundation\Request;

public functionupdateAction(Request $request)
public functionupdate(Request $request)
{
// ...

Expand DownExpand Up@@ -524,7 +524,7 @@ the ``Request`` class::

use Symfony\Component\HttpFoundation\Request;

public functionindexAction(Request $request)
public functionindex(Request $request)
{
$request->isXmlHttpRequest(); // is it an Ajax request?

Expand DownExpand Up@@ -579,7 +579,7 @@ To return JSON from a controller, use the ``json()`` helper method. This returns
special ``JsonResponse`` object that encodes the data automatically::

// ...
public functionindexAction()
public functionindex()
{
// returns '{"username":"jane.doe"}' and sets the proper Content-Type header
return $this->json(array('username' => 'jane.doe'));
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp