File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff 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```
2424services:
@@ -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+ ```
You can’t perform that action at this time.
0 commit comments