public static function autoload($class_name) { $sources = array('/lib/class', '/lib'); $found = false; $file = \System\Loader::get_class_file_name($class_name, true); $helper_pos = strpos(\System\Loader::get_link_from_class($class_name), 'helper'); $is_helper = $helper_pos !== false && $helper_pos <= 1; foreach ($sources as $key => $source) { $classes = \System\Composer::list_dirs($source); foreach ($classes as $dir) { if (file_exists($f = $dir . '/' . $file)) { $found = (include_once $f); break; } } if ($found) { break; } } }
/** Get translated attribute description * @param string $model * @param string $attr * @return string */ public function trans_model_attr_desc($model, $attr) { return $this->trans('attr-' . \System\Loader::get_link_from_class($model) . '-' . $attr . '-desc'); }