本文整理汇总了PHP中Language::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::find方法的具体用法?PHP Language::find怎么用?PHP Language::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Language
的用法示例。
在下文中一共展示了Language::find方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: availableLangs
/**
* Get available languages list
*
* @return mixed
*/
function availableLangs()
{
$objLang = new Language();
//$conditions = $this->Access->isAdmin() ? array() : array('visible' => 1);
$conditions = array();
return $objLang->find('list', array('conditions' => $conditions));
}
示例2: initialize
public function initialize($entity = null, $options = null)
{
$language = new Select('languagecode', Language::find(), array('using' => array('code', 'language'), 'useEmpty' => TRUE, 'emptyText' => $this->di->get('translate')->_('Select a Language')));
$language->setLabel('Idioma');
$this->add($language);
$name = new Text('name');
$name->setLabel('Name translation');
$this->add($name);
$description = new TextArea('description');
$description->setLabel('Description translation');
$this->add($description);
}
示例3: generate
function generate()
{
$localeDir = APP_PATH . 'locale' . DS;
App::import('Model', 'Language');
$Language = new Language();
$languages = $Language->find('all');
foreach($languages as $language){
mkdir($localeDir . $language['Language']['code']);
mkdir($localeDir . $language['Language']['code'] . DS . 'LC_MESSAGES');
}
}
示例4: initialize
public function initialize($entity = null, $options = null)
{
$language = new Select('languagecode', Language::find(), array('using' => array('code', 'language'), 'useEmpty' => TRUE, 'emptyText' => $this->di->get('translate')->_('Seleccione un idioma')));
$language->setLabel('Idioma');
$this->add($language);
$key = new Text('translatekey');
$key->setLabel('Llave');
$this->add($key);
$value = new Text('translatevalue');
$value->setLabel('Valor');
$this->add($value);
}
示例5: initialize
public function initialize($entity = null, $options = null)
{
$language = new Select('languagecode', Language::find(), array('using' => array('code', 'language'), 'useEmpty' => TRUE, 'emptyText' => $this->di->get('translate')->_('Select a Language')));
$language->setLabel('Idioma');
$this->add($language);
$title = new Text('title');
$title->setLabel('Title');
$this->add($title);
$content = new TextArea('content', array('id' => 'summernote', 'name' => 'content', 'class' => 'summernote'));
$content->setLabel('Content');
$this->add($content);
}
示例6: get_languages
public function get_languages()
{
$entity = Language::find();
return $entity;
}
示例7: function
return View::make('cvbuilder.section_views.edit_new_section', ['section' => $section]);
});
Route::get('/edit_ui_workex/{id}', function ($id) {
$work = WorkExperience::find($id);
return View::make('cvbuilder.section_views.edit_work', ['work' => $work]);
});
Route::get('/edit_ui_education/{id}', function ($id) {
$education = Education::find($id);
return View::make('cvbuilder.section_views.edit_education', ['edu' => $education]);
});
Route::get('/edit_ui_nysc/{id}', function ($id) {
$nysc = Nysc::find($id);
return View::make('cvbuilder.section_views.edit_nysc', ['nysc' => $nysc]);
});
Route::get('/edit_ui_language/{id}', function ($id) {
$language = Language::find($id);
$langs = DB::table('langs')->lists('language', 'id');
$langs = array("0" => "Select") + $langs + array("-1" => "Others");
$levels = DB::table('levels')->lists('level', 'id');
$abilities = DB::table('abilities')->lists('ability', 'id');
return View::make('cvbuilder.section_views.edit_language', ['lang' => $language, 'langs' => $langs, 'levels' => $levels, 'abilities' => $abilities]);
});
Route::post('/fetch_addsection', 'CVController@postSection');
Route::post('/edit_section', 'CVController@putSection');
Route::post('/edit_work', 'CVController@putwork');
Route::post('/edit_education', 'CVController@puteducation');
Route::post('/edit_nysc', 'CVController@putnysc');
Route::post('/edit_language', 'CVController@putlanguage');
Route::post('/edit_profile', 'CVController@putprofile');
Route::get('/preview/{code}/{style}/{type}', 'CVController@getPreview');
Route::get('/pdf/{type}/{code}/{style}', 'CVController@getPDF');
示例8: array
?>
<?php
echo $form->field($model, 'lname', array('maxlength' => 80));
?>
<?php
echo $form->passwordFieldRow($model, 'passwd', array('maxlength' => 41));
?>
<?php
echo $form->field($model, 'email', array('maxlength' => 255));
?>
<?php
echo $form->dropDownListRow($model, 'language', \yii\helpers\ArrayHelper::map(Language::find()->All(), 'id', 'name'));
?>
<?php
echo $form->dropDownListRow($model, 'timezone', Timezone::makeList());
?>
<?php
//echo $form->field($model,'theme');
?>
<div class="form-actions">
<?php
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'success', 'label' => Yii::t('app', 'Create')));
?>
</div>
示例9: putLanguage
public function putLanguage()
{
$cre = ['language_id' => Input::get('language_id'), 'ability' => Input::get('ability'), 'level' => Input::get('level')];
$rules = ['language_id' => 'required|not_in:0', 'ability' => 'required', 'level' => 'required'];
$validator = Validator::make($cre, $rules);
if ($validator->passes()) {
$language = Language::find(Input::get('language_edit'));
$cv = Cv::select('id')->where('cv_code', Input::get('cv_code'))->first();
if ($cv->id == $language->cv_id) {
if (Input::get('language_id') == -1 && Input::get('language_name') == '') {
$data["success"] = false;
$data["message"] = 'Please fill the other language name';
} else {
$language->language_id = Input::get('language_id');
if ($language->language_id == -1) {
$language->language_name = Input::get('language_name');
}
$language->ability_id = Input::get('ability');
$language->level_id = Input::get('level');
$language->save();
$data["success"] = true;
$data["message"] = 'Language is succefully updated';
if ($language->language_id != -1) {
$lang = DB::table('langs')->select('language')->where('id', $language->language_id)->first();
$data["language_id"] = $lang->language;
} else {
$data["language_id"] = Input::get('language_name');
}
$data["language_name"] = Input::get('language_name');
$ability = DB::table('abilities')->select('ability')->where('id', $language->ability_id)->first();
$data["ability"] = $ability->ability;
$level = DB::table('levels')->select('level')->where('id', $language->level_id)->first();
$data["level"] = $level->level;
}
} else {
$data["success"] = false;
$data["message"] = 'Error in editing language';
}
} else {
$data["success"] = false;
$data["message"] = 'Please fill all required fields';
}
return json_encode($data);
}