首页 > 移动平台 > 详细

theme wrapper 例子

时间:2015-05-18 20:29:02      阅读:258      评论:0      收藏:0      [点我收藏+]

https://www.drupal.org/node/2342561

$element[‘something‘] = array(  
‘#markup‘ => t(‘This is some content‘),  
‘#theme_wrapper‘ => ‘paragraph_wrapper‘,
);

/** * Implementation of hook_theme() */
function MYMODULE_theme(){ 
 return array  (  
  ‘paragraph_wrapper‘ = array (  ‘render element‘ => ‘element‘, ),
);}

function theme_paragraph_wrapper(){  
$element = $variables[‘element‘];  
// #children is the contents of the element that the 
 // #theme_wrapper was applied to. 
return ‘<p>‘ . $element[‘#children‘] . ‘</p>‘;}

 render($element); 

 

 

 

 

theme wrapper 例子

原文:http://www.cnblogs.com/qinqiu/p/4512673.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!