php - $this->genlib->ajaxOnly(); 是什么?意思是?
问题描述
这些天我一直在尝试学习一些 php,为此我一直在阅读 github 上的一些代码。我看到了这个项目并决定从那里阅读代码我一直在阅读这一特定的代码行,但我不知道它的真正含义。谁能给我解释一下?(原谅我的菜鸟)
public function lilt(){
$this->genlib->ajaxOnly();
$this->load->helper('text');
//set the sort order
$orderBy = $this->input->get('orderBy', TRUE) ? $this->input->get('orderBy', TRUE) : "name";
$orderFormat = $this->input->get('orderFormat', TRUE) ? $this->input->get('orderFormat', TRUE) : "ASC";
//count the total number of items in db
$totalItems = $this->db->count_all('items');
解决方案
ajaxOnly()
是genlib
类的方法。如果传入的请求不是通过 ajax 发出的,它的功能似乎是显示错误消息。
推荐阅读
- javascript - 从没有 node.js 的文件(文件系统)中读取
- c# - 在 .NET Core 2.1 中订阅 xUnit 中的 AppDomain.UnhandledException
- python - 如何使用 xlwt 将 python 数据导出到 excel?
- javascript - 在谷歌地图API中的2个点之间的直线上找到一个特定距离后的点
- javascript - JavaScript - 当索引未知时将对象添加到数组中?
- javascript - 对javascript对象的一部分进行排序
- angular - Route Guard:如何根据服务器发送的列表使Route Guard为真?
- python - 如何打印一个单词,但在每个新行之后都会添加一个字母
- java - 我的 Jar 是被双击的,还是从命令行启动的?
- c# - 无法隐式转换类型“Microsoft.AspNetCore.Mvc.BadRequestObjectResult”