09 2011 档案
摘要:In the class, add this:$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'prod', true);$context = sfContext::createInstance($configuration);$configuration->loadHelpers('url', 'Partial');then try to call the helplers
阅读全文
摘要:A symfony project is made of one or more applications. Applications share nothing, but the model classes. But sometimes, you need the ability to create links to a frontend application from a backend one. Think about a CMS backend where you want the user to edit an article and then link to the corres
阅读全文
摘要:RSS feeds have become extremely popular over the past couple of years. Previously it was blogs which popularized RSS feeds, but now all major News websites, social networking websites and even forums have started providing RSS feeds. For many people RSS feed readers like Google Reader, Netvibe etc h
阅读全文
摘要:显然:UL+LI在布局上比table灵活得多。比较分两列或者多列显示:table:你需要在服务器上写一大堆代码判断是不是需要换行,或者切分是不是准确DIV:你只需要定义好css,剩下的做事情叫交给浏览器吧。最简单的代码:XML/HTML代码<style type="text/css"> .mycode{ width:300px; height:74px; float:left;} .mycode ul{ width:280px;} .mycode li{ width:100px; float:left; display:block;} </style>
阅读全文
摘要:<script type="text/javascript">function bookmarkPage(url,title) { if (!url) {url = window.location} if (!title) {title = document.title} var browser=navigator.userAgent.toLowerCase(); if (window.sidebar) { // Mozilla, Firefox, Netscape window.sidebar.addPanel(title, url,"")
阅读全文
摘要:There may be times when you want to sort the values inside of an array. For example, suppose your array values are not in alphabetical order. Like this one:$full_name = array();$full_name["Roger"] = "Waters";$full_name["Richard"] = "Wright";$full_name["Ni
阅读全文
摘要:Lets consider sfWidgetFormDoctrineChoice form select object with multiple elements:$this->setWidgets(array('books' => new sfWidgetFormDoctrineChoice(array('model' => 'Book', 'expanded' => true, 'multiple' => true)),));So it will obviously take a
阅读全文
摘要:转自: http://www.thegeekstuff.com/2008/09/backup-and-restore-mysql-database-using-mysqldump/mysqldump is an effective tool to backup MySQL database. It creates a *.sql file with DROP table, CREATE table and INSERT into sql-statements of the source database. To restore the database, execute the *.sql f
阅读全文
摘要:转自: http://mally.stanford.edu/~sr/computing/basic-unix.htmlBasic UNIX commandsNote: not all of these are actually part of UNIX itself, and you maynot find them on all UNIX machines. But they can all be used on turingin essentially the same way, by typing the command and hittingreturn. Note that some
阅读全文
摘要:PHP判断数组为空首选方法:count($arr),size($arr);$arr= array("");echo count($arr);echo size($arr);//输出1$arr= array();echo count($arr);echo size($arr);//输出0PHP判断数组为空方法2:empty($arr);$arr= array("");$result = empty($arr);//$result = false$arr = array();$result = empty($arr);//$result = true这两种方
阅读全文