Part time Internet Jobs

on Tuesday, March 24, 2009

Part time Internet Jobs for All

Are you looking to work from Home? Home based typing positions are now being offered by many Companies at present! Receive your paychecks every month!

Full training provided by the company itself. No Selling Required. Please visit the website http://www.earnparttimejobs.com/index.php?id=965520

Disable default Symfony Modules and Errors

on Saturday, March 21, 2009

To disable the default symfony pages like "Symfony Project Created", "Symfony 404 Page Not Found" errors to customized error message, follow the steps

1. In your project root select your application, then open the settings.yml file from config folder.

2. After that enable the selected modules which you want to work, after that edit your settings.yml below .actions as follows.,

default_module: your_module_name

default_action: your_action_name
.
.
.
.etc...

3. After that edit your routing.yml file as just change the default module to your_module_name which is mentioned in settings.yml

4. Now Clear the Cache and run your project. You Won't get any symfony pages and error messages.


Hope you will Enjoy.....! :)



Decimal Values in schema file

on Tuesday, March 17, 2009

If you are defining your schema.yml and have a field that is a decimal value, you will find you will need to somehow pass through the precision (maximum number of digits to the left of the point) and the scale (total number after the decimal point). The documentation for the syntax of this is quite poor.

For all those that want to know, in symfony 1.0 this is how you would define a decimal:

my_decimal: { type: decimal, size: 8,3 }




Symfony: website/backend.php to website/admin

on Monday, March 16, 2009



Here is the solution for rewriting website/backend.php to website/admin and makes the admin area to work.

1. Create a folder "admin" inside "web" folder. Copy here the same .htaccess file and change this line:

RewriteRule ^(.*)$ index.php [QSA,L]

to:

RewriteRule ^(.*)$ ../backend.php [QSA,L]

2. Then go to routing file for backend (app/backend/config/routing.yml) and add folder name to all your routes defined there. Ex:

# default rules
homepage:
url: /admin/
param: { module: default, action: index }
.
.
.

3. Set no_script_name to "on" in your backend settings (app/backend/config/settings.yml) file:

prod:
.settings:
no_script_name: on

4. Clear Cache and now you should be able to get to your backend using: http://mydomian.com/admin/ without problems

Hopes you enjoy...!


Symfony: How to hide the Controller Name in URL

To hide the controller name from the URL, when the project is ready for production. Follow the below steps:

  • set the no_script_name: to on under prod in settings.yml file from your application directory.

  • after that clear the cache.

Now your projects application is ready and your controller name is also hide from the URL.

Symfony Tips and Tricks

on Wednesday, March 11, 2009

How to get visitors redirected to www.yourdomain.com

Sometimes you dont have domain name but you would like to get your symfony project working. For that just place the .htaccess file from web folder to outside of the project root folder. After that edit the .htaccess file as follows.


RewriteEngine On

# uncomment the following line, if you are having trouble
# getting no_script_name to work
#RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

# we skip all files with .something
RewriteCond %{REQUEST_URI} \..+$
RewriteCond %{REQUEST_URI} !\.html$
RewriteRule .* - [L]

# we check if the .html version is here (caching)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f

# no, so we redirect to our front web controller
RewriteRule ^(.*)$ web/index.php [QSA,L]



So, after entering the domain name it will automatically take to the production environment of your project..

Enjoy It...! Have a fun... :)