Skip to content

Commit a5c79de

Browse files
authored
Update README.md
1 parent 7c12d87 commit a5c79de

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

README.md

+26-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This componenet automaticaly generates robots from parameters in configuration.
1818
- You might also want to change mime type to `text/plain`.
1919
- Modify parameters to accomplish your needs.
2020

21-
## Example configuration
21+
### Example configuration
2222

2323
```
2424
services:
@@ -37,3 +37,28 @@ parameters:
3737
- '/example'
3838
- '/example2'
3939
```
40+
41+
### Example presenter
42+
43+
```
44+
class ExamplePresenter implements IPresenter
45+
{
46+
/** @var \Nepttune\Component\IRobotsFactory */
47+
protected $iRobotsFactory;
48+
49+
public function __construct(\Nepttune\Component\IRobotsFactory $IRobotsFactory)
50+
{
51+
$this->iRobotsFactory = $IRobotsFactory;
52+
}
53+
54+
public function actionRobots()
55+
{
56+
$this->getHttpResponse()->setContentType('text/plain');
57+
}
58+
59+
protected function createComponentRobots()
60+
{
61+
return $this->iRobotsFactory->create();
62+
}
63+
}
64+
```

0 commit comments

Comments
 (0)