-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code Templates #7
Comments
This is a really good feature. I want to throw some ideas. We should not just implement this for CApplication::getModule() only (http://www.yiiframework.com/doc/api/1.1/CModule#getModule-detail) but I think it also will be useful if we could do it for CApplication::getComponent() |
OK, ycom We have to make a list of the often used code, at first. Thanks. |
Basically to have make a completion for the because ihe array there is the one that build the CApplication instance. .e.g. Usually some application can have several application config. But you can safely assume the main config is the one loaded in the You can use the and see which configuration loaded in the index file. $yii = dirname(__FILE__) . '/yii/framework/yii.php';
$config = dirname(__FILE__) . '/protected/config/main.php'; // <----- this one
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG', true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
require_once($yii);
Yii::createWebApplication($config)->run(); should the programmer want to change configuration, it's his/her responsibility to change the index file.. |
there is a yii wiki article that contains a template file as well. Might be a good reference |
👍 totally agree with @PrplHaz4. I am using that guide also. I'm sure that everyone will benefit from it too. |
@petrabarus @PrplHaz4 If many user use it, we might have to close this issue. |
@junichi11 I'm sorry I interpreted the thread topic too far. I thought you wanted to use some kind of autocompletion in the |
@petrabarus Oh, I see. You don't have to say sorry :) |
e.g.
app
Tab
mod
Tab
expand like the followings:
Yii::app()->
caret
;Yii::app()->getModule('
caret
');Remark:
It might be the same as existing code templates.
It should have a prefix(e.g. y : yapp, ymod, ..., e.t.c.).
The text was updated successfully, but these errors were encountered: