Category archive

Symfony

Post related to symfony framework

11 articles

CMS

Set widget label from action file in symfony 1.4

In Action File ========================================================== $this->form = new youFormclassname(); To set individual Label $this->form->getWidget(‘widgetname’)->setLabel(‘widget Custom label’); To set multiple field label $this->form->getWidgetSchema()->setLabels(array( ‘field_name_1’ => ‘Field 1 Custom La

Aug 31, 2012

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

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

Symfony

How to use FCKeditor in symfony

1. Download the FCKeditor source from http://ckeditor.com/download 2. Extract the source to /web/js/ directory of your symfony project directory 3. To use the editor in symfony, add (edit if present)the below line //config/settings.yml .settings: rich_text_fck_js_dir: js/fckeditor 4. You have to edit /web/js/fckeditor/

Dec 25, 2009

Read article

Symfony

Update query in symfony

Suppose you want to execute query like UPDATE tableName SET column1 = ‘abc’,column2 = ‘xyz’ WHERE column =’1′; then you can use the below syntax to do so 🙂 —————————————————————————- $con = Propel::getConnection(); /* Here you have to set the condition for which you need to update */ $c1 = new Criteria(); $c1->add(Tab

Dec 11, 2009

Read article

Symfony

How to set the meta tag information intemplate file in symfony

You can set the meta tag information in your template file as below. sfContext::getInstance()->getResponse()->setTitle(‘Your meta title here’); sfContext::getInstance()->getResponse()->addMeta(‘description’,’ Meta description information’); sfContext::getInstance()->getResponse()->addMeta(‘keywords’,’meta tag keywords

Oct 25, 2009

Read article

htaccess Setting

How to configure the symfony project directory

Your symfony project derectory is “/var/www/html/sf_sandbox” so in the browser you can acess this by this URL : “http://localhost/sf_sandbox/web/frontend.php/” So if you want to map the symfony project directoy to your web root directory ie i mean to say you just want to acess it my using the URL :”http://localhost/” t

Apr 22, 2009

Read article