#1 extinct
jake,问个比较菜的问题,在用SP时,control类都是继承spControl的,可是我想写一个类先继承了spControl,然后其他类再继承该类
比如a 继承了spControl, 然后其他类再继承a,
我试过了,在index.php那里require进去,不行,因为spControl引入比他晚,或者就已经转向,
只有在写control那里import进去才有效。
我想问下有什么好的办法可以让sp自动添加该类进去?
没研究很多sp,现在又急需用,
谢谢
2010-05-20 13:38:28
#2 jake
这个继承是很好的事情,speedphp 3中,在入口文件的require(speedphp.php)和spRun之间import即可
2010-05-20 14:20:58
#4 jake
哦,好期待哈
extinct 发表于 2010-5-20 16:16 
speedphp 3 rc不是发布了吗?{:3_48:}
2010-05-20 16:21:33
#6 azwl
一般根据自己的需要可能要扩展spController,可以直接修改spController,当然不推荐这样。
可以
class myController extends spController
{
function ——construct()
{
你的代码
parent::__construct();
你的代码
}
.....................
.......................
......................
}
然后你的所有control继承myController
2010-05-20 22:02:11