I have a class which is made of only static methods. I want to register the class so that XSLT engine can use it. As far I am aware XSLTProcessor::registerPHPFunctions()
either registers all class and functions unless first parameter $restrict
is passed and first param only takes method name in string or as array. How to register a whole class to XSLT so that all static method of a class can be accessible from xslt page.
关注
码龄 粉丝数 原力等级 --
- 被采纳
- 被点赞
- 采纳率

已采纳
选择性函数寄存器与xslt PHP
收起
- 写回答
- 好问题 0 提建议
- 关注问题
微信扫一扫
点击复制链接分享
- 邀请回答
- 编辑 收藏 删除 结题
- 收藏 举报
1条回答 默认 最新
- 关注
码龄 粉丝数 原力等级 --
- 被采纳
- 被点赞
- 采纳率
dongmou5628 2013-06-27 08:33关注Assuming you have a class named
Foo
, you can get an array of all the class methods with code like this:function addClassPrefix($name) { return "Foo::$name"; } $names = array_map("addClassPrefix", get_class_methods("Foo"));
Note the need to add the class name as a prefix in front of each method name.
You can then simply register the whole array like this:
$proc = new XSLTProcessor(); $proc->registerPHPFunctions($names);
本回答被题主选为最佳回答 , 对您是否有帮助呢? 本回答被专家选为最佳回答 , 对您是否有帮助呢? 本回答被题主和专家选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏举报微信扫一扫
点击复制链接分享
编辑预览轻敲空格完成输入- 显示为
- 卡片
- 标题
- 链接
评论按下Enter换行,Ctrl+Enter发表内容
编辑
预览

轻敲空格完成输入
- 显示为
- 卡片
- 标题
- 链接
报告相同问题?
提交
- 2017-03-29 21:47回答 2 已采纳 In the XSLT you can load additional document using the document() function. Another possibility
- 2013-03-18 12:26回答 1 已采纳 Issues: Parameter name Passing parameters to transformer Parameter Name Use $movieID (instead
- 2015-09-22 06:49回答 1 已采纳 I ended up setting method="xml"instead of method="html" on <xml output/> which made the resu
- 2021-04-28 20:13AI天才研究院的博客 高级语言远离机器语言,与具体的计算机硬件关系不大,因而所写出来的程序可移植性好,重用率高; 由于把繁杂琐碎的事务交给了编译程序去做,所以自动化程度高,开发周期短,且程序员得到解脱,可以集中时间和精力去...
- 2011-06-30 20:28回答 2 已采纳 I do it like this: View.xsl <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xml
- 2018-10-14 16:20回答 1 已采纳 Use <xsl:value-of select="sum(exsl:node-set($itemTotals)/total)"/> to compute the sum of the
- 2011-08-31 06:25回答 1 已采纳 preserve-space deals with the processing of elements and their contents from the data file, and do
- 2017-04-14 07:13BRUCE_WUANG的博客 集合与串的问题 Set Cover 集合覆盖 Set Packing 集合配置 String Matching 模式匹配 Approximate String Matching 模糊匹配 Text Compression 压缩 Cryptography ...
- 2018-09-05 04:11回答 1 已采纳 The XPath was OK, this just removes the first bit inside the first [ as it's not needed. To outpu
- 2009-11-19 12:53回答 4 已采纳 Do you have the option of using XSLT 2.0? If you do, you can use character maps. Like this: <x
- 2009-11-27 01:33回答 6 已采纳 In the nearest future? None. PHP5 relies exclusively on LibXSLT for XSLT processing (Sablotron is
- 2017-07-26 02:58IT界的小小小学生的博客 中文名称条件随机场算法,外文名称conditional random field algorithm,是一种数学算法,是2001年提出的,基于遵循马尔可夫性的概率图模型。 全部对照第一部分、计算机算法常用术语中英对照 Data Structures 基本...
- 2017-10-24 06:50FeelTouch Labs的博客 抽象就是忽略一个主题中与当前目标无关的那些方面,以便更充分地注意与当前目标有关的方面。抽象并不打算了解全部问题,而只是选择其中的一部分,暂时不用部分细节。抽象包括两个方面,一是过程抽象,二是数据抽象。...
- 2022-01-11 04:30JavaGPT的博客 abstraction 抽象、抽象物、抽象性 access 存取、访问 access level访问级别 access function 访问函数 account 账户 action 动作 activate 激活 active 活动的 actual parameter 实参 adapter 适配器 add-in 插件 ...
- 2020-05-23 07:21山上一缕烟的博客 这一章的内容是概述性的。有些概念解释起来比较复杂,将在后面的章节进一步学习,如果一时理解不了也没关系,可以结合搜索引擎和日后的深入学习慢慢消化。 1、下面介绍贯穿计算机科学的八个重要思想: ·摩尔定律...
- 2023-03-16 09:30Allen丶Gentle的博客 getItemAt 得到位置的列表项 getItemCount 得到列表项个数 setRolloverIcon 当鼠标经过的图标 setSelectedIcon 当选择按钮的图标 getSelectedItem 得到选择的列表项 getSelectedIndex 得到选择的索引 ActionListener...
- 2019-03-18 01:58讓丄帝愛伱的博客 01527 SET 语句引用的专用寄存器在 AS 上不存在。 01539 连接成功但只应使用 SBCS 字符。 01543 已忽略重复约束。 01545 未限定列名已解释为相关引用。 01550 对象未创建,因为具有指定描述的对象已经存在。 01560 ...
- 2021-08-07 17:18苦逼攻城狮的博客 范围 length [ leŋθ] 长度 sort [sɔ:t] 将…排序 //Arrays.sort(arr) select [si’lekt] 选择 //selectSort bubble ['bʌbl] 冒泡,气泡 //bullbeSort change [ tʃeindʒ ] 改变,交换 swap [ swɔp ] 交换 ...
- 2013-08-14 02:16iteye_2005的博客 在现代可共享内存的多处理器体系结构中每个处理器都有自己的缓存,并周期性的与主内存协调一致。假设线程 A 写入一个变量值 V,随后另一个线程 B 读取变量 V 的值,在下列情况下,线程 B 读取的值可能不是线程 A ...
- 没有解决我的问题, 去提问
联系我们(工作时间:8:30-22:00)
400-660-0108kefu@csdn.net在线客服
- 京ICP备19004658号
- 经营性网站备案信息
公安备案号11010502030143
- 营业执照
- 北京互联网违法和不良信息举报中心
- 家长监护
- 中国互联网举报中心
- 网络110报警服务
- Chrome商店下载
- 账号管理规范
- 版权与免责声明
- 版权申诉
- 出版物许可证
- ©1999-2025北京创新乐知网络技术有限公司