JustAskVin Insights

Ideas for leading and building technology well.

Practical writing on delivery, architecture, CMS migrations, digital growth, and the decisions that shape strong web experiences.

Latest

Page 10 of recent writing

All insights home →

PHP

Replace multiple space with single space in PHP

If 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

Dec 14, 2011

Read article

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

MVC

Self join criteria in symfony

For 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(‘

Nov 21, 2011

Read article

General

Who is Anna Hazare ?

1. Who is Anna Hazare? An ex-army man. Fought 1965 Indo-Pak War 2. What’s so special about him? He built a village Ralegaon Siddhi in Ahamad Nagar district, Maharashtra 3. So what? This village is a self-sustained model village. Energy is produced in the village itself from solar power, biofuel and wind mills. In 1975,

Apr 8, 2011

Read article

Symfony

mysql error while executing propel:insert-sql in symfony 1.4

[propel-sql-exec] SQLSTATE[42000]: Syntax error or access violation: 106 you have an error in your SQL syntax; check the manual that corresponds to you server version for the right syntax to use near ‘Type=InnoDB’ at line 16 >> propel Running “insert-sql” phing task [propel-sql-exec] Failed to execute: CREATE TABLE `tb

Feb 26, 2011

Read article