Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit d4bf9c2

Browse files
committed
Merge pull request #65 from froschdesign/hotfix/docs/59
[Docs] Fixes #59 - Check Documentation Code Blocks
2 parents 97b7c95 + 49714a2 commit d4bf9c2

File tree

3 files changed

+91
-87
lines changed

3 files changed

+91
-87
lines changed

doc/book/zend.mvc.intro.md

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,22 @@ sending the response.
4141

4242
The basic application structure follows:
4343

44-
application_root/
45-
config/
46-
application.config.php
47-
autoload/
48-
global.php
49-
local.php
50-
// etc.
51-
data/
52-
module/
53-
vendor/
54-
public/
55-
.htaccess
56-
index.php
57-
init_autoloader.php
44+
```
45+
application_root/
46+
config/
47+
application.config.php
48+
autoload/
49+
global.php
50+
local.php
51+
// etc.
52+
data/
53+
module/
54+
vendor/
55+
public/
56+
.htaccess
57+
index.php
58+
init_autoloader.php
59+
```
5860

5961
The `public/index.php` marshalls all user requests to your website, retrieving an array of
6062
configuration located in `config/application.config.php`. On return, it `run()`s the `Application`,
@@ -84,29 +86,31 @@ of tasks.
8486

8587
The recommended module structure follows:
8688

87-
module_root<named-after-module-namespace>/
88-
Module.php
89-
autoload_classmap.php
90-
autoload_function.php
91-
autoload_register.php
92-
config/
93-
module.config.php
94-
public/
95-
images/
96-
css/
97-
js/
98-
src/
99-
<module_namespace>/
100-
<code files>
101-
test/
102-
phpunit.xml
103-
bootstrap.php
104-
<module_namespace>/
105-
<test code files>
106-
view/
107-
<dir-named-after-module-namespace>/
108-
<dir-named-after-a-controller>/
109-
<.phtml files>
89+
```
90+
module_root<named-after-module-namespace>/
91+
Module.php
92+
autoload_classmap.php
93+
autoload_function.php
94+
autoload_register.php
95+
config/
96+
module.config.php
97+
public/
98+
images/
99+
css/
100+
js/
101+
src/
102+
<module_namespace>/
103+
<code files>
104+
test/
105+
phpunit.xml
106+
bootstrap.php
107+
<module_namespace>/
108+
<test code files>
109+
view/
110+
<dir-named-after-module-namespace>/
111+
<dir-named-after-a-controller>/
112+
<.phtml files>
113+
```
110114

111115
Since a module acts as a namespace, the module root directory should be that namespace. This
112116
namespace could also include a vendor prefix of sorts. As an example a module centered around "User"

doc/book/zend.mvc.quick-start.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ be done in the following ways.
1212

1313
Simply clone the `ZendSkeletonApplication` repository:
1414

15-
```php
15+
```bash
1616
prompt> git clone git://github.com/zendframework/ZendSkeletonApplication.git my-application
1717
```
1818

1919
Then run [Composer](http://getcomposer.org/)'s `install` command to install the ZF library and any
2020
other configured dependencies:
2121

22-
```php
22+
```bash
2323
prompt> php ./composer.phar install
2424
```
2525

@@ -28,7 +28,7 @@ prompt> php ./composer.phar install
2828
Simply clone the `ZendSkeletonApplication` repository, using the `--recursive` option, which will
2929
also grab ZF.
3030

31-
```php
31+
```bash
3232
prompt> git clone --recursive git://github.com/zendframework/ZendSkeletonApplication.git
3333
my-application
3434
```
@@ -249,47 +249,47 @@ your module. Replace &lt;module-name&gt; with the name of your module.
249249
```php
250250
// module.config.php
251251
return array(
252-
'<module-name' = array(
253-
'type' = 'Literal',
254-
'options' = array(
255-
'route' = '/<module-name',
256-
'defaults' = array(
257-
'controller' = '<module-namespace\Controller\Index',
258-
'action' = 'index',
259-
),
260-
),
261-
'may_terminate' = true,
262-
'child_routes' = array(
263-
'default' = array(
264-
'type' = 'Segment',
265-
'options' = array(
266-
'route' = '/[:controller[/:action]]',
267-
'constraints' = array(
268-
'controller' = '[a-zA-Z][a-zA-Z0-9_-]*',
269-
'action' = '[a-zA-Z][a-zA-Z0-9_-]*',
270-
),
271-
'defaults' = array(
272-
),
273-
),
274-
),
275-
),
276-
),
277-
// ... other configuration ...
252+
'<module-name>' => array(
253+
'type' => 'Literal',
254+
'options' => array(
255+
'route' => '/<module-name>',
256+
'defaults' => array(
257+
'controller' => '<module-namespace>\Controller\Index',
258+
'action' => 'index',
259+
),
260+
),
261+
'may_terminate' => true,
262+
'child_routes' => array(
263+
'default' => array(
264+
'type' => 'Segment',
265+
'options' => array(
266+
'route' => '/[:controller[/:action]]',
267+
'constraints' => array(
268+
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
269+
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
270+
),
271+
'defaults' => array(
272+
),
273+
),
274+
),
275+
),
276+
),
277+
// ... other configuration ...
278278
);
279279
```
280280

281281
Additionally, we need to tell the application we have a controller:
282282

283-
> ```php
283+
```php
284284
// module.config.php
285285
return array(
286-
'controllers' = array(
287-
'invokables' = array(
288-
'<module-namespace\Controller\Index' = '<module-namespace\Controller\IndexController',
289-
// Do similar for each other controller in your module
290-
),
291-
),
292-
// ... other configuration ...
286+
'controllers' => array(
287+
'invokables' => array(
288+
'<module-namespace>\Controller\Index' => '<module-namespace>\Controller\IndexController',
289+
// Do similar for each other controller in your module
290+
),
291+
),
292+
// ... other configuration ...
293293
);
294294
```
295295

@@ -365,15 +365,15 @@ ZendSkeletonApplication.
365365
Now alter the location in your URL to append the path "/hello/world", and load the page. You should
366366
now get the following content:
367367

368-
```php
368+
```html
369369
<h1>Greetings!</h1>
370370

371371
<p>You said "foo".</p>
372372
```
373373

374374
Now alter the location to append "?message=bar" and load the page. You should now get:
375375

376-
```php
376+
```html
377377
<h1>Greetings!</h1>
378378

379379
<p>You said "bar".</p>

doc/book/zend.mvc.routing.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -325,18 +325,18 @@ In the above example, the `$routePlugins` is an instance of `Zend\Mvc\Router\Rou
325325
```php
326326
$routePlugins = new Zend\Mvc\Router\RoutePluginManager();
327327
$plugins = array(
328-
'hostname' = 'Zend\Mvc\Router\Http\Hostname',
329-
'literal' = 'Zend\Mvc\Router\Http\Literal',
330-
'part' = 'Zend\Mvc\Router\Http\Part',
331-
'regex' = 'Zend\Mvc\Router\Http\Regex',
332-
'scheme' = 'Zend\Mvc\Router\Http\Scheme',
333-
'segment' = 'Zend\Mvc\Router\Http\Segment',
334-
'wildcard' = 'Zend\Mvc\Router\Http\Wildcard',
335-
'query' = 'Zend\Mvc\Router\Http\Query',
336-
'method' = 'Zend\Mvc\Router\Http\Method',
328+
'hostname' => 'Zend\Mvc\Router\Http\Hostname',
329+
'literal' => 'Zend\Mvc\Router\Http\Literal',
330+
'part' => 'Zend\Mvc\Router\Http\Part',
331+
'regex' => 'Zend\Mvc\Router\Http\Regex',
332+
'scheme' => 'Zend\Mvc\Router\Http\Scheme',
333+
'segment' => 'Zend\Mvc\Router\Http\Segment',
334+
'wildcard' => 'Zend\Mvc\Router\Http\Wildcard',
335+
'query' => 'Zend\Mvc\Router\Http\Query',
336+
'method' => 'Zend\Mvc\Router\Http\Method',
337337
);
338-
foreach ($plugins as $name = $class) {
339-
$routePlugins-setInvokableClass($name, $class);
338+
foreach ($plugins as $name => $class) {
339+
$routePlugins->setInvokableClass($name, $class);
340340
}
341341
```
342342
When using `Zend\Mvc\Router\Http\TreeRouteStack`, the `RoutePluginManager` is set up by default, and

0 commit comments

Comments
 (0)