用户
 找回密码
 入住 CI 中国社区
搜索
查看: 3408|回复: 0
收起左侧

[辅助方法 Helper] AutoHotKey 辅助写代码

[复制链接]
发表于 2011-11-10 08:54:37 | 显示全部楼层 |阅读模式
PHP复制代码
;-----------------------------------------------------------------------------
;    Codiigniter
;-----------------------------------------------------------------------------
 
;model
:c*?:]cmod::
InputBox, MyModel, Model Name Prompt, Enter model name ( e.g. MyModel ),,250,125
if ErrorLevel=0
{
    BlockInput On
    Send, class %MyModel% extends CI_Model{enter}{{}{enter}function __construct(){enter}{{}{enter}{tab}parent::__construct();{enter}
    BlockInput Off
}
return
 
;controller
:c*?:]ccon::
InputBox, MyModels, Models Controller Prompt, Enter controller name ( e.g. MyControllers ),,250,125
if ErrorLevel=0
{
    BlockInput On
    Send, class %MyModels% extends CI_Controller{enter}{{}{enter}{tab}function __construct(){enter}{{}{enter}{tab}parent::__construct();{enter}
    BlockInput Off
}
return
 
;function
:c*?:]cfun::
InputBox, MyModels, Models Controller Prompt, Enter function name ( e.g. MyFunction ),,250,125
if ErrorLevel=0
{
    BlockInput On
    Send, function %MyModels%(){enter}{{}{enter} //type the code here;{enter}
    BlockInput Off
}
return
 
 
复制代码



保存成codeigniter.ahk,运行之。在IDE中输入]cmod,就会出一个提示框,输入模块名,就生成初始化代码。

还有]ccon,]cfun等,别的常用的东西大家自己封装,能共享出来更好。

本版积分规则