- 博客(41)
- 资源 (1)
- 收藏
- 关注
原创 symfony security 登录后user session取值
This is a very simple snippet of getting the user that is currently logged in that can become very helpful and make your code much clearer.[code="java"]/** * Get the current logged in User Obj...
2013-10-23 10:17:13
210
转载 Predis的一些操作汇总
//使用autoload加载相关库,这边重点就是为了require $file;spl_autoload_register(function($class) { $file = __DIR__.'/lib/Predis/'.$class.'.php'; if (file_exists($file)) { require $file; return
2013-03-06 10:07:03
4484
转载 Jquery选择器
1. 基础选择器 Basics名称说明举例#id根据元素Id选择$("divId") 选择ID为divId的元素element根据元素的名称选择,$("a") 选择所有元素.class根据元素的css类选择$(".bgRed") 选择所用CSS类为bgRed的元素*选择所有元素$("*")选择页
2012-12-06 14:45:03
315
转载 Symfony全局变量设定
In order to use variables in a Symfony2 controller, you’ll have to set them up inparameters.ini, or in any other ini file on condition that you’ll import it intoconfig.yml.In case you want to us
2012-11-08 13:27:07
1740
转载 predis出现permission denied的解决方法
/usr/sbin/setsebool httpd_can_network_connect=1 By default, SELinux does not allow Apache to make socket connections.
2012-10-26 11:05:53
695
转载 Symfony2 createQuery中参数模糊查询
$em = $this->getDoctrine()->getEntityManager(); $query = $em->createQuery( 'SELECT u.user1lname FROM MySiteMyBundle:User u WHERE u.user1lname LIKE :searchTerm ORDER BY u.user1lname ASC'
2012-10-10 15:00:13
1851
转载 IE onclick事件失效的解决
IE 莫名其妙的onclick事件失效查找了很长时间,发现一个解决方法原来test()方法写成fntest()就可以用了不要问为什么。。。我也不知道。。。
2012-09-12 12:37:22
5413
3
转载 Symfony form里创建Radio框
->add('presentor_id','choice',array( 'choices'=>array( '1'=>'我自己', '2'=>'其他人', ), 'expanded'
2012-09-11 11:13:25
591
转载 jquery操作iframe的方法:父页面和子页面相互操作的方法
今天在弄jquery操作iframe中元素:先由iframe中的子页面b.html给外面的父页面a.html页面传值,再将a.html页面计算机的值放到b.html页面上,这里就用到子页面和父页面相互传值,相互调用更自函数这些功能,这里我用一个简单的例子来介绍一下这些方法。a.htmlfunction f(){ $('#a').contents().find("#bbb").val
2012-09-03 13:52:52
25782
转载 Symfony2 表单项添加onclick事件
->add('file','file',array('attr' => array('onclick'=>'upload_image()'))) 使用attr属性,并且attr后面的值一定要是数组
2012-08-31 11:23:06
704
转载 Twig中path()加参数的写法
How to add more than one parameter in Twig path? Say you have this route:article_show: pattern: /article/{slug} defaults: { _controller: AcmeArticleBundle:Article:show }you can do this i
2012-08-30 15:32:05
3386
1
原创 symfony2中doctrine的数据类型
[quote] const TARRAY = 'array'; const SIMPLE_ARRAY = 'simple_array'; const JSON_ARRAY = 'json_array'; const BIGINT = 'bigint'; const BOOLEAN = 'boolean'; const DATETIME =...
2012-08-27 11:46:47
208
原创 apache 403问题
一个是修改权限chcon -R -t httpd_sys_content_t /var/www/websites还有一个是 /etc/init.d/httpd/conf/httpd.conf中<Files ~ "^\.ht"> Order allow,deny Dent from all Satisfy All</Files> ...
2012-08-10 16:36:14
97
原创 centos 不能make的时候
在centos 6下安装软件遇到的问题 因为系统没有安装编译器解决办法,在SSH下输入下面的命令yum -y install gcc automake autoconf libtool make
2012-08-10 16:15:22
118
原创 symfony2.1安装出现的问题解决
安装symfony2.0如果php composer.phar create-project symfony/framework-standard-edition path/无法执行,报git命令不执行Msys-cn是Msys的中文化项目,托管在Google Code上,里面提供了一个软件包管理器mpkg,同时提供了一系列实用工具,其中就包括git。msys-cn的主页:http://...
2012-08-09 14:46:14
99
原创 rails 3.2.6执行rake 数据库报错activerecord-mysql-adapt
gem uninstall mysql2gem install mysql2 -v=0.2.6
2012-08-02 14:05:00
94
原创 localhost改为本机IP地址的文件路径
需要修改sys的hosts文件windows系统C:\WINDOWS\system32\drivers\etc\hostslinux系统一般都在/etc/hosts
2012-08-02 14:00:05
2235
2
原创 JS时间戳的处理
转自:http://wyoojune.blog.163.com/blog/static/57093325201131193650725/ 这个在php+mssql(日期类型为datetime)+ajax的时候才能用到,js需要把时间戳转为为普通格式,一般的情况下可能用不到<script> function getLocalTime(nS) { ...
2012-06-12 16:05:06
112
原创 Ruby 时间处理
#获取当前的时间today = Time.new;puts "当前日期:" + today.strftime("%Y-%m-%d %H:%M:%S");#采用格式化输出#获取指定日期的时间 如 2010-08-30 20:50:01day = Time.local(2010, 8 , 30 , 20, 50, 1);puts "指定日期:" + day.strftime...
2012-05-30 15:37:37
116
原创 关于APEX使用AJAX出现session的错误
关于APEX使用AJAX出现session的错误使用 <script type="text/javascript">var __sfdcSessionId = '{!GETSESSIONID()}';</script> 即可
2012-05-07 10:03:15
141
原创 两台机器对拷mysql数据库
shell> mysqladmin -h other_hostname -u username -p create db_nameshell> mysqldump -h local_host -u username -p local_db_name | mysql -h other_hostname -u username -p db_name
2012-04-10 10:58:39
287
原创 关于ruby脚本连接远程数据库并且修改密码
#!/usr/bin/env rubyrequire 'rubygems'require 'md5'require 'pg'puts "请输入您的Email"email = getsputs "请输入您的新密码"password = getspassword = Digest::MD5.hexdigest("--#{password.chop}--")...
2012-03-28 10:47:24
153
原创 postgresql源码包的安装
liunx环境下源码安装PostgreSQL+PostGIS 1.软件准备 操作系统版本 CentOS5.5 源代码包 postgresql-9.0.2 postgis-1.5.2 proj-4.7.0 geos-3.2.2 libxml2-2.6.26 2.软件安...
2012-03-27 16:23:41
173
原创 Ubuntn11.10换经典桌面的方法
11.10已经删除了GNOME2,Unity非常不好用sudo apt-get install gnome-shell来安装GNOME
2012-03-25 10:28:05
59
原创 硬盘坏道修复
硬盘坏道太多,用HD TUNE检测5M,测出了0.5%的红点后来下载了HDD Regenerator进行修复,效果不错,再次使用HD TUNE检测5M,已经没有红点了
2012-03-24 09:19:40
101
原创 我喜欢的数据库语句
1.清除整个表的内容 TRUNCATE TABLE 表名2.清空字段所有数据 UPDATE 表明 SET 字段名 = null 持续更新中~
2012-03-22 16:14:52
88
原创 Ubuntn11.10安装firefox11.0为英文的解决方法
打开网页http://releases.mozilla.org/pub/mozilla.org/firefox/releases从列表中选择相应的版本,如选择4.0b9,然后选择linux-i686,选择xpi,单击zh-CN.xpi会弹出安装语言包提示,安装完成后聚会变为中文。...
2012-03-17 01:11:43
68
原创 关于用rake db:migrate删除数据表中多余字段
使用rake db:migrate:down VERSION=XXXXXXXXXXXXX为迁移表号
2012-03-13 09:29:11
93
原创 visurlfoce的官方文档
http://www.salesforce.com/us/developer/docs/pages/index.htm
2012-03-06 13:11:02
95
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人