Which methods did you find, that didn't work {for you}?

How about>

In your database config file add:

        function __construct ()
        {
        if (isset($_SESSION['Database']['Source']))
        {
            $this->default = $this->$_SESSION['Database']['Source'];
        }
        }

And creating a controller such as this to manage changing your data
sources>
<?php
class DatabaseController extends AppController
{
        var $uses = NULL;
   function change($source=NULL)
        {
        if (!$source)
                {
                        $this->redirect($this->referer("/"));
                }
                else
                {
                        $this->Session->write("Database.Source", $source);
                        $this->redirect($this->referer("/"));
                }
        }
}
?>

Cheers,

AD7six


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to