码迷,mamicode.com
首页 > 移动开发 > 详细

theme wrapper 例子

时间:2015-05-18 20:30:43      阅读:210      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!