Dev
搜索

Dev

thinkphp 加载第三方类库
发表于2016-04-10|thinkphp
除了官方的位置 可以用官方函数去实例化 http://document.thinkphp.cn/manual_3_2.html#lib_extend http://document.thinkphp.cn/manual_3_2.html#autoload 其实借助命名空间任何位置都可以的 写好namespace和use就好了 其中, 给第三方类加namespace,就是他的路径,不包括文件名 给需要加载这个类的文件加use,就是他的路径+文件名,文件名和类名同名 这样就可以自动找到这个类啦,使用namespace和use的写法还能在一定程度上降低io  
thinkcmf 几个重要基类
发表于2016-04-07|thinkcmf
AppframeController     —– ThinkCMF框架控件器基类,继承至Controller AdminbaseController   —– ThinkCMF框架后台控件器基类,继承至AppframeController HomebaseController     —– ThinkCMF框架前台控件器基类,继承至AppframeController MemberbaseController —– ThinkCMF框架会员控件器基类,继承至HomebaseController AdminbaseController,找到后台模版,未登录防护HomebaseController,找到前台模版 成员函数:check_login 检查用户登录,未登录error函数报错MemberbaseController,_initialize方法中有检测登录用户登录,并把用户信息放到了user 对象中  
thinkphp mysql 查询 排除字段
发表于2016-04-07|thinkphp
field(‘content’,true) 就会排除content字段
thinkcmf 文章内页
发表于2016-04-07|thinkcmf
内页有很多变量都是可以直接用的 $post_source 文章来源 $post_title 文章题目
thinkcmf sp_sql_post 获取单篇文章信息
发表于2016-04-07|thinkcmf
原文地址: http://www.thinkcmf.com/document/article/id/232.html sp_sql_posts($tag,$where) 功能: 查询文章列表,不做分页 参数: $tag:查询语句(见$tag规则) $where:查询条件,(暂只支持数组),格式和thinkphp where方法一样; 返回信息如下: [pcsh lang=”php” tab_size=”4” message=”” hl_lines=”” provider=”manual”] Array ( [tid] => 3 [object_id] => 3 [term_id] => 1 [listorder] => 0 [status] => 1 [id] =>...
thinkcmf 表单 方法
发表于2016-04-07|thinkcmf
\application\Portal\Controller\AdminPostController.class.php add_post 接收后台post过来的数据,并增加一个文章,其接收的 $_POST[‘smeta’] 是拓展字段 edit 显示后台的编辑文章的iframe
register_shutdown_function php 函数
发表于2016-04-07|php
php脚本即将死掉时会调用这个函数,来调用一个函数用以处理最后的事务
thinkcmf 后台 插件管理 插件方法无法注册 无法显示 的解决方法
发表于2016-04-06|thinkcmf
未做更完整的测试 按以下方法一定可以解决 一定要在hooks.php和hooks.html中都写上这个钩子,否则是不会注册的 而且我实际开发过程发现,这两个貌似都必须同时存在才有效 原文地址: http://www.thinkcmf.com/topic/topic/index/id/399.html
thinkcmf 分页 sp_sql_posts_paged
发表于2016-04-05|thinkcmf
文章分页查询方法 thinkcmf的分页貌似更喜欢放到模版中处理 有一个内置函数sp_sql_posts_paged 原文地址 http://www.thinkcmf.com/document/article/id/258.html sp_sql_posts_paged($tag,$pagesize,$pagetpl) $tag规则: cid 分类id; field 需要取出的内容,默认取出所有信息;order排序方式,可根据任何取出的字段排序,默认为按发布时间排序。 field可选参数: term_id     文章分类id post_author     文章作者id,后台管理员,对应于表users里的ID; post_keywords post_date     文章发布日期 格式2014-01-01 00:00:00 post_content     文章内容 post_title     文章标题 post_excerpt     文章摘要 post_modified     文章更新日期 格式2014-01-01 00:00:00 smeta     文章扩展属性,以...
thinkcmf sp_get_term sp_get_terms获取分类信息
发表于2016-04-04|thinkcmf
sp_get_term 示例 [pcsh lang=”php” tab_size=”4” message=”” hl_lines=”” provider=”manual”] <?php $term_id=1; $term=sp_get_term($term_id ); //获取分类信息 print_r($term); //打印出分类信息 ?> [/pcsh] 返回数组说明: term_id       分类id name      分类名称 taxonomy      分类的类型,用字符串表示,article表示文章 description      分类描述 parent      分类父级id,terms表中的term_id seo_title seo_keywords seo_description list_tpl      分类列表页的模板,对应于模板目录下Portal/文件名+.html,文件名默认为list one_tpl      分类单文章页的模板,对应于模板目录下Porta...
1…656667…104
avatar
developer
AI相伴的开发者博客
文章
1035
标签
742
分类
36
公告
This is my Blog
最新文章
wslc空间清理2026-11-16
Cmder 跟随 Windows 明暗主题2026-10-28
Intel(R) System Usage Report禁用2026-10-18
压力测试2026-10-16
税务学习记录2026-10-13
分类
  • apicloud3
  • bootstrap8
  • cmder1
  • cocos2d-js5
  • createjs17
  • day45
  • docker16
  • egret14
标签
常用 处理大数组 客户端 乌龟 不准 一键安装 laya 时间格式化的方式 微信支付 对象唯一id 移动端上传 解析字符串 过滤目录和子目录下 开启报错 恋爱 自建vpn WSL2 对话的 恢复 dl 函数 go 大量bug记录 补充 apache2.4 禁止 借助云服务 数据类型 mysql_fetch_array Tue Sep 18 2018 08:00:00 GMT+0800 (China Standard Time) 性能差异 max current_user_can wsl gs mysql 不装逼 女人 正确方法 docker
归档
  • 十一月 2026 1
  • 十月 2026 9
  • 八月 2026 1
  • 六月 2026 2
  • 五月 2026 1
  • 四月 2026 2
  • 三月 2026 3
  • 二月 2026 5
网站信息
文章数目 :
1035
最后更新时间 :
© 2025 - 2026 By developer框架 Hexo 8.1.2|主题 Butterfly 5.7.0
搜索
数据加载中