Kaynağa Gözat

Crud Page & News

ideas
Guillaume 3 yıl önce
ebeveyn
işleme
6e9d8b6a03
6 değiştirilmiş dosya ile 23 ekleme ve 37 silme
  1. +2
    -2
      config/packages/doctrine.yaml
  2. +2
    -0
      src/Controller/Dashboard/DashboardAdminController.php
  3. +14
    -0
      src/Controller/Site/NewsAdminController.php
  4. +2
    -31
      src/Controller/Site/PageAdminController.php
  5. +2
    -3
      src/Entity/Site/News.php
  6. +1
    -1
      src/Entity/Site/Page.php

+ 2
- 2
config/packages/doctrine.yaml Dosyayı Görüntüle

@@ -47,8 +47,8 @@ doctrine:
Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface: App\Entity\Reduction\ReductionCredit
Lc\CaracoleBundle\Model\Section\SectionInterface: App\Entity\Section\Section
Lc\SovBundle\Model\Site\SiteInterface: App\Entity\Site\Site
Lc\CaracoleBundle\Model\Site\NewsInterface: App\Entity\Site\News
Lc\CaracoleBundle\Model\Site\PageInterface: App\Entity\Site\Page
Lc\SovBundle\Model\Site\NewsInterface: App\Entity\Site\News
Lc\SovBundle\Model\Site\PageInterface: App\Entity\Site\Page
Lc\SovBundle\Model\Ticket\TicketInterface: App\Entity\Ticket\Ticket
Lc\SovBundle\Model\Ticket\TicketMessageInterface: App\Entity\Ticket\TicketMessage
Lc\CaracoleBundle\Model\User\UserMerchantInterface: App\Entity\User\UserMerchant

+ 2
- 0
src/Controller/Dashboard/DashboardAdminController.php Dosyayı Görüntüle

@@ -7,6 +7,7 @@ use App\Entity\Config\Unit;
use App\Entity\Merchant\Merchant;
use App\Entity\PointSale\PointSale;
use App\Entity\Section\Section;
use App\Entity\Site\News;
use App\Entity\Site\Page;
use App\Entity\Ticket\Ticket;
use App\Entity\User\GroupUser;
@@ -26,6 +27,7 @@ class DashboardAdminController extends CaracDashboardController
yield MenuItem::linkToCrud('tickets', 'far fa-copy', Ticket::class);
yield MenuItem::linkToCrud('pointsale', 'far fa-circle', PointSale::class);
yield MenuItem::linkToCrud('page', 'far fa-copy', Page::class);
yield MenuItem::linkToCrud('news', 'far fa-circle', News::class);
yield MenuItem::subMenu('user', 'far fa-user')->setSubItems(
[
MenuItem::linkToCrud('user_merchant_index', '', UserMerchant::class),

+ 14
- 0
src/Controller/Site/NewsAdminController.php Dosyayı Görüntüle

@@ -0,0 +1,14 @@
<?php

namespace App\Controller\Site;

use App\Entity\Site\News;
use Lc\CaracoleBundle\Controller\Site\NewsAdminController as CaracNewsAdminController;

class NewsAdminController extends CaracNewsAdminController
{
public static function getEntityFqcn(): string
{
return News::class;
}
}

+ 2
- 31
src/Controller/Site/PageAdminController.php Dosyayı Görüntüle

@@ -3,41 +3,12 @@
namespace App\Controller\Site;

use App\Entity\Site\Page;
use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use Lc\CaracoleBundle\Controller\Site\PageAdminController as CaracPageAdminController;

use Lc\CaracoleBundle\Controller\AdminControllerTrait;
use Lc\SovBundle\Controller\AbstractAdminController;
use Lc\SovBundle\Field\CKEditorField;
use Lc\SovBundle\Field\ImageManagerField;
use Lc\SovBundle\Field\StatusField;

class PageAdminController extends AbstractAdminController
class PageAdminController extends CaracPageAdminController
{
use AdminControllerTrait;

public static function getEntityFqcn(): string
{
return Page::class;
}

public function configureFields(string $pageName): iterable
{
$panel = parent::configureFields($pageName);

return array_merge(
[
FormField::addPanel('general'),
TextField::new('title'),
ImageManagerField::new('image'),
NumberField::new('position')->hideOnForm(),
StatusField::new('status'),
CKEditorField::new('description'),
],
$panel
);
}


}

+ 2
- 3
src/Entity/Site/News.php Dosyayı Görüntüle

@@ -2,15 +2,14 @@

namespace App\Entity\Site;

use Lc\CaracoleBundle\Repository\Site\NewsRepository;
use Lc\SovBundle\Repository\Site\NewsRepository;
use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Model\Site\NewsInterface;
use Lc\CaracoleBundle\Model\Site\NewsModel;

/**
* @ORM\Entity(repositoryClass=NewsRepository::class)
*/
class News extends NewsModel implements NewsInterface
class News extends NewsModel
{
/**
* @ORM\Id

+ 1
- 1
src/Entity/Site/Page.php Dosyayı Görüntüle

@@ -3,7 +3,7 @@
namespace App\Entity\Site;

use Lc\CaracoleBundle\Model\Site\PageModel;
use Lc\CaracoleBundle\Repository\Site\PageRepository;
use Lc\SovBundle\Repository\Site\PageRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;

Yükleniyor…
İptal
Kaydet