本文整理汇总了PHP中Character::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Character::model方法的具体用法?PHP Character::model怎么用?PHP Character::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Character
的用法示例。
在下文中一共展示了Character::model方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAChars
public static function getAChars($acc)
{
$chars = Character::model()->findAll(array('select' => 'Name', 'condition' => 'AccountID=:memb___id', 'params' => array(':memb___id' => $acc)));
foreach ($chars as $key => $char) {
if ($key + 1 != sizeof($chars)) {
echo CHtml::link($char->Name, array('char', 'id' => $char->Name), array('class' => 'char-link', 'title' => $char->Name)) . ', ';
} else {
echo CHtml::link($char->Name, array('char', 'id' => $char->Name), array('class' => 'char-link', 'title' => $char->Name));
}
}
}
示例2: getMagicList
public function getMagicList($name)
{
if ($this->getFConfig('db_driver') == 'sqlsrv') {
$query = "DECLARE @list varbinary(max);SET @list = (SELECT MagicList FROM Character WHERE Name='{$name}');Select @list";
$getL = Yii::app()->db->createCommand($query)->queryScalar();
$getList = $getL;
} else {
$getL = Character::model()->find(array('select' => 'MagicList', 'condition' => 'Name=:Name', 'params' => array(':Name' => $name)));
$getList = strtoupper(bin2hex($getL->MagicList));
}
$i = -1;
while ($i < 60) {
$i++;
$skill = substr($getList, $i * 6, 6);
if (substr($skill, 0, 2) == 'FF' || substr($skill, 0, 2) >= '43' && substr($skill, 0, 2) <= '48') {
} else {
if (strlen($skill) != '6' || !preg_match("/[A-Za-z0-9]/", $skill) || $skill == 'FF0000') {
} else {
$id[] = hexdec(substr($skill, 0, 2));
}
}
}
return $id;
}
示例3: loadModel
public function loadModel($name)
{
$this->_model = Character::model()->with('honor', 'stats')->find('name = ?', array($name));
if ($this->_model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
// Hide GM characters
$account = Account::model()->find('id = ?', array($this->_model->account));
if ($account !== null && !$account->isPlayer()) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $this->_model;
}
示例4: getFinderCharacters
public function getFinderCharacters($acc)
{
$characters = Character::model()->getFinderAccCharacters($acc);
$this->renderPartial('block/finder/characters', array('model' => $characters));
}
示例5: getSCharInfo
protected function getSCharInfo()
{
return Character::model()->find(array('select' => 'cLevel,' . $this->getFConfig('reset_col') . ',' . $this->getFConfig('greset_col') . ',Class,Money,LevelUpPoint,Strength,Dexterity,Energy,Leadership', 'condition' => 'AccountID=:AccountID AND Name=:Name', 'params' => array(':AccountID' => Yii::app()->user->username, ':Name' => Yii::app()->user->char)));
}
示例6: ucfirst
</span>
<span class="value <?php
echo Character::model()->getIntToTxt(Character::model()->getOInfo($model->AccountID, $model->Name));
?>
"><?php
echo ucfirst(Character::model()->getIntToTxt(Character::model()->getOInfo($model->AccountID, $model->Name)));
?>
</span>
</li>
<li class="tip">
<span class="label"><?php
echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Guild');
?>
</span>
<span class="value"><?php
echo Character::model()->getCGuild($model->Name);
?>
</span>
</li>
<li class="tip">
<span class="label"><?php
echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Level');
?>
</span>
<span class="value"><?php
echo $model->cLevel;
?>
</span>
</li>
<li class="tip">
<span class="label"><?php
示例7: ucfirst
<div class="i-line char-class">
<?php
echo Character::model()->getCClass($model->Class, 0);
?>
</div>
<div class="i-line char-online">
<span class="<?php
echo Character::model()->getIntToTxt(Character::model()->getOInfo(Yii::app()->user->username, $model->Name));
?>
">
<?php
echo ucfirst(Character::model()->getIntToTxt(Character::model()->getOInfo(Yii::app()->user->username, $model->Name)));
?>
</span>
</div>
<div class="i-line char-greset">
<span><?php
echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Grand reset');
?>
:</span>
<span class="r-entity"><?php
$greset = $this->getFConfig('greset_col');
echo $model->{$greset};
?>
</span>
<div class="clear"></div>
</div>
<div class="i-line char-reset">