New version 0.9 has been released! Jun 16, 2015
×

Page module

Description

News module helps you to create live editable news on frontend.


Include

use yii\easyii\modules\news\api\News;


Public functions

array News::items( $options = [] )
$options array
  • where (mixed) - additional condition, details
  • tags (mixed) - search by tag, can be string or array
  • pagination (array) - properties for Pagination object.
Returns array of NewsObject

object News::get( $id_slug )
$id_slug integer / string News identifier can be integer (id) or string (slug)
Returns NewsObject or null if not found.

array News::last( $limit = 1 )
$limit integer Count of last news
Returns array of NewsObject

string News::plugin()
Apply Fancybox plugin on all photos, called as box() function.

string News::pages()
Returns pagination html generated by yii\widgets\LinkPager widget.

object News::pagination()
Returns yii\data\Pagination object.

NewsObject

Public Properties

$title string News title
$short string News short text
$text string News full text
$slug string News slug
$tags array List of tags
$image string Path to image attached to news
$photos array Array of PhotoObject
$views int Count of news views
$time int News create unix time
$date string News create formatted date
$model yii\db\ActiveRecord News ActiveRecord object

Public Functions

string thumb( $width, $height = null, $crop = true )
$width int Thumbnail width
$height int Thumbnail height
$crop boolean Crop or resize image to thumbnail sizes
Returns path to image thumbnail


PhotoObject

Public Properties

$image string Path to image
$description string Photo description

Public Functions

string box( $width, $height )
$width int Thumbnail width
$height int Thumbnail height
Returns Fancybox scripted image thumbnail