Top Twig Template Interview And Answer Part 4

1. How we can append text in title with separator in twig template? {% do pimcore_head_title().append('Pimcore Website') %} {% do pimcore_head_title().setSeparator(' : ') %} 2. How can we include image through asset in twig template? <img src="{{ asset('static/img/logo-white.svg') }}" alt="Image"> 3. How can we check asset is the instance of …

Read More »

How AJAX calls work with TWIG

Twig can load a template through AJAX.. The following details are below /var/www/html/my-project/src/AppBundle/Controller/DefaultController.php namespace AppBundle\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; class DefaultController extends FrontendController { /** * Fetch data from ajax call. * @param Request $request * @Route("/xyz/{id}", methods={"GET"}) */ public function proAjaxAction(Request $request){ $this->view->id = $request->get('id'); } } …

Read More »

Custom Route in Pimcore 5

Pimcore

Custom routes are an alternative to Symfony’s routing functionalities. The following details are below /var/www/html/my-project/src/AppBundle/Controller/DefaultController.php namespace AppBundle\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; class DefaultController extends FrontendController { /** * Fetch data from ajax call. * @param Request $request * @Route("/xyz/{id}", methods={"GET"}) */ public function proAjaxAction(Request $request){ $this->view->id = $request->get('id'); …

Read More »

How to git configure?

github

There is no any big deal to configure GIT online. First of all you have to create a online account on https://github.com. Run the below command on the ubuntu terminal. 1. git init 2. git remote add origin https://github.com/branch-name.git 3. git status 4. git add demo.txt 5. git commit -m …

Read More »