Esempio n. 1
0
 /**
  * Handle the command.
  *
  * @param PageRepositoryInterface $pages
  */
 public function handle(PageRepositoryInterface $pages)
 {
     foreach ($this->page->getChildren() as $page) {
         if ($page instanceof PageInterface && $page->isEnabled()) {
             $pages->save($page->setAttribute('path', $this->page->getPath() . '/' . $page->getSlug()));
         }
     }
 }
Esempio n. 2
0
 /**
  * Handle the command.
  *
  * @param PageRepositoryInterface $pages
  */
 public function handle(PageRepositoryInterface $pages)
 {
     /* @var PageInterface $page */
     foreach ($this->page->getChildren() as $page) {
         if ($page->isEnabled()) {
             $pages->save($page->setPath($this->page->getPath() . '/' . $page->getSlug()));
         }
     }
 }
Esempio n. 3
0
 /**
  * Make the page breadcrumbs.
  *
  * @param PageInterface $page
  */
 public function make(PageInterface $page)
 {
     $breadcrumbs = [$page->getTitle() => $page->getPath()];
     $this->loadParent($page, $breadcrumbs);
     foreach (array_reverse($breadcrumbs) as $key => $url) {
         $this->breadcrumbs->add($key, $url);
     }
 }