当前位置: 首页 > news >正文

企业做网站的流程权威发布新闻的含义

企业做网站的流程,权威发布新闻的含义,做网站多少钱 网络服务,邢台网站建设服务周到在自己定义主题中输出结果时#xff0c;有三个部分或很多其它特殊的函数。如 hook_menu#xff0c;Page Callback。MODULE_theme 钩子 1、hook_menu 为了使用自己定义的实体。像创建、编辑、删除、查看实体的功能#xff0c;就必须要创建一些 Menu path。这里创建、编辑、… 在自己定义主题中输出结果时有三个部分或很多其它特殊的函数。如 hook_menuPage Callback。MODULE_theme 钩子 1、hook_menu 为了使用自己定义的实体。像创建、编辑、删除、查看实体的功能就必须要创建一些 Menu path。这里创建、编辑、删除是与Drupals Form API相关的通过hook_menu能够定义我们须要的路径来訪问这个新创建的实体内容 function my_module_menu() {$items[my_entity/%my_entity] array(title callback   my_entity_page_title,title arguments   array(1),page callback     my_entity_page_view,page arguments   array(1),access arguments array(view entities),type             MENU_CALLBACK,);return $items;}2、Page Callback 在上面的样例中。我们在訪问这个路径时定义了 page callback 相应的 my_entity_page_view 函数因此接下来就须要创建这个函数例如以下 /*** This is the callback we defined to be executed when a user* requests http://mysite.com/my_entity/1 (1 is just an example ID,* it could be anything). This function will set up the data and* prepare the render array(s). You will specify the template to* use in this callback. The critical thing to note below is the* order in which field_attach_prepare_view, entity_prepare_view* and field_attach_view are called. These functions must be called* in this order and they must be called before you specify which* theme to use.*/function my_entity_page_view($entity, $view_modefull) {$entity_type $entity-entityType();$entity_id entity_id($entity_type, $entity);//// Remove previously built content, if exists//$entity-content array();$entity-title filter_xss($entity-title);//// Build the fields content//field_attach_prepare_view($entity_type, array($entity_id $entity), $view_mode);entity_prepare_view($entity_type, array($entity_id $entity));$entity-content field_attach_view($entity_type, $entity, $view_mode);// Specify the theme to use and set the #element. Note that the key// you use to pass the entity object must match the key you set in the// variables in my_module_theme(). So in the case below, we use the key// named #element because in my_module_theme() we set the following code://// array(//   my_entity array(//     variables array(element null),//     template my_entity//   ),// );//$entity-content array(#theme     $entity_type,#element   $entity,#view_mode $view_mode,#language   LANGUAGE_NONE,);return $entity-content;}3、MODULE_theme() Hook 到眼下为止为了这个实体我们已经定义了菜单项还有CALL BACK返回值接下来。剩下的就须要创建一个指向模板的文件。看上面部分内容能够看到内容为 $entity-content array(#theme my_entity); 意思是说。指向 my_entity 那么应该怎样定义呢 function my_module_theme($existing, $type, $theme, $path) {return array(my_entity array(variables array(element null),template my_entity_template),);}4、依据第三部分的内容。我们则须要创建名为 my_entity_template.tpl.php 的模板文件 [php// In a real module variables should be manipulated in a preprocess function.$content $element-content;] div class[php print $classes; ] [php print render($content[title]); ] [php print render($content[field_date]); ][php print render($content[field_author]);][php print render($content[field_image]);] [php print render($content[field_description]);] 原文链接https://drupal.org/node/1238606 转载于:https://www.cnblogs.com/blfbuaa/p/7080092.html
http://www.zqtcl.cn/news/234545/

相关文章:

  • 国外大型购物网站桂林视频网站制作
  • 平度那里有做网站的网站设计技术入股
  • 张家港专业做网站网站设计与建设ppt
  • 香奈儿网站设计分析网站建设新闻发布注意事项
  • 建设网站策划南京网站开发建设
  • 哪些网站可以做任务挣钱如何查询企业电话号码
  • 福田网站 建设深圳信科手机 网站制作
  • 网站站内优化方案佛山外贸网站建设哪家好
  • 厦门市网站建设局平台网站如何优化
  • 电子书网站用dz还是wordpresswordpress搭建购物网站
  • 广西住房和城乡建设培训中心网站吴江住房和城乡建设部网站
  • 游戏网站的导航条怎么做的安阳县属于哪个省哪个市
  • 网站建设科目国内有多少家做网站的企业
  • 如何建立一家公司网站江苏网站推广公司
  • 城市管理如何宣传市建设网站cms软件有什么功能
  • 网站建设优势网站为什么吸引人
  • 域名如何做网站网站导读怎么做
  • 那些网站可以做问答免费设计室内装修app软件
  • 白银做网站视频制作软件下载安装
  • 商城网站建设最新报价现在网站建设的技术
  • 网站设计思路方案广东深圳软件开发公司
  • 企业网站可以免费做吗网站建设管理内容保障制度
  • 建立导购网站吴江区建设局网站
  • 东莞网站建设(信科分公司)青岛市北建设集团网站
  • 企业网站分类举例营销型网站建设市场
  • 自学app开发难吗长沙专业网站优化定制
  • 厦门做企业网站找谁wordpress4.7.10漏洞
  • 百科网站源码最好的免费logo设计网站
  • 北京做网站s如何做网站截流
  • 深圳摇号申请网站在线免费网站