php 刀片上的Laravel SVG图像

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 刀片上的Laravel SVG图像相关的知识,希望对你有一定的参考价值。

<?php
    // Use This
    use DOMDocument;
    //	    For SVG Footer Logo
      view()->composer('partials.footer', function($view) {
          // Instantiate new DOMDocument object
          $svg = new DOMDocument();
          // Load SVG file from public folder
          $svg->load(public_path('images/itclanLogo.svg'));
          // Add CSS class (you can omit this line)
          $svg->documentElement->setAttribute("class", "logo");
          // Get XML without version element
          $logo = $svg->saveXML($svg->documentElement);
          // Attach data to view
          $view->with(['logo'=>$logo]);
      });
      
      // On view page
      {!! $logo !!}

以上是关于php 刀片上的Laravel SVG图像的主要内容,如果未能解决你的问题,请参考以下文章