2025-05-29 技术 hexo默认处理heading的标题为id的异常解决方案 hexo在处理markdown文档的时候,默认将heading的内容作为了id来处理锚点,如果是英文是没有问题的。 1## 我的标题 处理后的html内容 1<h2 id="我的标题"><a href="#我的标题" class="headerlink" title="我的标题"><... 阅读全文…
2025-05-29 技术 Yii简单的基于角色的访问控制 123456789101112131415161718192021function filters(){ return [ 'accessControl', // perform access control for CRUD operations ];}function accessRules(){ retu... 阅读全文…
2025-05-29 技术 Yii扩展类可以放在extensions目录下面 下面举个例子: 如果我想写个截取字符串长度的函数功能,可以在extensions目录下面新建一个文件,命名为Helper.php 代码如下: 123456789101112131415161718192021222324252627<?phpclass Helper extends CController{ public static function truncate... 阅读全文…
2025-05-29 技术 Yii中urlManager的配置 第一步: 在main.php配置文件的component域中添加urlManager模块,并加入urlrules. 引入rule文件,代码如下 123456789$urls = include(dirname(__FILE__) . '/urlrules.php');urlManager配置修改如下'urlManager'=>array( ... 阅读全文…
2025-05-29 技术 ubuntu和centos的时间更新操作 在Ubuntu Server上,设置NTP时间同步非常简单,就如下几步: 第一,可以先进行手动更新一次时间(可选): sudo ntpdate ntp.ubuntu.com 第二,创建一个定时执行的文件: sudo vim /etc/cron.daily/ntpdate 然后在其中添加一行:ntpdate ntp.ubuntu.com,保存退出。 第三,修改这个定时执行文件的权限,使其变成可... 阅读全文…
2025-05-28 技术 Hello World Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Qu... 阅读全文…