Description
Guestbook module helps you to create live editable guestbook and form on frontend.
Include
use yii\easyii\modules\guestbook\api\Guestbook;
Public functions
array Guestbook::items( $options = [] )
|
$options |
array |
- where (mixed) - additional condition, details
- pagination (array) - properties for Pagination object.
|
Returns array of PostObject
|
array Guestbook::form( $options = [] )
|
$options |
array |
- successUrl (string) - redirect url on success.
- errorUrl (string) - redirect url on error.
|
Returns fully worked standalone html form.
|
array Guestbook::save( $data )
|
If you using your own form, this function will be useful for manual saving guestbook posts.
|
$data |
array |
- name (string)
- email (string)
- title (string)
- text (string)
- g-recaptcha-response (string) - required attribute when reCaptcha is enabled
|
Returns Result array.
|
array Guestbook::last( $limit = 1, $where = [] )
|
$limit |
integer |
Count of last posts |
$where |
mixed |
additional condition, details |
Returns array of PostObject
|
string Guestbook::pages()
|
Returns pagination html generated by yii\widgets\LinkPager widget. |
object Guestbook::pagination()
|
Returns yii\data\Pagination object. |
Public Properties
$name |
string |
User name |
$email |
string |
User email |
$title |
string |
Post title |
$text |
string |
Post text |
$answer |
string |
Adminstration answer to post |
$time |
int |
Post create unix time |
$date |
string |
Post create formatted date |
$model |
yii\db\ActiveRecord |
Guestbook ActiveRecord object |