Category archive

web development

General Posting

82 articles

PHP

How to get symfony project base url in template file

To get the base url of your symfony project , you can use the below in your template file. $sf_request->getUriPrefix().$sf_request->getRelativeUrlRoot() And to get your current app URL. $sf_request->getUriPrefix().$sf_request->getRelativeUrlRoot().$sf_request->getPathInfoPrefix();

Dec 3, 2011

Read article

HTML

integrate window media player in your website

<html> <head></head> <body leftmargin=”0″ topmargin=”0″> <table cellpadding=”0″ cellspacing=”0″ border=”0″> <tr height=”350″><td align=”center”> <table cellpadding=”0″ cellspacing=”0″ border=1 bordercolor=”black”> <tr> <td valign=”top”> <OBJECT ID=”MediaPlayer” WIDTH=”320″ HEIGHT=”290″ CLASSID=”CLSID:22d6f312-b0f6-11d0

Feb 4, 2009

Read article

web development

update query in symphony (Method 2)

For example to execute query like UPDATE tableName SET column1 = ‘abc’,column2 = ‘xyz’ WHERE column =’1′; In symfony you can do it this way $c = new Criteria(); $c->add(MyTablePeer::COLUMN,1); $c->add(MyTablePeer::COLUMN1,’abc’); $c->add(MyTablePeer::COLUMN2,’xyz’); MyTablePeer::doUpdate($c); Thanks

Dec 22, 2008

Read article

web development

Show tooltip on mouseover

Step 1: Copy this css style code into your header tage right before the end of header tag <style type=”text/css”> #dhtmltooltip{ position: absolute; border: 1px solid red; width: 150px; padding: 2px; background-color: lightyellow; visibility: hidden; z-index: 100; filter: progid:DXImageTransform.Microsoft.Shadow(color=

Dec 10, 2008

Read article

web development

update query based on condition

$con = sfContext::getInstance()->getDatabaseConnection(‘propel’); $c2 = new Criteria(); $c2->add(TblTopPeer::TF_ZIPCODE,$topForecastInfo->getForZipcode()); $c2->add(TblTopPeer::TF_FORCASTDATE,$topForecastInfo->getForForecastdate()); $c3 = new Criteria(); $c3->add(TblTopPeer::TF_FID,$topForecastInfo->getForId()); $c3->a

Jun 27, 2008

Read article

web development

How to apply or condition for mysql query in symfony

$cs = new Criteria(); $criterion = $cs->getNewCriterion(HfArticlesPeer::AR_DESCRIPTION,’%’.$searchText.’%’,Criteria::LIKE); $criterion->addOr($cs->getNewCriterion(HfArticlesPeer::AR_TITLE,’%’.$searchText.’%’,Criteria::LIKE)); $criterion1 = $cs->getNewCriterion(HfArticlesPeer::AR_STATUS,’ARCHIVE’,Criteria::EQUAL); $crit

Jun 27, 2008

Read article

web development

No connection params set for propel

When you are using symfony framework , and when you get the error as “No connection params set for propel” ,Do the following changes . In config /databases.yml file Replace all: propel: class: sfPropelDatabase param: datasource: symfony dsn: mysql://root:@localhost/mywebsite with all: propel: class: sfPropelDatabase pa

Apr 5, 2008

Read article

web development

how to create html element dynamically in javascript

var itemManCnt=2; function addMoreHomeImage() { if(itemManCnt==6) { alert(“You can upload only 5 files”); return false; } var parentObj=document.getElementById(‘FileElementItem’); var divClrBoth = document.createElement(“div”); divClrBoth.setAttribute(“class”,”ClrBoth”); divClrBoth.setAttribute(“id”,itemManCnt); var di

Mar 26, 2008

Read article