Advertisement
Guest User

code igniter assets helper

a guest
Feb 3rd, 2015
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.96 KB | None | 0 0
  1. <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2.  
  3. /* * ***********************************************************************
  4.   Document    : assets_helper
  5.   Créé le     : 8 août 2011, 13:54:05
  6.   Auteur      : Adrien Lopes
  7.   Description :
  8.   -  8 août 2011 Création
  9.  
  10.  * *********************************************************************** */
  11.  
  12.  
  13. if ( ! function_exists('css'))
  14. {
  15.     function css($nom)
  16.     {
  17.         return '<link rel="stylesheet" href="' . base_url() . 'assets/css/' . $nom . '.css " type="text/css" media="screen" />';
  18.     }
  19. }
  20.  
  21. if ( ! function_exists('css_print'))
  22. {
  23.     function css_print($nom)
  24.     {
  25.         return '<link rel="stylesheet" href="' . base_url() . 'assets/css/' . $nom . '.css " type="text/css" media="print" />';
  26.     }
  27. }
  28.  
  29. if ( ! function_exists('jsdefer'))
  30. {
  31.     function js_defer($nom)
  32.     {
  33.         return '<script defer src="' . base_url() . 'assets/js/' . $nom . '.js" type="text/javascript" ></script>';
  34.     }
  35. }
  36.  
  37. if ( ! function_exists('js'))
  38. {
  39.     function js($nom)
  40.     {
  41.         return '<script src="' . base_url() . 'assets/js/' . $nom . '.js" type="text/javascript" ></script>';
  42.     }
  43. }
  44.  
  45. if ( ! function_exists('img_url'))
  46. {
  47.     function img_url($nom)
  48.     {
  49.         return base_url() . 'assets/images/' . $nom;
  50.     }
  51. }
  52.  
  53. if ( ! function_exists('img'))
  54. {
  55.     function img($nom, $alt = '', $width='', $class='', $onclick='')
  56.     {
  57.         return '<img src="' . img_url($nom) . '" alt="' . $alt . '" width="'.$width.'" class="'.$class.'" onclick="'.$onclick.'" />';
  58.     }
  59. }
  60.  
  61. if ( ! function_exists('js_app'))
  62. {
  63.     function js_app($appName,$jsName)
  64.     {
  65.         return '<script src="' . base_url() . 'application/modules/'.$appName.'/assets/js/' . $jsName . '.js" type="text/javascript"></script>';
  66.     }
  67. }
  68.  
  69. if ( ! function_exists('css_app'))
  70. {
  71.     function css_app($appName,$cssName)
  72.     {
  73.         return '<link rel="stylesheet" href="' . base_url() . 'application/modules/'.$appName.'/assets/css/' . $cssName . '.css " type="text/css" media="screen" />';
  74.        
  75.     }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement