有没有办法在“访问回调”功能中使用Drupal菜单的“页面参数”?

时间:2014-08-08 14:29:06

标签: drupal drupal-7 drupal-routes

有没有办法使用Drupal菜单"页面参数"在"访问回调"功能? 我需要同时使用'访问参数'和#39;访问回调'

  
    

'页面参数' =>数组(3,4),

         

'访问参数' =>数组('访问mymodule数据'),

         

'访问回调' => ' mymodule_application_page_access',

  

是否可以使用作为"页面参数传递的值"在我的"访问回调"方法 - mymodule_application_page_access?

1 个答案:

答案 0 :(得分:1)

当然,你可以这样做:

    $menu['mymodule/path1/path2/%/%'] = array(
         //.... some stuff
        'page callback' => 'mymodule_somecallback',
        'page arguments' => array(3, 4),
        'access arguments' => array('access mymodule data',3,4),
        'access callback' => 'mymodule_application_page_access',
        //.... some more stuff
   );
相关问题