用钱和时间换来如下过程,此过程简单,但是对于很多没做过的人,还是非常麻烦的。
在国内注册,没有SRV记录,对于Lync,总是少了点什么!
在国外注册,拥有SRV记录,对于Lync,总是安心了不少!
整个过程如下,如果有不懂,尽管来找我。
一. 注册-帐号-MSN
二. 注册-帐号-Godaddy
三. 申请-域名
四. 管理域名
五. 测试域名解析
一. 注册-帐号-MSN
i_x_Cloud@outlook.com
http://www.outlook.com
选择-立即注册
Aa
选择-继续使用收件箱。
二. 注册-帐号-Godaddy
选择-Register:
选择-Create My Account
Aa515XXXaA
选择-Create Account
三. 申请-域名
i-x-Cloud
选择-Sign In
选择Sign In
i-x-Cloud
AaaA
515008
选择-Domains-Find a domain
                    【yii】giix工具扩展――自动生成model的属性翻译  阅读原文»
                用户名:kingzeus                文章数:19                评论数:29
                访问量:3952:399:394:3                注册日期:2014-01-17
giix是gii的扩展,方便实用。
GiixModel Generator用来生成model,和gii的Model Generator相比,giix把类拆分成两部分,base类和继承的model类。
base是用工具生成的,方便反复替换,而不会修改具体实现。
继承的类方便大家添加具体实现函数,而不用担心被工具重新替换掉。
好了,这下方便了,但是yii支持本地化操作,数据库的属性每次都需要手工翻译,略显麻烦,那我们就来改下giix的相关代码,让它自动生成对应的语言文件。
修改GiixModelCode.php里generateLabelsEx函数
-                       
添加
 
在
                            return $labels;                             |                         
前添加
                            $langDir = Yii::getPathOfAlias('application.messages').DIRECTORY_SEPARATOR.Yii::app()->getLanguage().DIRECTORY_SEPARATOR;                              if(!file_exists($langDir))                              mkdir($langDir);                              $messageFile = $langDir.'db.php';                              if(file_exists($messageFile))                              $messages=include($messageFile);                              if(!is_array($messages))                              $messages=array();                              $messages=array();                              foreach ($table->columns as $column)                              if($column->comment)                              $label=$column->comment;                              $label = ucwords(trim(strtolower(str_replace(array('-', '_'), ' ', preg_replace('/(?<![A-Z])[A-Z]/', ' \0', $column->name)))));                              $label = preg_replace('/\s+/', ' ', $label);                              if (strcasecmp(substr($label, -3), ' id') === 0)                              $label = substr($label, 0, -3);                              if ($label === 'Id')                              $key = $table->name.'.'.$column->name;                              if(!array_key_exists($key, $messages))                              $messages[$key]=$label;                              $messageFileContent="<?php\n// 数据库数据字典\n\n\n\n";                              $messageFileContent.="return array(\n";                              foreach ($messages as $key => $value) {                              $messageFileContent.=" '$key' => '$value',\n";                              $messageFileContent.=');';                              file_put_contents($messageFile, $messageFileContent);                               |                         
-                       
修改
 
                            $label = ucwords(trim(strtolower(str_replace(array('-', '_'), ' ', preg_replace('/(?<![A-Z])[A-Z]/', ' \0', $column->name)))));                              $label = preg_replace('/\s+/', ' ', $label);                              if (strcasecmp(substr($label, -3), ' id') === 0)                              $label = substr($label, 0, -3);                              if ($label === 'Id')                              $label = "Yii::t('app', '{$label}')";                               |                         
修改为:
                            // $label = ucwords(trim(strtolower(str_replace(array('-', '_'), ' ', preg_replace('/(?<![A-Z])[A-Z]/', ' \0', $column->name)))));                              // $label = preg_replace('/\s+/', ' ', $label);               
订阅:
博文评论 (Atom)
 
 | 
没有评论:
发表评论