Hi Alex,
CakePHP can certainly do what you want. I'm toying with a report tool
for web registrations on a few dozen websites. Since I'll add
databases and tables on the fly, I have to determine what database,
table, and fields to use at run-time. Ended up wading through the core
and found that if you look through the API, you'll find everything you
need.
Dig through this Google Group for topics like model-less controller
and set Source. Look into the model class and the datasource class in
the Cake API. Everything you need will be located in there. Also, look
at Cake's built-in scaffolding. Lots of tricks in there.
Here's a quick sketch of what I'm using to start up a generic model:
<?php
class Registrant extends AppModel {
var $name = 'Registrant';
function __construct($id = false, $table = null, $ds = null) {
$table = $_SESSION['tableName']; // Can't call SessionHelper yet
$this->setSource($table);
parent::__construct($id,$table,$ds);
}
}
?>
Then in the controller:
<?php
class RegistrantController extends AppController {
function change_table($name = null) {
$this->Session->write('tableName',$name);
$this->redirect('/registrants/');
}
}
?>
This allows me to work on whatever table I wish using a generic
registrants model. If any other Cakers have simpler solutions, I'd
love to hear them.
Cheers,
Tyler Rooney
On Nov 23, 7:11 am, "alex.tomes" <[EMAIL PROTECTED]> wrote:
> Don't get me wrong, I love cake, I just wanted to use it for this app
> also, but maybe I nead something with a lack of model. Thank you for
> your advice. :)
>
> On Nov 23, 1:16 pm, AD7six <[EMAIL PROTECTED]> wrote:
>
>
>
> > If you want to use CI, that's your choice. Perhaps the more fluid
> > (lack of) structure in the model arena will better suit what you want
> > to do.
>
> > Personally I'm always suspicious as to the motivation of messages
> > which sound a bit "if I can't do x with cake, I'll do it with CI/other
> > framework/just php". Especially when it's something you can do with
> > whatever framework (or not) you choose. <- hint.
>
> > However, you have to do some thinking for yourself ;).
>
> > AD- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---