File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 49
49
* 'table' => '{{%language}}', // table name
50
50
* 'columns' => ['name', 'name_ascii'], //names of multilingual fields
51
51
* 'category' => 'database-table-name', // the category is the database table name
52
- * 'categoryPrefix' => 'lx-'
53
52
* ]
54
53
* ]
55
54
* ],
Original file line number Diff line number Diff line change @@ -112,7 +112,6 @@ A more complex example including database table with multilingual support is bel
112
112
'table' => '{{%language}}', // table name
113
113
'columns' => ['name', 'name_ascii'],// names of multilingual fields
114
114
'category' => 'database-table-name',// the category is the database table name
115
- 'categoryPrefix' => 'lx-' //
116
115
]
117
116
]
118
117
],
@@ -311,6 +310,10 @@ class Category extends \yii\db\ActiveRecord {
311
310
Language::saveMessage($this->name);
312
311
Language::saveMessage($this->description);
313
312
313
+ // or If the category is the database table name.
314
+ // Language::saveMessage($this->name, static::tableName());
315
+ // Language::saveMessage($this->description, static::tableName());
316
+
314
317
return true;
315
318
}
316
319
Original file line number Diff line number Diff line change 19
19
* 'table' => '{{%language}}',
20
20
* 'columns' => ['name', 'name_ascii'],
21
21
* 'category' => 'database-table-name',
22
- * 'categoryPrefix' => 'lx-'
23
22
* ],
24
23
* [
25
24
* 'connection' => 'db',
@@ -106,8 +105,7 @@ private function _scanningTable($tables) {
106
105
*/
107
106
private function _getCategory ($ tables ) {
108
107
if (isset ($ tables ['category ' ]) && $ tables ['category ' ] == 'database-table-name ' ) {
109
- $ tableName = $ this ->_normalizeTablename ($ tables ['table ' ]);
110
- $ category = (isset ($ tables ['categoryPrefix ' ])) ? $ tables ['categoryPrefix ' ] . $ tableName : $ tableName ;
108
+ $ category = $ this ->_normalizeTablename ($ tables ['table ' ]);
111
109
} else {
112
110
$ category = Scanner::CATEGORY_DATABASE ;
113
111
}
You can’t perform that action at this time.
0 commit comments