File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
testData/actions/generation/generator/NewActionEntityGenerator/generateNewActionEntityFile Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
-
3
2
namespace Foo \Bar \Controller \Adminhtml \Company ;
4
-
5
3
use Magento \Backend \App \Action ;
6
- use Magento \Backend \Model \View \Result \Forward ;
4
+ use Magento \Backend \Model \View \Result \Page ;
7
5
use Magento \Framework \App \Action \HttpGetActionInterface ;
8
6
use Magento \Framework \Controller \ResultFactory ;
9
7
use Magento \Framework \Controller \ResultInterface ;
10
-
11
8
/**
12
9
* New action Company controller.
13
10
*/
@@ -19,18 +16,17 @@ class NewAction extends Action implements HttpGetActionInterface
19
16
* @see _isAllowed()
20
17
*/
21
18
const ADMIN_RESOURCE = 'Foo_Bar::company_id ' ;
22
-
23
19
/**
24
20
* Create new Company action.
25
21
*
26
- * @return ResultInterface|Forward
22
+ * @return Page|ResultInterface
27
23
*/
28
24
public function execute ()
29
25
{
30
- /** @var Forward $resultForward */
31
- $ resultForward = $ this ->resultFactory ->create (ResultFactory::TYPE_FORWARD );
32
- $ resultForward -> forward ( ' edit ' );
33
-
34
- return $ resultForward ;
26
+ /** @var Page $resultPage */
27
+ $ resultPage = $ this ->resultFactory ->create (ResultFactory::TYPE_PAGE );
28
+ $ resultPage -> setActiveMenu ( ' Foo_Bar::menu_id ' );
29
+ $ resultPage -> getConfig ()-> getTitle ()-> prepend ( __ ( ' New Company ' ));
30
+ return $ resultPage ;
35
31
}
36
- }
32
+ }
You can’t perform that action at this time.
0 commit comments