Utility Functions in Bootstrap

bootTrimExtension($assets, $extension)

Purpose: when passed an array (or string) of assets, each asset will be reduced to the asset file name without the supplied $extension if found

Returns: $assets, in original variable type, with the $extension trimmed from the end of the filename(s).  (If passed a string, a string will be returned, otherwise if passed an array, then an array is returned)

Examples:

  1. //array('site.css', 'avenger.css', 'correct');
  2. // returns: array('site', 'avenger', 'correct');
  3. $assets = bootTrimExtension($assets, '.css');
  4. // It's good to remove .ctp, otherwise, .ctp will be added and you'll end up with .ctp.ctp in some cases
  5. $output = $this->viewObject->element( bootTrimExtension($question['name'], '.ctp') );
1-207-221-3255 | Contact Site Avenger - Your Content Management Superhero

Copyright © 2023 Saco Design, Inc. | All Rights Reserved | Website Design by Saco Design | Superpowered by Site Avenger