Look at the values in $this->params (it's an array with all the parameters passed to the controller). If selenium is always the last parameter, you could check that, or you could just do:
if(in_array('selenium', $this->params) { $this->useDbConfig='selenium'; } HTH! hydra12 On Jan 19, 11:58 pm, Steve Boyd <[EMAIL PROTECTED]> wrote: > Hey I'm wanting to use Selenium to do some functional testing and want > to use a separate database its own test data (essentially using this > database as a group of fixtures) > > I wanting use my urls like : /:controller/:action/:id/selenium > > idea being that when /selenium is present then my app => $useDbConfig > = 'selenium', otherwise just use 'default' > > currently i can get it to work with an exceptionally ugly hack from > within my parent model (all my other models extend this one) > > class TestableAppModel extends AppModel { > > function TestableAppModel() { > if > (preg_match('/\/selenium$/',$_SERVER['REQUEST_URI'])) { > $this->useDbConfig = 'selenium'; > } > $this->AppModel(); > } > > Anyone know of a nicer way to do this? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---