Symfony 1.4 generate url for current application and environment
$sf_request->getUriPrefix().$sf_request->getRelativeUrlRoot().$sf_request->getPathInfoPrefix()
Read articleLatest
$sf_request->getUriPrefix().$sf_request->getRelativeUrlRoot().$sf_request->getPathInfoPrefix()
Read articleIf you want to have custom templates for your node. You can create templates specific to node ID as follows. Add the below function in your template.php if its not exists. function yourcurrentthemename_preprocess_node(&$vars, $hook) { $node = $vars[‘node’]; $vars[‘template_file’] = ‘node-‘. $node->nid; } If the functio
Read articleIf any of your html element is getting hide behind the flash object such as youtube video player, or any flash player/object Then you should call this function on body load. function fix_flash_z_index() { // loop through every embed tag on the site var embeds = document.getElementsByTagName(’embed’); for (i = 0; i
Read article$sf_request->getUriPrefix().$sf_request->getRelativeUrlRoot().$sf_request->getPathInfoPrefix(); In symfony version 1.4 $request->getUriPrefix().$request->getRelativeUrlRoot().$request->getPathInfoPrefix();
Read article$ ./symfony configure:database –name=propel –class=sfPropelDatabase “mysql:host=localhost;dbname=dbname” username userpassword
Read articleIf you want to get the option list of the content type that you have created , then you can get the list as follows: $content_field = content_fields(‘whatever_the_field_name_is’); $allowed_values = content_allowed_values($content_field); So the $allowed_values will give you the array of the option list with the key val
Read articleWhenever you create any content type in drupal ( version 6 and above) and you required a filed of type select list, then you can provide the allowed values of the select option in two ways CASE 1 : option 1 option 2 option 3 CASE 2 : 1|option 1 2|option 2 3|option 3 Each […]
Read articleIf you want to replace multiple space with single space from a string you can use preg_replace function for this. Refer the below example preg_replace(“!\s+!”,” “,$yourstring); For example $yourstring = “This contain space”; $modifiedString = preg_replace(“!\s+!”,” “,$yourstring); echo $modifiedString; // This contain
Read articleTo 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();
Read articleFor Example : SELECT tbl1.id FROM tbl1 a LEFT JOIN tbl1 b ON a.somecolumnname = b.somecolumn ORDER BY a.somecolumn DESC The criteria would be as follow $c=new Criteria(); $c->addAlias(‘a’, ‘tbl1’); $c->addAlias(‘b’, ‘tbl1’); $c->addSelectColumn(‘b.id’); $c->addSelectColumn(‘a.tbl1_id’); $c->addDescendingOrderByColumn(‘
Read articleHacktivist group Anonymous, which has been responsible for cyber-attacks on the Pentagon, News Corp, and others, has vowed to destroy Facebook on November 5th (which should ring a bell). Citing privacy concerns and the difficulty involved in deleting a Facebook account, Anonymous hopes to “kill Facebook,” the “medium o
Read articleOptions +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L]
Read article