original_string: public function dataUrl($type = 'jpeg')
      {
          $type      = $this->getType($type);
          $imageFunc = 'image' . $type;
  
          ob_start();
  
          $imageFunc($this->newImage);
  
          $data = ob_get_contents();
  
          ob_end_clean();
  
          $this->destroyAll();
  
          $dataUrl = 'data:image/'. $type . ';base64,' . base64_encode($data);
  
          return $dataUrl;
      }
code: public function dataUrl($type = 'jpeg')
      {
          $type      = $this->getType($type);
          $imageFunc = 'image' . $type;
  
          ob_start();
  
          $imageFunc($this->newImage);
  
          $data = ob_get_contents();
  
          ob_end_clean();
  
          $this->destroyAll();
  
          $dataUrl = 'data:image/'. $type . ';base64,' . base64_encode($data);
  
          return $dataUrl;
      }
code_tokens: public function dataUrl ( $ type = 'jpeg' ) { $ type = $ this -> getType ( $ type ) ; $ imageFunc = 'image' . $ type ; ob_start ( ) ; $ imageFunc ( $ this -> newImage ) ; $ data = ob_get_contents ( ) ; ob_end_clean ( ) ; $ this -> destroyAll ( ) ; $ dataUrl = 'data:image/' . $ type . ';base64,' . base64_encode ( $ data ) ; return $ dataUrl ; }
docstring: Image to data url base64
  
  @param string $type jpeg
  @return string
docstring_tokens: Image to data url base64