首页 > 其他 > 详细

Drupal.theme未解之谜

时间:2015-12-30 13:37:17      阅读:253      评论:0      收藏:0      [点我收藏+]
Drupal = {};
Drupal.theme = function (func) {
  console.log(arguments);
  var args = Array.prototype.slice.apply(arguments,[‘1‘]);
  console.log(args);
  return (Drupal.theme[func] || Drupal.theme.prototype[func]).apply(this, args);
};
Drupal.theme.prototype = {
  placeholder: function (str) {
    return ‘<em class="placeholder">‘ + str + ‘</em>‘;
  }
};
console.log(‘1111‘);
var a = Drupal.theme(‘placeholder‘, ‘aaaa‘)
console.log(a);

为什么placeholder可以做为参数传到Drupal.theme里面
难以理解

Drupal.theme未解之谜

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

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