Drupal Dev我想知道:什么时候、什么变化.pptVIP

Drupal Dev我想知道:什么时候、什么变化.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Drupal Dev 我想知道:什么时候、什么变化 Path--Content--Theme *很简单 *很灵活 *你了解了吗 /index.php?q=user/1 *user/% (% wildcard) *$_GET[‘q’] *arg() *url_alias (多语言解决方案) *$_GET[‘q’] 不识庐山真面目 Menu System *input: path(user/%) *output: $content *a path, a menu item, a content 必须的 True(200 OK) Path - Access_Callback - Page_Callback - $content False(403 Forbidden) Path - Access_Callback - $content False(404 Page Not Found) Path - $content Menu System *官方文档 node/102338 *hook_menu title、title callback、page callback、access callback、file *menu_router path、load functions、access_callback、page_callback、file、title、fit *menu_set_active_item() *menu_execute_active_handler() q=user/% = page_callback *$_GET[‘q’] 用户请求、表达用户意愿 *一个path有且只有一个menu item *由load_functions将%转成对象 *由access_callback决定访问权限 *由page_callback返回$content *由theme($hook = ‘page’)输出页面内容 $content $blocks $menu $link … *好吧theme()复杂,苦涩,强大 q=user/% = page_callback 1 q=user/1 2 user/% 3 4 user_view() 5 一般arg(0)是module名称 找到page_callback (user_view) 就知道$content theme() 1 theme() 一切输出尽出于此 2 hook_theme 3 _theme_process_registry() 4 #module#_theme *$hook_theme[$hook][‘template’] *$hook_theme[$hook][‘function’] 5 render_function、preprocess_function、$suggesionts、 hook_theme 1 function user_signature = array( arguments = array(signature = NULL), ) *总能在user.module.php或者user.pages.inc找到函数theme_user_signature($signature = NULL) *函数theme_user_signature($signature)返回值,就是theme(‘user_signature’)要返回的值 2.template user_profile = array( arguments = array(account = NULL), template = user-profile, file = user.pages.inc, ) *user_theme() *arguments 会被合入到$variables *template: 在user模块目录,总能找到文件user-profile.tpl.php文件,文件内容就是theme(‘user_profile’)要输出的内容 *file指定了需要include的文件. theme (template) 1 hook_theme_info 2 有一个与之对应的*.tpl.php 3 *.tpl.php可用到的变量存放在$variables 4 $variables变量由preprocess functions推送 5 默认的render函数theme_render_template 6 $hook_theme_info[‘template’]指定模板文件 Preprocess function order *node/223430 已指出 *template_preprocess *templ

文档评论(0)

wx171113 + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档