I have some problems with templates in phalcon. It doesn't render as it have. Here is an example of do method of action. Action called UploadSave. And after this action I want to render my image/upload temlate.
try {
$hash = $this->request->getPost('hash');
$File = $this->_getUploadedFile();
$Validator = new ImageQualityValidator();
if($Validator->isValid($File)){
$Image = $this->_saveImage($File);
$EnvCfg = self::_getEnvCfgDir();
$cfg_data = $EnvCfg->getObject(self::MYPAINT);
$this->response->redirect($cfg_data->host.'image/crop?hash='.$hash);
}else {
$this->getViewData()->hash = $hash;
$this->getViewData()->validation_error = 'Image is invalid!!';
}
} catch (AMyPaintExceptions $Exc) {
$this->getViewData()->validation_error = $Exc->getMessage();
}
$this->view->setMainView('image/upload');
return $this->getViewData();
But result is white screen. image/upload.phtml is not empty:
{{
if( false == $this->is_already_image_uploaded) {
echo $Tag->form(
[
"image/uploadSave",
"method" => "post",
"enctype" => "multipart/form-data"
]
);
}}
<p> {{ echo $Tag->fileField('my_photo'); }}</p>
<p> {{ echo $Tag->hiddenField(["hash", "value" => $this->hash]); }}</p>
<p> {{ echo $Tag->submitButton('Submit'); }} </p>
{{ if($this->validation_error){ }}
<p>{{ print_r($this->error_information);}}</p>
{{ } }}
{{ echo $Tag->endForm(); }}
{{
}
else { }}
Image has been uploaded already.
{{ } }}
{{ instead of