public static function by_id($id) { Dic::preload(); $cache_key = self::$cache_key; $dics = Config::get($cache_key); $dic = @$dics['by_id'][$id]; return $dic ?: NULL; }
public function destroy($id) { Allow::permission($this->module['group'], 'delete'); if (!Request::ajax()) { App::abort(404); } $json_request = array('status' => FALSE, 'responseText' => ''); if (NULL !== Dictionary::find($id)) { Dictionary::find($id)->delete(); } ## Clear & reload dics cache Dic::drop_cache(); Dic::preload(); $json_request['responseText'] = 'Удалено'; $json_request['status'] = TRUE; return Response::json($json_request, 200); }
public static function returnRoutes($prefix = null) { ## Предзагружаем все словари (с кешированием) Dic::preload(); #Helper::tad(Cache::get('app.dics')); }