‘Symfony’ Archives
configure database using propel
$ ./symfony configure:database --name=propel --class=sfPropelDatabase "mysql:host=localhost;dbname=dbname" username userpassword
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();
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', [...]
mysql error while executing propel:insert-sql in symfony 1.4
SQLSTATE: 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 Failed to execute: CREATE TABLE `tblName` ( `id` INTEGER NOT NULL AUTO_INCREMENT, [...]
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 [...]
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 = [...]
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 seperated by [...]
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/" then you have to add the [...]
Latest music . videos and songs
PHP Manual