Blesta Addons Posted February 1, 2015 Report Posted February 1, 2015 i'm writing a component to display invoice in html format , almost done and work like a charm . what i need is to use the inoice logo if set displayed in my html page , ny quick code to include id in my template invoice ? what i have as solution , is copy the logo into a temp directory and use it . PauloV 1 Quote
serge Posted February 1, 2015 Report Posted February 1, 2015 maybe an inspiration from here: in /app/views/client/bootstrap/structure.pdt & line 51 <div class="logo"> <a href="<?php echo $this->Html->safe($this->base_uri);?>"> <?php if (!empty($theme_logo)) { ?> <img src="<?php $this->Html->_($theme_logo);?>" alt="Logo" /> <?php } elseif (!empty($blesta_logo)) { ?> <img src="<?php $this->Html->_($blesta_logo);?>" alt="Blesta" /> <?php } else { ?> <img src="<?php echo $this->view_dir;?>images/logo.png" alt="Blesta" /> <?php } ?> </a> </div> Quote
Blesta Addons Posted February 1, 2015 Author Report Posted February 1, 2015 thanks serge , but this is not what i want or this methode is impossible with my request . the invoice template system didn't accept the base_uri var , also note that the upload directory is out side the public html . but anyway i have found tip that is working for me , i convert the image to the base_64 code and i use it in the img tag . so if anyone want the same thing this is the working solution $type = pathinfo($this->meta['logo'] , PATHINFO_EXTENSION); $data = file_get_contents($this->meta['logo']); $base64 = 'data:image/' . $type . ';base64,' . base64_encode($data); $buffer = '<h1><img src="'. $base64 .'"></h1>'; LukesUbuntu and serge 2 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.