08 2011 档案
摘要:<a href="Javascript:window.history.go(-1)">返回上一页</a><a onclick="window.location.href='list.php'">跳转到list.php</a>
阅读全文
摘要:Some times, when you work with symfony forms in this way:<form action="<?php echo url_for('@sf_guard_signin') ?>" method="post"> <?php echo $form['username']->renderLabel(); ?> <?php echo $form['username']; ?> <?php echo $form
阅读全文
摘要:routing.ymlindex_offer: url: /offer/index/page/:page param: { module: offers, action: index, page: 1} #set default value of page to 1actions.class.phppublic function preExecute() { $culture = $this->getUser()->getCulture(); $siteSectionId = SiteSectionTable::getS...
阅读全文
摘要:routing.ymlfacebook_contest: url:/facebook/f param: { module: sfGuardRegister, action: facebook }app.ymlall: facebook: appid:203549026375001 appsecret: 0321a3ee6737a28b15366d3575f7ac93 #channel_url: http://studiosm.fr.dev/channel.html perms: offline_access,email,publ...
阅读全文
摘要:由于长期慢性劳损,颈椎病的发病年龄已经从40岁提前到30岁,并成为名副其实的白领职业病。更让人担心的是,颈椎上承头颅,下接躯干,既是脊椎中活动最多部位,也是神经中枢最重要部位,更是心脑血管的必经之路,一旦发生故障,后果严重。
阅读全文
摘要:转自: http://www.odino.org/281/incorrect-options-values-in-the-sfwidgetformdateThe cool stuff about sfWidgetForm[I18n]Date is that, obviously, you can specify which options' values should be included in the 3 selects rendering days, months and years.For example, to specify custom years:new sfWidge
阅读全文
摘要:sfGuardTestFunctional class under /libclass sfGuardTestFunctional extends sfTestFunctional{ public function signin($username, $password) { return $this-> info(sprintf('Signin user using username "%s" and password "%s"', $username, $password))-> click('Signin'
阅读全文
摘要:转自: http://en.wikipedia.org/wiki/List_of_HTTP_status_codesList of HTTP status codesThe following is a list of HyperText Transfer Protocol (HTTP) response status codes. This includes codes from IETF in...
阅读全文
摘要:Sometimes it is not as straightforward as one may think to get the current url to use it inside your application. Here is a snippet that I use to fetch the current URL and use it in a script. The current url (whether http or https) is now a local variable that you can do with as you please.$url = (!
阅读全文
摘要:几个巨牛的网站:作web开发要是不知道它们,那想做出nb的网站估计困难!960grid:http://960.gs/ 它把网页设定为960帧,分为12个columns.typekit:http://typekit.com/libraries/full 设置相关字体,可以把喜欢的字体下载到本地cufon:http://cufon.shoqolate.com/generate/ 用javascript设定特殊字体RSS 订阅: http://www.feedsky.com/Top 10 Free Tools to Create RSS for Any Websitejs: http://www.d
阅读全文
摘要:$returnUrl = rawurlencode(base64_encode($returnUrl)); //编码 $returnUrl = parse_str(base64_decode($returnUrl));//解码 或者$returnUrl = base64_decode($returnUrl);//解码//或者//不知道为何, 上面第一种解码方式返回的是null, 求解$returnUrl = base64_encode($returnUrl); //编码$returnUrl = base64_decode($returnUrl);//解码 这是一种方式,但...
阅读全文
摘要:转自: http://www.yslow.net/show.php?tid=447像有些搜索框中会显示“在这里输入要搜索的东西”,鼠标点击那个搜索框后,那些字就没有了, 鼠标点击页面其它地方后,搜索框里的文字又出现。<input value="请输入关键字" onfocus="if (value =='请输入关键字'){value =''}" onblur="if (value ==''){value='请输入关键字'}" />如果更换为以下的代码,鼠标伸过去
阅读全文
摘要:See Michael Feathers' definitionA test is not a unit test if:It talks to the databaseIt communicates across the networkIt touches the file systemIt can't run at the same time as any of your other unit testsYou have to do special things to your environment (such as editingconfig files) to run
阅读全文
摘要:原文: http://rndm-snippets.blogspot.com/2010/10/using-urlfor-in-action-symfony.htmlIn an symfony template you can get the base url of the application with:url_for('@homepage', true); Using this code in an action causes:Fatal error: Call to undefined function url_for() in ...In an action this c
阅读全文
摘要:原地址: http://www.symfony-project.org/jobeet/1_2/Doctrine/en/05#chapter_05_object_route_class
阅读全文
摘要:转自: http://www.cnblogs.com/jarodzz/archive/2011/03/28/1997366.html测试驱动开发(Test Driven Development, TDD)的想法来自于极限编程(Extreme Programming,XP)。XP始于1999年,以测试为先为理念。XP一开始不温不火,可后来有了Junit,一下子就家喻户晓了。坊间传言,Junit是Kent Beck和Eric Gamma两位大牛在飞机上无聊了写着玩儿弄出来的。当然,倘是在中国春运的慢车上写的,那敬仰他们的人会更多。有了Junit,原来XP的理念才可以有的放矢。到了03年,XP的测试
阅读全文
摘要:转自: http://www.cnblogs.com/jarodzz/archive/2011/03/21/1989890.html推行并实施行为驱动开发(Behavior Driven Development, BDD)已有三周。(行为驱动开发,即在编写产品代码前,先将产品功能描述成功能点(Feature),再对其间的步骤进行实现。在代码完成后,用事先写好的Feature对其功能进行验证。我们使用的Feature描述工具是Cucumber,对Cucumber不了解的人,可以先跳到最后,我写了一个简单的例子,说明Cucumber的工作方式。行为驱动开发的好处,可以参考前文)第一周。整天拿着笔记
阅读全文
摘要:转自: http://www.cnblogs.com/jarodzz/archive/2011/03/16/1986551.html上上个周四,我在组里做了个内部演讲,题目是“使用Cucumber实现行为驱动开发”。考虑到组内成员并不系统的敏捷背景,我是从历史开始的。扯软件开发的历史是我最喜欢的项目之一,大部分搞软件的读书读到历史基本都跳过去,我却很喜欢看看那些过往的小故事。所以每次跟人聊起来,我都尽量吹他个昏天黑地,反正也没人知道对错。我所介绍的软件开发的历史主线如下:1956年,缺陷(Bug)这个概念产生,寻找缺陷的过程包括了测试和调试两部分;1979年,测试与调试分离,Glenford
阅读全文