Class dmitrybtn\yimp\Navigator
Inheritance | dmitrybtn\yimp\Navigator » yii\base\BaseObject |
---|
Base class to pass data from controller to layout.
Navigator has the following properties, used in layout:
brand
: Application name, displayed as brand label in navbar. It isYii::$app->name
by default.title
: Page name, displayed as<title>
tag. It isucfirst(Yii::$app->controller->action->id)
by default. This property is also used as default value forheader
,headerMobile
, andheaderCrumb
properties.headerDesktop
: Page name, displayed as<h1>
on desktops. If false,<h1>
will not be displayed.headerMobile
: Page name, displayed in navbar on mobiles.headerCrumb
: Last part of breadcrumbs, representing current page title. If false, it will not be displayed.menuLeft
: left menu config, represented by yii\bootstrap4\Nav::items with additional functionality, provided by dmitrybtn\yimp\MenuAdapter.menuRight
: right menu config, represented by yii\bootstrap4\Nav::items with additional functionality, provided by dmitrybtn\yimp\MenuAdapter.menuTop
: top menu config, represented by yii\bootstrap4\Nav::items with additional functionality, provided by dmitrybtn\yimp\MenuAdapter.crumbs
: Breadcrumbs config, represented by yii\bootstrap4\Breadcrumbs::links property, without last item, which is taken fromheaderCrumb
property.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$crumbs | array|false | Breadcrumbs config, passed to Breadcrumbs widget. | dmitrybtn\yimp\Navigator |
$menuLeft | array | Left menu config Left menu is rendered in left sidebar on desktops and in left slider on mobiles. | dmitrybtn\yimp\Navigator |
$menuRight | array | Right Right menu is rendered in right sidebar on desktops and in right slider on mobiles. | dmitrybtn\yimp\Navigator |
$menuTop | array | Left menu config, rendered by dmitrybtn\yimp\MenuAdapter. | dmitrybtn\yimp\Navigator |
Protected Properties
Public Methods
Method | Description | Defined By |
---|---|---|
getBrand() | Getter for brand property |
dmitrybtn\yimp\Navigator |
getHeaderCrumb() | Getter for headerCrumb property, used to render header last part of breadcrumbs |
dmitrybtn\yimp\Navigator |
getHeaderDesktop() | Getter for headerDesktop property, used to render <h1> tag on desktops. |
dmitrybtn\yimp\Navigator |
getHeaderMobile() | Getter for headerMobile property, used to render header in navbar on mobiles. |
dmitrybtn\yimp\Navigator |
getTitle() | Getter for title property, used to render <title> tag. |
dmitrybtn\yimp\Navigator |
setBrand() | Setter fot brand property |
dmitrybtn\yimp\Navigator |
setHeaderCrumb() | Getter for headerCrumb property |
dmitrybtn\yimp\Navigator |
setHeaderDesktop() | Setter for headerDesktop property |
dmitrybtn\yimp\Navigator |
setHeaderMobile() | Setter for headerMobile property |
dmitrybtn\yimp\Navigator |
setTitle() | Setter fot title property |
dmitrybtn\yimp\Navigator |
Property Details
Breadcrumbs config, passed to Breadcrumbs widget.
If it is false
, breadcrumbs will not be rendered.
Left menu config
Left menu is rendered in left sidebar on desktops and in left slider on mobiles. It is adapted by dmitrybtn\yimp\MenuAdapter and rendered by dmitrybtn\yimp\widgets\Menu. It is recommended to use left menu as main menu of your application and config it in your implementation of dmitrybtn\yimp\Navigator class.
Right
Right menu is rendered in right sidebar on desktops and in right slider on mobiles. It is adapted by dmitrybtn\yimp\MenuAdapter and rendered by dmitrybtn\yimp\widgets\Menu. It is recommended to use it as context menu and config it in actions.
Left menu config, rendered by dmitrybtn\yimp\MenuAdapter.
Top menu is rendered in navbar on desktops and in left slider (after left menu) on mobiles. It is adapted by dmitrybtn\yimp\MenuAdapter and rendered by dmitrybtn\yimp\widgets\Menu. It is recommended to use it to user-specific options (Login, Logout, Profile settings and others) and configure it in your implementation of dmitrybtn\yimp\Navigator class.
Method Details
Getter for brand
property
If brand
property was not set by setBrand(), Yii::$app->name
will be returned.
public string getBrand ( ) | ||
return | string | Brand label |
---|
Getter for headerCrumb
property, used to render header last part of breadcrumbs
If headerCrumb
property was not setted by setHeaderCrumb(), getTitle() will be returned.
public string getHeaderCrumb ( ) |
Getter for headerDesktop
property, used to render <h1>
tag on desktops.
If headerDesktop
property was not setted by setHeaderDesktop(), getTitle() will be returned. If headerDesktop
property is false, <h1>
tag will not be rendered.
public string|false getHeaderDesktop ( ) |
Getter for headerMobile
property, used to render header in navbar on mobiles.
If headerMobile
property was not setted by setHeaderMobile(), getTitle() will be returned.
public string getHeaderMobile ( ) |
Getter for title
property, used to render <title>
tag.
If title
property was not set by setTitle(), current action index will be returned.
public string getTitle ( ) | ||
return | string | Page title |
---|
Setter fot brand
property
public void setBrand ( \dmitrybtn\yimp\string $brand ) | ||
$brand | string |
Getter for headerCrumb
property
public void setHeaderCrumb ( $headerCrumb ) | ||
$headerCrumb | string |
Setter for headerDesktop
property
public void setHeaderDesktop ( $header ) | ||
$header | string|false |
Setter for headerMobile
property
public void setHeaderMobile ( $headerMobile ) | ||
$headerMobile | string |
Setter fot title
property
public void setTitle ( \dmitrybtn\yimp\string $title ) | ||
$title | string |