代码改变世界

随笔分类 -  web---php框架

php二维数组搜索

2017-04-26 03:04 by youxin, 2110 阅读, 收藏, 编辑
摘要: $ar = array( 2 => array( 'catid' => 2, 'catdir' => 'notice', ), 5 => array( 'catid' => 5, 'catdir' => 'subject', ), 6=> array( 'catid' => 阅读全文

yii2发送邮件

2015-05-14 00:44 by youxin, 198 阅读, 收藏, 编辑
摘要: http://segmentfault.com/q/1010000000745374http://blog.csdn.net/xundh/article/details/45270407 阅读全文

mysql lock

2015-05-11 23:27 by youxin, 224 阅读, 收藏, 编辑
摘要: http://blog.chinaunix.net/uid-21505614-id-289450.htmlhttp://bbs.csdn.net/topics/340127237http://www.cnblogs.com/winner/archive/2011/11/09/2242272.html... 阅读全文

yii2引入js和css

2015-05-11 17:30 by youxin, 1400 阅读, 收藏, 编辑
摘要: assets/AppAsset.phppublic $css = [ 'css/site.css', 'css/font/css/font-awesome.min.css', 'css/doc.css',];public $js = [ 'js/core/app.js',];... 阅读全文

Yii 2.x 和1.x区别以及yii2.0安装

2015-05-10 20:07 by youxin, 824 阅读, 收藏, 编辑
摘要: 知乎上有个类似的问题:http://www.zhihu.com/question/22924271/answer/23085751大致思路不会变,开发流程变化也不是很大。有变化的是1、yii2带入的PHP5.4的特性,引入了namespace解决命名冲突,因此基类不会再C字开头了2、不再所有类都继承... 阅读全文

laravel queue队列使用

2015-01-06 20:52 by youxin, 14674 阅读, 收藏, 编辑
摘要: 一篇文章:laravel中的队列服务跟其他队列服务也没有什么不同,都是最符合人类思维的最简单最普遍的流程:有一个地方存放队列信息,一个PHP进程在运行时将任务写入,另外一个PHP守护进程轮询队列信息,将达到执行要求的任务执行并删除。由于PHP是url驱动的同步语言,本身是阻塞的,所以laravel提... 阅读全文

laravel command命令行

2014-12-29 13:14 by youxin, 3073 阅读, 收藏, 编辑
摘要: 生成类为了创建一个新命令,你可以使用Artisan中的command:make命令生成一个骨架作为你的起点:生成一个命令类php artisan command:make FooCommand默认情况下,生成的类文件被存放在app/commands目录下,同时你也可以指定自定义目录和命名空间:php... 阅读全文

laravel相关插件

2014-12-26 19:18 by youxin, 292 阅读, 收藏, 编辑
摘要: 1.Laravel-4-GeneratorsRapidly speed up your Laravel workflow with generatorshttps://packagist.org/packages/way/generatorshttp://lvwenhan.com/laravel/3... 阅读全文

php库Faker

2014-09-22 21:14 by youxin, 2092 阅读, 收藏, 编辑
摘要: FakerLicense : MITSource CodeAllo点评:Faker是一个很神奇的项目,会自动生成拟真的数据,包括用户资料、长文本、IP、日期等等,在网站上线前测试时非常好用。github地址:https://github.com/fzaninotto/Faker基本使用:UseFak... 阅读全文

php-resque 任务队列

2014-09-22 19:34 by youxin, 1696 阅读, 收藏, 编辑
摘要: php-resqueLicense : MITSource CodeAllo点评:php-resque是Ruby项目resque在php下的实现。虽然Gearman也是一个不错的选择,但是resque的构架设计更加简洁清晰,更加符合KISS原则。简单用法可以参看用PHP实现守护进程任务后台运行与多线... 阅读全文

API设计

2014-09-15 21:33 by youxin, 208 阅读, 收藏, 编辑
摘要: ---恢复内容开始---参考:http://www.cnblogs.com/youxin/p/3967274.htmlhttp://scotch.io/tutorials/simple-laravel-crud-with-resource-controllershttp://www.tuicool.... 阅读全文

laravel url管理与使用

2014-09-13 20:59 by youxin, 4599 阅读, 收藏, 编辑
摘要: 获取当前URL获取当前URL有两种方式,URL::current()或URL::full(),区别是返不返回GET参数如Route::get('/current/url',function(){returnURL::current();});输入/current/url?foo=bar时只显示htt... 阅读全文

laravel Restful

2014-09-11 21:30 by youxin, 388 阅读, 收藏, 编辑
摘要: 参考:http://www.cnblogs.com/youxin/p/3967274.htmlhttp://scotch.io/tutorials/simple-laravel-crud-with-resource-controllershttp://www.tuicool.com/articles... 阅读全文

laravel速记(笔记)

2014-09-11 21:25 by youxin, 759 阅读, 收藏, 编辑
摘要: 命令行:php artisan controller:make UserControllerThis will generate the controller at /app/controller/user.php and user.php. php artisan db:seed --class=... 阅读全文

laravel本地化

2014-09-11 21:20 by youxin, 220 阅读, 收藏, 编辑
摘要: 参考:<laravel development cookbook》 阅读全文

laravel加载javascript库

2014-09-11 21:05 by youxin, 988 阅读, 收藏, 编辑
摘要: 一篇文章:Generating a Link to a Javascript FileProblemYou want your Blade template to load an external javascript file.Instead of usingIf the file path yo... 阅读全文

laravel安装第三方包3rd generators

2014-09-11 21:03 by youxin, 331 阅读, 收藏, 编辑
摘要: 参考:http://laravel-recipes.com/recipes/116 阅读全文

YII数据库操作中打印sql

2014-08-26 11:05 by youxin, 705 阅读, 收藏, 编辑
摘要: 配置如下:'components' => array( 'db'=>array( 'enableParamLogging' => true, ), 'log'=>array( 'class'=>'CLogRouter', 'routes'=>array( arra... 阅读全文

Yii cookie操作

2014-08-14 18:41 by youxin, 278 阅读, 收藏, 编辑
摘要: 设置cookie:$cookie=newCHttpCookie('mycookie','this is my cookie');$cookie->expire=time()+60*60*24*30;//有限期30天Yii::app()->request->cookies['mycookie']=$c... 阅读全文

PHP session过期时间

2014-08-14 09:58 by youxin, 745 阅读, 收藏, 编辑
摘要: 如何设置一个严格30分钟过期的Session今天在我的微博(Laruence)上发出一个问题:我在面试的时候, 经常会问一个问题: “如何设置一个30分钟过期的Session?”, 大家不要觉得看似简单, 这里面包含的知识挺多, 特别适合考察基本功是否扎实, 谁来回答试试? 呵呵为什么问这个问题呢?... 阅读全文
点击右上角即可分享
微信分享提示