/** * Create html code for expected result * * @param string $imageValue * @param string $urlPath * * @return string */ protected function _createHtmlCode($imageValue, $urlPath) { $html = file_get_contents(__DIR__ . '/_files/BaseImageHtml.txt'); $html = str_replace('%htmlId%', $this->_model->getHtmlId(), $html); $html = str_replace('%imageValue%', $imageValue, $html); $html = str_replace('%uploadImage%', 'http://example.com/pub/images/catalog_product_gallery/upload/', $html); $html = str_replace('%imageUrl%', $urlPath, $html); return $html; }
/** * Create html code for expected result * * @param string $imageValue * @param string $urlPath * * @return string */ protected function _createHtmlCode($imageValue, $urlPath) { $uploadImage = 'http://example.com/pub/images/catalog_product_gallery/upload/'; return str_replace(array('%htmlId%', '%imageValue%', '%uploadImage%', '%imageUrl%'), array($this->_block->getHtmlId(), $imageValue, $uploadImage, $urlPath), file_get_contents(__DIR__ . '/_files/BaseImageHtml.txt')); }