1. If you are not going to reuse the app or no one other than you is
going to modify the site settings like EMAIL, MAX_ITEMS etc its better
to have a seperate table in DB and MVC for that. And in the controllers
you are going to use those constants, fetch those data in the before
filter of the controller. Let me show u an example :


<?php
class UsersController extends AppController
{
var $name = 'Users';
var $layout = "admin";
var $clientmail;
var $clientName;
var $domainName;
var $pageTitle;
var $components = array('Mails','Email');

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//Controller Startup Functions
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function beforeFilter()
{
        $this->pageTitle  =
$this->Settings->getPageTitle()."&nbsp;:&nbsp;".$this->name;
        $this->clientmail = $this->Settings->getWebmasterEmail();
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
//Admin Functions
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

....

~~~~~~~~~~~~~~~~~~~~~
<?php
class SettingsComponent extends Object
{
        var $controller = true;
        var $siteSettings;
    function startup (&$controller) {
        $this->controller = &$controller;
                $Setting = new Setting;
                $this->siteSettings = $Setting->findById(1);
    }
        function getPageTitle(){
                $Setting = new Setting;
                $siteSettings = $Setting->findById(1);
                return $siteSettings['Setting']['title'];
        }
        function getWebmasterEmail(){
                $Setting = new Setting;
                $siteSettings = $Setting->findById(1);
                return $siteSettings['Setting']['webMasterEmail'];
        }
....


But there might be more elegant way though but the above works he he.

2. Scaffolding is just scaffolding only, not meant for production use.
As mentioned by woodman use bake to create the code and then customize.

Good Luck!!! and happy baking :)
Suman


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to