03. มอดูลมีข้ออนุญาตอะไรบ้าง (Telling Drupal who can use your module)
Submitted by wd on Wed, 2008-01-16 12:14
เขียนชื่อฟังก์ชั่นในรูป hook_perm
รูปแบบฟังก์ชั่นคือ
<?php
function newmodule_perm() {
return array('access newmodule', 'create newmodule', 'administer newmodule');
} / function newmodule_perm
?>ตามตัวอย่างนี้คือ
<?php
/**
* Valid permissions for this module
* @return array An array of valid permissions for the onthisdate module
*/
function onthisdate_perm() {
return array('access onthisdate content', 'administer onthisdate');
} // function onthisdate_perm
?>ดูเพิ่มที่
- Printer-friendly version
- Log in or register to post comments
- 5378 reads







Recent comments