소스 검색

Fix typo in troubleshooting

Jérémy 12 년 전
부모
커밋
7ad6373d40
3개의 변경된 파일3개의 추가작업 그리고 28개의 파일을 삭제
  1. 2 1
      Resources/doc/index.rst
  2. 0 26
      Resources/doc/reference/architecture.rst
  3. 1 1
      Resources/doc/reference/troubleshooting.rst

+ 2 - 1
Resources/doc/index.rst

@@ -35,6 +35,7 @@ Reference Guide
    reference/advance
    reference/console
    reference/preview_mode
+   reference/troubleshooting
 
 Overview
 --------
@@ -65,4 +66,4 @@ Overview
    :alt: The modal model edition
    :width: 700px
 
-   The modal model edition
+   The modal model edition

+ 0 - 26
Resources/doc/reference/architecture.rst

@@ -157,31 +157,5 @@ Note that you can use both the Bundle:Controller format or a `service name`_ to
 specify what controller to load.
 
 
-Good to know
-------------
-
-Sometimes the bundle needs to display your model objects, in order to do it, objects are converted to string by using the `__toString`_ magic method.
-Take care to never return anything else than a string in this method.
-For example, if your method looks like that :
-
-.. code-block:: php
-
-    public function __toString()
-    {
-        return $this->getTitle();
-    }
-
-
-You can't be sure your object will *always* have a title when the bundle will want to convert it to a string.
-So in order to avoid any fatal error, you must return an empty string (or anything you prefer) for when the title is missing, like this :
-
-.. code-block:: php
-
-    public function __toString()
-    {
-        return $this->getTitle() ?: '';
-    }
-
 .. _`Django Project Website`: http://www.djangoproject.com/
 .. _`service name`: http://symfony.com/doc/2.0/cookbook/controller/service.html
-.. _`__toString`: http://www.php.net/manual/en/language.oop5.magic.php#object.tostring

+ 1 - 1
Resources/doc/reference/troubleshooting.rst

@@ -27,4 +27,4 @@ So in order to avoid any fatal error, you must return an empty string (or anythi
     }
 
 
-+.. _`__toString`: http://www.php.net/manual/en/language.oop5.magic.php#object.tostring
+.. _`__toString`: http://www.php.net/manual/en/language.oop5.magic.php#object.tostring