How to Change the Database Schema for Symfony

11 January 2012
  1. Use phpMyadmin to change your database schema (the structure of your database).
  2. Change the schema.yml file to reflect the changes you made in the database in phpMyadmin
    • file can be found in: /config/doctrine/schema.yml

  3. Regenerate the Symfony model classes.

    • Symfony is going to use your schema file and generate classes based on your database tables.
    • The command to use in command prompt is:
      ./symfony doctrine:build --all-classes
    • Clear your cache:
      ./symfony cc 

How to use Mind Maps for Exam Success

19 October 2011

The study techniques mentioned in this article in the ACCA’s (the Association of Chartered Certified Accountants) E-Magazine are simply amazing. Check it out on the ACCA’s website, How to use Mind Maps for Exam Success

How to Create a Page for your Website Using Symfony

19 October 2011
  1. Update the “routing.yml” file found in (apps/frontend/config/routing.yml) with the correct URL and Param (module and action).
  2. Create a folder inside the modules (apps/frontend/modules/) folder and name it whatever you want the module to be called.
  3. Create an “actions” folder and “templates” folder inside the module folder you just created.
    • Example: apps/frontend/modules/page/actions or apps/frontend/modules/page/templates. In this example “page” is our module folder.
  4. Create an “actions.class.php” file and save it inside the “actions” folder in the module folder it belongs to.
    1. Create a class, name it after the module. i.e. if module name is “page”, class will be as follows:
      • class pageActions extends sfActions{}
    2. Create functions inside the newly created class. The function names must begin with “execute” followed by the name of the template you created that associates with the action.
      • For example: We created a template called “indexSuccess.php” so the corresponding function will be:
        • public function executeIndex(sfWebRequest $request){}
  5. Create an “indexSuccess.php” file and save it inside the “templates” folder in the module folder it belongs to.
    1. This will be the homepage, so input any PHP or HTML necessary for your homepage.
    2. When saving your template remember to name it according to which function action it belongs to in your actions class.
      • For example: We created a function called “executeIndex” in our “actions.class.php” file that’s saved in the actions folder. So we will name our file, “index” for the function action followed by Success (all templates will have the word “Success” as the second word).
        • “indexSuccess.php”

How to Set up a New Instance of Symfony

18 October 2011
  1. DNS -Domain Name System
    1. Set up DNSĀ  to recognize “finder”(this is whatever name you want your domain to be) as a domain name.
    2. Point your host to your local machine.
      • where to find the host file: c:\windows\system32\drivers\etc\hosts
  2. Set-up Apache to handle the host
    1. Edit the “httpd.conf” file and add the virtual host.
    2. Restart Apache.
  3. Create a Database
    1. Create a database using whatever tool you are comfortable with; I use phpMyAdmin
    2. Create a user to access your database.
    3. Grant permission rights to the user so that they can access the database.
  4. Set up Symfony
    1. Download symfony from the symfony website; http://www.symfony-project.org/
    2. Edit the “databases.yml” file that comes with the download (found in: /config/databases.yml) with the dsn, username, and password details for your domain.