diff --git a/public/img/hemayatMali.jpg b/public/img/hemayatMali.jpg new file mode 100644 index 0000000..6e88135 Binary files /dev/null and b/public/img/hemayatMali.jpg differ diff --git a/public/img/idea.png b/public/img/idea.png new file mode 100644 index 0000000..a2a16ee Binary files /dev/null and b/public/img/idea.png differ diff --git a/public/img/mobileUiHesabix.png b/public/img/mobileUiHesabix.png new file mode 100644 index 0000000..3ead3bb Binary files /dev/null and b/public/img/mobileUiHesabix.png differ diff --git a/public/img/viewMobile.png b/public/img/viewMobile.png new file mode 100644 index 0000000..c53fc1a Binary files /dev/null and b/public/img/viewMobile.png differ diff --git a/public/img/viewWindows.png b/public/img/viewWindows.png new file mode 100644 index 0000000..6c20f6e Binary files /dev/null and b/public/img/viewWindows.png differ diff --git a/public/uploaded/1735143659-contact-us-min.jpg b/public/uploaded/1735143659-contact-us-min.jpg new file mode 100644 index 0000000..e0e0870 Binary files /dev/null and b/public/uploaded/1735143659-contact-us-min.jpg differ diff --git a/src/Controller/PageController.php b/src/Controller/PageController.php index a008c80..1f78137 100644 --- a/src/Controller/PageController.php +++ b/src/Controller/PageController.php @@ -11,10 +11,33 @@ use Symfony\Component\Routing\Attribute\Route; class PageController extends AbstractController { #[Route('/page/{url}', name: 'app_page')] - public function app_page(EntityManagerInterface $entityManagerInterface,string $url): Response + public function app_page(EntityManagerInterface $entityManagerInterface, string $url): Response { - $item = $entityManagerInterface->getRepository(Post::class)->findPageByUrl(['url'=> $url]); - if(!$item) throw $this->createNotFoundException(); + $item = $entityManagerInterface->getRepository(Post::class)->findByUrlFilterCat($url, 'plain'); + if (!$item) + throw $this->createNotFoundException(); + return $this->render('post/page.html.twig', [ + 'item' => $item, + ]); + } + + #[Route('/blog/{page}', name: 'app_blog_home')] + public function app_blog_home($page = 1, EntityManagerInterface $entityManagerInterface, string $url): Response + { + $item = $entityManagerInterface->getRepository(Post::class)->findByUrlFilterCat($url, 'blog'); + if (!$item) + throw $this->createNotFoundException(); + return $this->render('post/blog_home.html.twig', [ + 'item' => $item, + ]); + } + + #[Route('/blog/post/{url}', name: 'app_blog_post')] + public function app_blog_post(EntityManagerInterface $entityManagerInterface, string $url): Response + { + $item = $entityManagerInterface->getRepository(Post::class)->findByUrlFilterCat($url, 'blog'); + if (!$item) + throw $this->createNotFoundException(); return $this->render('post/page.html.twig', [ 'item' => $item, ]); diff --git a/src/Repository/PostRepository.php b/src/Repository/PostRepository.php index 4e2198e..8c3e9e3 100644 --- a/src/Repository/PostRepository.php +++ b/src/Repository/PostRepository.php @@ -33,14 +33,14 @@ class PostRepository extends ServiceEntityRepository // ; // } - public function findPageByUrl($value): ?Post + public function findByUrlFilterCat($value,$cat='plain'): ?Post { return $this->createQueryBuilder('p') ->innerJoin('p.cat', 'c') ->where('c.code = :cat') ->andWhere('p.url = :url') ->setParameter('url', $value) - ->setParameter('cat', 'plain') + ->setParameter('cat', $cat) ->getQuery() ->getOneOrNullResult() ; diff --git a/templates/base.html.twig b/templates/base.html.twig index f281f26..c0746dd 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -22,7 +22,7 @@ {% endblock %}
-