2
2
3
3
namespace SmartCore \Module \Menu \Controller ;
4
4
5
+ use Symfony \Component \HttpFoundation \Request ;
5
6
use Symfony \Component \HttpFoundation \Response ;
6
7
7
8
class MenuController extends Controller
8
9
{
9
- public function indexAction ()
10
+ public function indexAction (Request $ request )
10
11
{
11
12
$ current_folder_path = $ this ->get ('cms.context ' )->getCurrentFolderPath ();
12
13
13
14
$ cache_key = md5 ('smart_module.menu ' .$ current_folder_path .$ this ->node ->getId ());
14
15
15
16
if (false == $ menu = $ this ->getCacheService ()->get ($ cache_key )) {
16
17
// Хак для Menu\RequestVoter
17
- $ this -> get ( ' request ' ) ->attributes ->set ('__selected_inheritance ' , $ this ->selected_inheritance );
18
- $ this -> get ( ' request ' ) ->attributes ->set ('__current_folder_path ' , $ current_folder_path );
18
+ $ request ->attributes ->set ('__selected_inheritance ' , $ this ->selected_inheritance );
19
+ $ request ->attributes ->set ('__current_folder_path ' , $ current_folder_path );
19
20
20
- $ menu = $ this ->renderView ('MenuModule::menu.html.twig ' , [
21
+ $ menu = $ this ->get ( ' twig ' )-> render ('MenuModule::menu.html.twig ' , [
21
22
'css_class ' => $ this ->css_class ,
22
23
'current_class ' => $ this ->current_class ,
23
24
'depth ' => $ this ->depth ,
@@ -28,8 +29,8 @@ public function indexAction()
28
29
29
30
$ this ->getCacheService ()->set ($ cache_key , $ menu , ['smart_module.menu ' , 'folder ' , 'node_ ' .$ this ->node ->getId ()]);
30
31
31
- $ this -> get ( ' request ' ) ->attributes ->remove ('__selected_inheritance ' );
32
- $ this -> get ( ' request ' ) ->attributes ->remove ('__current_folder_path ' );
32
+ $ request ->attributes ->remove ('__selected_inheritance ' );
33
+ $ request ->attributes ->remove ('__current_folder_path ' );
33
34
}
34
35
35
36
$ this ->node ->addFrontControl ('edit ' )
0 commit comments