8000 Contributing to the Documentation Symfony 2.0 by Jonathand Serrano. · symfony/symfony-docs@0585020 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0585020

Browse files
rootroot
authored andcommitted
Contributing to the Documentation Symfony 2.0 by Jonathand Serrano.
1 parent 43d8225 commit 0585020

File tree

5 files changed

+61
-3
lines changed

5 files changed

+61
-3
lines changed

book/doctrine/orm.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,13 @@ you just need to run the following command:
234234
Now your database will be updated and the new column added to the database
235235
table.
236236

237+
In this case we can easily obtain an object of our entity from the id as follows:
238+
239+
* @extra: Route ("/ path / {id} /", name = "_path_name)
240+
* @extra ParameterConverter ("parameter" class = "MyBundle: Entity")
241+
242+
Having done this the parameter that is entered by the function will be an object of our entity
243+
237244
.. index::
238245
single: Configuration; Doctrine ORM
239246
single: Doctrine; ORM Configuration
@@ -285,6 +292,9 @@ The following example shows an overview of the caching configurations:
285292
port: 11211
286293
instance_class: Memcache
287294
295+
296+
This will allow us to specify that everything will work from PHP
297+
288298
Mapping Configuration
289299
~~~~~~~~~~~~~~~~~~~~~
290300

@@ -352,6 +362,18 @@ The following configuration shows a bunch of mapping examples:
352362
dir: %kernel.root_dir%/../src/vendor/DoctrineExtensions/lib/DoctrineExtensions/Entity
353363
prefix: DoctrineExtensions\Entity\
354364
alias: DExt
365+
You should be aware that you can also espeficar the configuration of each bundle, as follows:
366+
367+
/ app / config / config.yml
368+
orm:
369+
auto_generate_proxy_classes:% kernel.debug%
370+
default_entity_manager: default
371+
entity_managers:
372+
default:
373+
mappings:
374+
AcmeDemoBundle: ~
375+
MyBundle:
376+
type: annotation
355377

356378
Multiple Entity Managers
357379
~~~~~~~~~~~~~~~~~~~~~~~~

book/forms.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,10 @@ Placing the form logic into its own class means that the form can be easily
666666
reused elsewhere in your project. This is the best way to create forms, but
667667
the choice is ultimately up to you.
668668

669+
The documentation for beginners on this is very confusing, since it takes into account detailed aspects for understanding the concepts and apply them easily. It should make a tutorial step by step detail to ensure a specific outcome.
670+
671+
It should specify about AbstractType class that contains methods and how to get data for Form class
672+
669673
.. index::
670674
single: Forms; Doctrine
671675

@@ -714,7 +718,7 @@ Embedded Forms
714718
--------------
715719

716720
Often, you'll want to build a form that will include fields from many different
717-
objects. For example, a registration form must contain data belonging to
721+
objects. For example, a registration form must (required) contain data belonging to
718722
a ``User`` object as well as many ``Address`` objects. Fortunately, this
719723
is easy and natural with the form component.
720724

book/testing.rst

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ it yet, you can read its excellent `documentation`_.
1919

2020
Symfony2 works with PHPUnit 3.5.11 or later.
2121

22+
For linux:
23+
How to install phpunit in 2 steps:
24+
1. Installing and upgrading PHP Pear.
25+
To install phpunit, go to the console:
26+
$ sudo apt-get update
27+
$ sudo apt-get install php-pear
28+
$ sudo pear upgrade pear
29+
2. Adding channels, downloading and installing PHPUnit
30+
$ pear channel-discover pear.phpunit.de
31+
$ pear channel-discover components.ez.no
32+
$ pear channel-discover pear.symfony-project.com
33+
$pear install phpunit / PHPUnit
34+
2235
The default PHPUnit configuration looks for tests under the ``Tests/``
2336
sub-directory of your bundles:
2437

@@ -121,13 +134,25 @@ for ``HelloController`` that reads as follows::
121134
}
122135
}
123136

124-
The ``createClient()`` method returns a client tied to the current application::
137+
The ``createClient()`` method returns a client tied to the current application.This client is the one used during the test, the client can perform all actions that would conduct a customer in practice::
125138

126139
$crawler = $client->request('GET', 'hello/Fabien');
127140

128141
The ``request()`` method returns a ``Crawler`` object which can be used to
129142
select elements in the Response, to click on links, and to submit forms.
130143

144+
..Notes::
145+
The functions that are protected by authentication security, the customer must enter the simulation through the system and apply the tests to each of the functions. If authentication is not performed, will not be possible to test these functions.It is very important to use the same client throughout the test.
146+
For example:
147+
$client = $this->createClient();
148+
$crawler = $client->request('GET', '/login');
149+
$form = $crawler->selectButton('login')->form();
150+
$client->submit($form,array('_username'=>'admin',
151+
'_password'=>'adminpass',));
152+
//....your test
153+
154+
155+
131156
.. tip::
132157

133158
The Crawler can only be used if the Response content is an XML or an HTML

quick_tour/the_architecture.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ to use pre-built features packaged in third-party bundles or to distribute
108108
your own bundles. It makes it easy to pick and choose which features to enable
109109
in your application and optimize them the way you want.
110110

111+
For beginners:
112+
Within the project we created a file.php usually called, the name of the folder of my project, followed by the name of the bundle folder. That is, if my project is called JAS, and the folder of my bundle is called TutorialBundle, my Bundle JASTutorialBundle be called, that is to follow a standard symfony project.
113+
114+
111115
Registering a Bundle
112116
~~~~~~~~~~~~~~~~~~~~
113117

quick_tour/the_controller.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ match. In this example, if you try to request the ``/demo/hello/Fabien.js``
5656
resource, you will get a 404 HTTP error, as it does not match the ``_format``
5757
requirement.
5858

59+
For beginners:
60+
the controllers are created in a folder called Controller, in our project folder and turn in the respective folder Bundle. The name of the Controller (by convention) ends in the word Controller, that is, if my Controller is called tutorial, you should be tutorialController.
61+
5962
Redirecting and Forwarding
6063
--------------------------
6164

@@ -252,4 +255,4 @@ That's all there is to it, and I'm not even sure we have spent the full
252255
10 minutes. We briefly introduced bundles in the first part, and all the
253256
features we've learned about so far are part of the core framework bundle.
254257
But thanks to bundles, everything in Symfony2 can be extended or replaced.
255-
That's the topic of the next part of this tutorial.
258+
That's the topic of the next part of this tutorial.

0 commit comments

Comments
 (0)
0