PHP code example of abdualiym / yii2-block
1. Go to this page and download the library: Download abdualiym/yii2-block library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
abdualiym / yii2-block example snippets
'modules' => [
'block' => [ // don`t change module key
'class' => '@abdualiym\block\Module',
'storageRoot' => $params['staticPath'],
'storageHost' => $params['staticHostInfo'],
'thumbs' => [ // 'sm' and 'md' keys are reserved
'admin' => ['width' => 128, 'height' => 128],
'thumb' => ['width' => 320, 'height' => 320],
],
'languages' => [
'ru' => [
'id' => 0,
'name' => 'Русский',
],
'uz' => [
'id' => 1,
'name' => 'English',
],
],
],
]
/block/categories/index
/block/block/index?slug=your_category_slug_name
\Yii::$app->params['cms']['languageIds'][$prefix] = $language['id'];
[
'en' => 2,
'ru' => 1,
...
]
\Yii::$app->params['cms']['languages'][$prefix] = $language['name'];
[
'en' => 'English',
...
]
\Yii::$app->params['cms']['languages2'][$language['id']] = $language['name'];
[
2 => 'English',
...
]
$blocks = Blocks::getBySlug($slug);
foreach ($blocks as $block) {
echo ($blockObject->getModelByType())->get();
}