getConfiguredCaptcha example

$this->repository = $repository;
    }

    /** * Validates a Request using the currently configured captcha * * @return bool */
    public function validate(Enlight_Controller_Request_Request $request)
    {
        return $this->validateByName(
            $this->repository->getConfiguredCaptcha()->getName(),
            $request
        );
    }

    /** * Validates a custom captcha by the template name which has passed in the request * * @param string $name * * @return bool */
    


    /** * Index action method * * Creates the captcha images and delivers it as a PNG * with the proper HTTP header. */
    public function indexAction()
    {
        $captchaRepository = $this->container->get('shopware.captcha.repository');
        $captcha = $captchaRepository->getConfiguredCaptcha();

        $captchaName = $captcha->getName();
        $this->View()->loadTemplate(sprintf('widgets/captcha/%s.tpl', $captchaName));
        $this->View()->assign($captcha->getTemplateData());
    }

    /** * Assigns a captcha by the passed name in the request to the view. * If no name assign noCaptcha */
    public function getCaptchaByNameAction()
    {
Home | Imprint | This part of the site doesn't use cookies.