Home » PHP » Pimcore

Pimcore

Upload image through Pimcore command in the asset folder

Pimcore

Create the command folder in the AppBundle folder. Than create the ImageUploadCommand.php /var/www/html/thebricktest/thebrick/src/AppBundle/Command/ImageUploadCommand.php <?php namespace AppBundle\Command; use Pimcore\Console\AbstractCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputArgument; use AppBundle\Service\UploadImage; class ImageUploadCommand extends AbstractCommand { protected function configure() { $this ->setName('imageupload:command') ->setDescription('Image upload command'); } protected function execute(InputInterface $input, OutputInterface $output) { $obj = …

Read More »

How To Generate Pimcore Bundles?

Pimcore

To generate bundles the below commands can be use. The steps run on Pimcore 5. The details are below # generate bundle interactively $ bin/console pimcore:generate:bundle # if the command is not available, make sure you are running the console in dev environment (see note below) $ bin/console pimcore:generate:bundle --env=dev …

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 »