public static function find(){
return new ActiveQuery(get_called_class());
}
/yii2-multilingual-behavior/
везде заменил use yii\db\ActiveQuery;
use yii\easyii\components\ActiveQuery;
public static function find()
{
return new MultilingualQuery(get_called_class());
}
public function findMultilingual($item_id)
{
return $this::find()->multilingual()->where(['item_id' => $item_id])->one();
}
class Item extends \yii\easyii\components\ActiveRecord
public static function find(){
$q = new MultilingualQuery(get_called_class());
$q->multilingual();
return $q;
}
use MultilingualTrait;
$q = new MultilingualQuery(get_called_class());
$q->multilingual();
return $q;
CKEDITOR.replace( 'editor1', {
// Define the toolbar groups as it is a more accessible solution.
toolbarGroups: [
{"name":"document","groups":["mode","document","doctools"]},
//{"name":"editing","groups":["Scayt"]},
{"name":"basicstyles","groups":["basicstyles"]},
{"name":"styles","groups":["styles"]},
{"name":"paragraph","groups":["list","blocks","align"]},
{"name":"links","groups":["links"]},
{"name":"insert","groups":["insert"]},
//{"name":"about","groups":["about"]},
],
extraPlugins: 'codesnippet,uploadimage,image2,spoiler',
codeSnippet_theme: 'monokai_sublime',
height: 356,
disableNativeSpellChecker: false, //Проверка орфографии.
// Configure your file manager integration. This example uses CKFinder 3 for PHP.
filebrowserImageUploadUrl: '/user/photo-upload?command=QuickUpload&type=Images',
stylesSet: [
{ name: 'Narrow image', type: 'widget', widget: 'image', attributes: { 'class': 'image-narrow' } },
{ name: 'Wide image', type: 'widget', widget: 'image', attributes: { 'class': 'image-wide' } }
],
// Load the default contents.css file plus customizations for this sample.
contentsCss: [ CKEDITOR.basePath + 'contents.css', 'http://sdk.ckeditor.com/samples/assets/css/widgetstyles.css' ],
image2_alignClasses: [ 'image-align-left', 'image-align-center', 'image-align-right' ],
simpleuploads_acceptedExtensions: 'gif|jpeg|jpg|png|bmp',
image2_disableResizer: true,
} );
return [
'ml' => [
'class' => MultilingualBehavior::className(),
'languages' => [
'ru' => 'Russian',
'en-US' => 'English',
],
//'languageField' => 'language',
//'localizedPrefix' => '',
//'requireTranslations' => false',
//'dynamicLangClass' => true',
//'langClassName' => PostLang::className(), // or namespace/for/a/class/PostLang
'defaultLanguage' => 'ru',
'langForeignKey' => 'post_id',
'tableName' => "{{%postLang}}",
'attributes' => [
'title', 'content',
]
],
];