fssnoo 发表于 2011-11-10 08:54:37

AutoHotKey 辅助写代码

;-----------------------------------------------------------------------------
;    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等,别的常用的东西大家自己封装,能共享出来更好。
页: [1]
查看完整版本: AutoHotKey 辅助写代码