本文整理汇总了PHP中Constants::GetLngArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Constants::GetLngArray方法的具体用法?PHP Constants::GetLngArray怎么用?PHP Constants::GetLngArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Constants
的用法示例。
在下文中一共展示了Constants::GetLngArray方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
value="<?php
echo $value;
?>
"><?php
echo $typeName;
?>
</option>
<?php
}
?>
</select>
</div>
<div class="hr"></div>
<?php
foreach (Constants::GetLngArray() as $label => $lng) {
?>
<label class="top-field-label">Название <?php
echo $label;
?>
:</label>
<div class="field-container-long"><input type="text" name="name[<?php
echo $lng;
?>
]" class="input-main float-left" value="<?php
echo $item->getLngObject($lng)->name;
?>
"></div>
<?php
}
?>
示例2: foreach
<div class="field-container-long"><input type="text" name="word[<?php
echo $lng;
?>
]" class="input-main float-left" value="<?php
echo $item->getWordByLng($lng);
?>
"></div>
<?php
}
?>
<div class="hr"></div>
<?php
} else {
?>
<?php
foreach (Constants::GetLngArray() as $indexLng => $lng) {
?>
<label class="top-field-label"><?php
echo $indexLng;
?>
:</label>
<div class="field-container-long"><input type="text" name="word[<?php
echo $lng;
?>
]" class="input-main float-left" value=""></div>
<?php
}
?>
<div class="hr"></div>
<?php
}
示例3: foreach
<?php
foreach ($words as $word) {
?>
<tr>
<td class="td-tbl-clr"><?php
echo $word->id;
?>
</td>
<td class="td-tbl-clr"><?php
echo $word->label;
?>
</td>
<?php
foreach (Constants::GetLngArray() as $lngIndex => $lng) {
?>
<td class="td-tbl-clr"><?php
echo $word->getWordByLng($lng);
?>
</td>
<?php
}
?>
<td class="td-tbl-clr" style="text-align:center;">
<?php
echo CHtml::link("Удалить", '/admin/lmt/transdel/id/' . $word->id, array('class' => 'button delete-lnk del-link', 'title' => 'удалить'));
?>
<?php
echo CHtml::link("Изменить", '/admin/lmt/transedit/id/' . $word->id, array('class' => 'button edit-lnk', 'title' => 'редактировать'));
示例4: getTranslationFromWordOnSomeLng
public static function getTranslationFromWordOnSomeLng($str, $toLng)
{
/* @var $lng TranslationLng */
/* @var $word Translation */
/* @var $neededWord Translation */
$ret = "";
$neededWord = null;
$allWords = Translation::model()->findAll();
foreach ($allWords as $word) {
foreach (Constants::GetLngArray() as $lngIndex => $lng) {
$strWord = $word->getWordByLng($lng);
if ($str == $strWord) {
$neededWord = $word;
}
}
}
if ($neededWord != null) {
$ret = $neededWord->getWordByLng($toLng);
} else {
$ret = $str;
}
return $ret;
}
示例5: actionUpdateContacts
public function actionUpdateContacts()
{
/* @var $contacts LuxContactInfo */
/* @var $contactsLng LuxContactInfoLng */
$id = Yii::app()->request->getParam('id', null);
$label = Yii::app()->request->getParam('label', null);
$email_1 = Yii::app()->request->getParam('email_1', null);
$phone_1 = Yii::app()->request->getParam('phone_1', null);
$phone_2 = Yii::app()->request->getParam('phone_2', null);
$email_admin = Yii::app()->request->getParam('email_admin', null);
$map_link = Yii::app()->request->getParam('map_link', null);
$small_text_lng = Yii::app()->request->getParam('info', array());
$subject_lng = Yii::app()->request->getParam('subject', array());
$title_lng = Yii::app()->request->getParam('title', array());
$contacts = LuxContactInfo::model()->findByPk($id);
if ($contacts == null) {
$contacts = new LuxContactInfo();
}
$contacts->email_1 = $email_1;
$contacts->phone_1 = $phone_1;
$contacts->phone_2 = $phone_2;
$contacts->administrator_email = $email_admin;
$contacts->map_link = $map_link;
$contacts->label = $label;
$old_f_name = $contacts->map_image;
$new_f_name = DwHelper::uploadPicAndGetPath($_FILES, 'map_img', $old_f_name);
if ($new_f_name != "") {
$contacts->map_image = $new_f_name;
}
if ($contacts->isNewRecord) {
$contacts->save();
} else {
$contacts->update();
}
foreach (Constants::GetLngArray() as $lng) {
$contactsLng = $contacts->getLngObject($lng);
$contactsLng->small_text = $small_text_lng[$lng];
$contactsLng->feedback_subject = $subject_lng[$lng];
$contactsLng->text = $title_lng[$lng];
if ($contactsLng->isNewRecord) {
$contactsLng->save();
} else {
$contactsLng->update();
}
}
$this->redirect($this->createUrl('/admin/inlux/contacts'));
}
示例6: run
public function run()
{
//render top menu widget
$this->render('languages', array('languages' => Constants::GetLngArray()));
}
示例7: actionUpdateContacts
public function actionUpdateContacts()
{
/* @var $contacts LmtContactInfo */
/* @var $contactsLng LmtContactInfoLng */
$id = Yii::app()->request->getParam('id', null);
$email_1 = Yii::app()->request->getParam('email_1', null);
$phone_1 = Yii::app()->request->getParam('phone_1', null);
$phone_2 = Yii::app()->request->getParam('phone_2', null);
$email_admin = Yii::app()->request->getParam('email_admin', null);
$small_text_lng = Yii::app()->request->getParam('info', array());
$subject_lng = Yii::app()->request->getParam('subject', array());
$contacts = LmtContactInfo::model()->findByPk($id);
if ($contacts == null) {
$contacts = new LmtContactInfo();
}
$contacts->email_1 = $email_1;
$contacts->phone_1 = $phone_1;
$contacts->phone_2 = $phone_2;
$contacts->administrator_email = $email_admin;
if ($contacts->isNewRecord) {
$contacts->save();
} else {
$contacts->update();
}
foreach (Constants::GetLngArray() as $lng) {
$contactsLng = $contacts->getLngObject($lng);
$contactsLng->small_text = $small_text_lng[$lng];
$contactsLng->feedback_subject = $subject_lng[$lng];
if ($contactsLng->isNewRecord) {
$contactsLng->save();
} else {
$contactsLng->update();
}
}
$this->redirect($this->createUrl('/admin/lmt/contacts'));
}