PHP Class Piwik\Category\Subcategory
All widgets within a subcategory will be rendered in the Piwik reporting UI under the same page. By default
you do not have to specify any subcategory as they are created automatically. Only create a subcategory if you
want to change the name for a specific subcategoryId or if you want to specifiy a different order so the subcategory
appears eg at a different order in the reporting menu. It also affects the order of reports in
API.getReportMetadata and wherever we display any reports.
To define a subcategory just place a subclass within the
Categories folder of your plugin.
Subcategories can also be added through the {@hook Subcategory.addSubcategories} event.
Afficher le fichier
Open project: piwik/piwik
Class Usage Examples
Protected Properties
Свойство |
Type |
Description |
|
$categoryId |
|
See {@link Piwik\Widget\WidgetConfig::setCategoryId()`} or {@link Piwik\Report\getCategoryId()}. |
|
$id |
|
For example you might want to have the actual GoalId (eg '4') in the URL but the actual goal name in the
submenu (eg 'Downloads'). In this case one should specify $id=4;$name='Downloads'. |
|
$name |
string |
The name that shall be used in the menu etc, defaults to the specified {@link $id}. See {@link $id}. |
|
$order |
integer |
The order of the subcategory. The lower the value the earlier a widget or a report will be displayed. |
|
Méthodes publiques
Méthode |
Description |
|
getCategoryId ( ) : string |
Get the specifed categoryId see {@link $categoryId}. |
|
getId ( ) : string |
Get the id of the subcategory. |
|
getName ( ) : string |
Get the name of the subcategory. |
|
getOrder ( ) : integer |
Get the order of the subcategory. |
|
setCategoryId ( string $categoryId ) : static |
Sets (overwrites) the categoryId see {@link $categoryId}. |
|
setId ( string $id ) : static |
Sets (overwrites) the id of the subcategory see {@link $id}. |
|
setName ( string $name ) : static |
Sets (overwrites) the name see {@link $name} and {@link $id}. |
|
setOrder ( integer $order ) : static |
Sets (overwrites) the order see {@link $order}. |
|
Method Details
getCategoryId()
public méthode
Get the specifed categoryId see {@link $categoryId}.
Get the id of the subcategory.
Get the name of the subcategory.
getOrder()
public méthode
Get the order of the subcategory.
setCategoryId()
public méthode
Sets (overwrites) the categoryId see {@link $categoryId}.
Sets (overwrites) the id of the subcategory see {@link $id}.
public setId ( string $id ) : static |
$id |
string |
A translation key eg 'General_Overview'. |
Résultat |
static |
|
Sets (overwrites) the name see {@link $name} and {@link $id}.
public setName ( string $name ) : static |
$name |
string |
A translation key eg 'General_Overview'. |
Résultat |
static |
|
setOrder()
public méthode
Sets (overwrites) the order see {@link $order}.
Property Details
$categoryId protected_oe property
See {@link Piwik\Widget\WidgetConfig::setCategoryId()`} or {@link Piwik\Report\getCategoryId()}.
$id protected_oe property
For example you might want to have the actual GoalId (eg '4') in the URL but the actual goal name in the
submenu (eg 'Downloads'). In this case one should specify $id=4;$name='Downloads'.
$name protected_oe property
The name that shall be used in the menu etc, defaults to the specified {@link $id}. See {@link $id}.
protected string $name |
Résultat |
string |
|
$order protected_oe property
The order of the subcategory. The lower the value the earlier a widget or a report will be displayed.
protected int $order |
Résultat |
integer |
|