RainLab\Blog\Components\Post::defineProperties PHP Метод

defineProperties() публичный Метод

public defineProperties ( )
    public function defineProperties()
    {
        return ['slug' => ['title' => 'rainlab.blog::lang.settings.post_slug', 'description' => 'rainlab.blog::lang.settings.post_slug_description', 'default' => '{{ :slug }}', 'type' => 'string'], 'categoryPage' => ['title' => 'rainlab.blog::lang.settings.post_category', 'description' => 'rainlab.blog::lang.settings.post_category_description', 'type' => 'dropdown', 'default' => 'blog/category']];
    }

Usage Example

Пример #1
0
 /**
  * Override of original method
  * - add new setting for the post page id
  *
  * @return array
  */
 public function defineProperties()
 {
     $parentProps = parent::defineProperties();
     $properties = array_merge($parentProps, ['postPage' => ['title' => 'rainlab.blog::lang.settings.posts_post', 'description' => 'rainlab.blog::lang.settings.posts_post_description', 'type' => 'dropdown', 'default' => 'blog/post', 'group' => 'Links']]);
     return is_array($properties) ? $properties : $parentProps;
 }