Example #1
0
 /**
  * Create the absolute address to the template folder.
  *
  * @param  boolean $custom
  * @return string url to template folder
  */
 public static function templatePath($custom = TEMPLATE, $folder = '/assets/')
 {
     $template = Inflector::tableize($custom);
     return Config::get('app.url') . 'templates/' . $template . $folder;
 }
Example #2
0
 /**
  * load css scripts
  * @param  String|Array  $files      paths to file/s
  * @param  boolean       $cache      if set to true a cache will be created and serverd
  * @param  boolean       $refresh    if true the cache will be updated
  * @param  string        $cachedMins minutes to hold the cache
  */
 public static function css($files, $cache = false, $refresh = false, $cachedMins = '1440')
 {
     $path = APPDIR . Url::relativeTemplatePath() . 'css/compressed.min.css';
     $type = 'css';
     if ($cache == false) {
         static::resource($files, $type);
     } else {
         if ($refresh == false && file_exists($path) && filemtime($path) > time() - 60 * $cachedMins) {
             $path = str_replace(APPDIR, null, $path);
             $path = Inflector::tableize($path);
             static::resource(DIR . $path, $type);
         } else {
             $source = static::collect($files, $type);
             $source = static::compress($source);
             file_put_contents($path, $source);
             $path = str_replace(APPDIR, null, $path);
             $path = Inflector::tableize($path);
             static::resource(DIR . $path, $type);
         }
     }
 }
 /**
  * Register a custom implicit Validator extension.
  *
  * @param  string   $rule
  * @param  \Closure|string  $extension
  * @param  string  $message
  * @return void
  */
 public function extendImplicit($rule, $extension, $message = null)
 {
     $this->implicitExtensions[$rule] = $extension;
     if ($message !== null) {
         $rule = Inflector::tableize($rule);
         $this->fallbackMessages[$rule] = $message;
     }
 }
Example #4
0
 /**
  * Created the absolute address to the template folder.
  *
  * @param  boolean $custom
  * @return string url to template folder
  */
 public static function templatePath($custom = TEMPLATE, $folder = '/assets/')
 {
     $template = Inflector::tableize($custom);
     return SITEURL . 'templates/' . $template . $folder;
 }
 /**
  * Get the Table for the Model.
  *
  * @return string
  */
 public function getTable()
 {
     if (isset($this->table)) {
         return $this->table;
     }
     $baseName = class_basename($this);
     return str_replace('\\', '', Inflector::tableize($baseName));
 }
 /**
  * Determine the URI from the given method name.
  *
  * @param  string  $name
  * @param  string  $prefix
  * @return string
  */
 public function getPlainUri($name, $prefix)
 {
     return $prefix . '/' . implode('-', array_slice(explode('_', Inflector::tableize($name)), 1));
 }