跳至主要内容

博文

相信什么

信任总的有一个人先开始。预测一场已经结束的比赛的比分,那不预测,那叫总结。相信一件已经成为事实的过去的事情,那不叫相信,那只能叫尊重事实。 其实只要是没有发生的事情,只要是未来,选择才变得有意义。在很多重要的时候,其实也就两个选择,信于不信,做与不做。相信很多时候就是有盲目的成分在里面,爱其实便是最大的盲目,很多时候都不是愿意去相信,而是刻意去相信,否则那就没有爱情了,那只有交易。 我愿意去相信,我选择去相信,至于是什么结果,懒得去想了,因为想要的到的东西,只能选择相信才有可能。但愿你也能如此想。

送给小女人

总想为这段时间留下点什么,生怕回过头,它们就悄悄淡去,再也找不到它们存在过得痕迹。人生的很多日子都会这样渐渐远去以至于你都记不起它们存在过,以至于你都开始怀疑它们是否曾经如此的真实。

sql join difference

jquery file upload with symfony2

for use this plugin, install jquery-file-upload in web install punk_ave bundle and this is my example: /** * @Route("/import",name="prospection_admin_import") * @Template() */ public function importAction(){ $fileUploader = $this->get('punk_ave.file_uploader'); $request = $this->getRequest(); $existingFiles=null; $editId = $request->query->get('editId'); if (!$editId){ $editId=$request->getSession()->get('editId'); } if ($editId){ $existingFiles = $fileUploader->getFiles(array('folder' => '/tmp/attachments/'. $editId)); if ($request->getMethod() == 'POST') { $type=$request->request->get("importType"); $importHandler=$this->get('addepi.prospection.import.handler'); $path=$this->get('kernel')->getRootDir()."/../web/uploads/tmp/attachments/".$editId."/originals/"; f...

dynamically change the form presentation

In this article, we discussed how to do it: http://symfony.com/doc/current/cookbook/form/dynamic_form_modification.html I also give my example : public function buildForm(FormBuilderInterface $builder, array $options) { $factory=$builder->getFormFactory(); $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) use ($factory){ // ... add a choice list of friends of the current application user $address = $event->getData(); $form = $event->getForm(); if ($address instanceof Address && $address->getWebSite()!=""){ $url=$address->getWebSite(); }else{ $url= 'http://www.'; } $form->add($factory->createNamed('webSite','url',$url,array( 'required'=> false, 'attr' => array('class' => 'defaultInvalid'), 'label' => 'form.address.label.webSite...