开发者

Friendly URL in Drupal to a PDF that is buried deep in a module?

I have a PDF burried in a module (sites/all/modules/mymodule/开发者_如何学运维pdf/userguide.pdf)....how do i make it a friendly url like (sitename.com/mymodule/userguide.pdf) ?


or in your module code next:

/**
 * Implementation of hook_menu()
 */
function mymodule_menu() {
  $items['mymodule'] = array(
    'page callback' => 'mymodule_pdf',
    'type' => MENU_CALLBACK,
    'access arguments' => array('access content'),
    'page arguments' => array(1),
  );
  ...
  return $items;
}

function mymodule_pdf ($filename) {
// function that will upload generated $filename.pdf
}

p.s. Also you can try add alias via path module, map: sites/all/modules/mymodule/pdf/userguide.pdf to mymodule/userguide.pdf...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜