yeesoft/yii2-yee-block

HTML Block Module For Yee CMS

0.1.0 2017-03-01 11:26 UTC

This package is auto-updated.

Last update: 2022-03-29 00:28:25 UTC


README

##Yee CMS - HTML Block Module

####Backend module for managing blocks

This module is part of Yee CMS (based on Yii2 Framework).

Block module lets you easily create HTML blocks on your site.

Installation

  • Either run
composer require --prefer-dist yeesoft/yii2-yee-block "~0.1.0"

or add

"yeesoft/yii2-yee-block": "~0.1.0"

to the require section of your composer.json file.

  • Run migrations
yii migrate --migrationPath=@vendor/yeesoft/yii2-yee-block/migrations/

Configuration

  • In your backend config file
'modules'=>[
	'block' => [
		'class' => 'yeesoft\block\BlockModule',
	],
],

Usage

  • Widget namespace:
use yeesoft\block\models\Block;
  • Render HTML Block by slug:
echo Block::getHtml('block-slug'); 
  • You can use variables in your HTML Blocks. Example:

    example of block with variables:

<div class="some-class">
    <a href="{{link}}">{{title}}</a>
</div>

render block with variables:

echo Block::getHtml('block-slug', ['link' => 'http://www.example.com/', 'title' => 'Example Site']);