Prado\Web\UI\WebControls\TCaptcha::onPreRender PHP Method

onPreRender() public method

Configures the image URL that shows the token.
public onPreRender ( $param )
    public function onPreRender($param)
    {
        parent::onPreRender($param);
        if (!self::checkRequirements()) {
            throw new TConfigurationException('captcha_imagettftext_required');
        }
        if (!$this->getViewState('TokenGenerated', 0)) {
            $manager = $this->getApplication()->getAssetManager();
            $manager->publishFilePath($this->getFontFile());
            $url = $manager->publishFilePath($this->getCaptchaScriptFile());
            $url .= '?options=' . urlencode($this->getTokenImageOptions());
            $this->setImageUrl($url);
            $this->setViewState('TokenGenerated', time());
        }
    }