Advertisement
Shaun_B

Simple ExpressionEngine plug-in for IE Edge meta stuff

Sep 10th, 2014
668
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.92 KB | None | 0 0
  1. <?php
  2. $plugin_info = Array(
  3.     'pi_name'           => 'IE_Edge',
  4.     'pi_version'        => '0.0.1',
  5.     'pi_author'         => 'Shaun Bebbington',
  6.     'pi_description'    => 'Detect if IE10 or less is detected, and will add <meta http-equiv="X-UA-Compatible" content="IE=edge"> to the header if that\'s what you want.',
  7.     'pi_usage'          => 'Include {exp:ie_edge} below the <meta charset="utf-8"> or similar element'
  8. );
  9. class IE_Edge
  10. {
  11.     /**
  12.      * Here is a simple plug-in for Expression Engine -> description above (see $plugin_info Array)
  13.      *
  14.      * @author      Shaun Bebbington
  15.      * @param       none
  16.      * @date        10 Sep 2014 11:08:05
  17.      * @version     0.0.1
  18.      * @return      string
  19.      */
  20.     public function IE_Edge()
  21.     {
  22.         $this->EE   =& get_instance();
  23.         $browser    = '';
  24.         // Look for IE browsers
  25.         if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') )
  26.         {
  27.             $browser = '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
  28.         }
  29.         $this->return_data = $browser;
  30.     }
  31. }
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement