Example #1
0
 /**
  * Returns the URL for the master object of given ID
  *
  * @param  MenuItem  $item Master object iD
  *
  * @return string
  */
 public function getUrl(MenuItem $item)
 {
     $page_url = Settings::get('blog_category_page', 'blog/category');
     $category = Category::find($item->master_object_id);
     if (!$category) {
         throw new ApplicationException("Category not found.");
     }
     return URL::to($page_url . '/' . $category->slug);
 }
Example #2
0
 /**
  * Returns the URL for the master object of given ID
  *
  * @param  MenuItem  $item Master object iD
  *
  * @return string
  */
 public function getUrl(MenuItem $item)
 {
     $page_url = Settings::get('blog_post_page', 'blog/post');
     $post = Post::find($item->master_object_id);
     if (!$post) {
         throw new ApplicationException("Post not found.");
     }
     return URL::to($page_url . '/' . $post->slug);
 }
Example #3
0
 /**
  * Internal method, prepare the list model object
  */
 protected function createModel()
 {
     return SettingsModel::instance();
 }