/** * 渲染验证码图像。 */ protected function renderImage() { if (!isset($this->imageOptions['id'])) { $this->imageOptions['id'] = $this->getId(); } $url = $this->getController()->createUrl($this->captchaAction, array('v' => uniqid())); $alt = isset($this->imageOptions['alt']) ? $this->imageOptions['alt'] : ''; echo Html::image($url, $alt, $this->imageOptions); }