There are various approaches.
One is to create a view called default_index.ctp, which refers to
generic names, i.e $mainModel, or something similar.
Then in your controllers, make sure you pass the data in a similar
format to the view, with the correct generic names, i.e
$this->set('mainModel','User');
Then, force the controllers to render the default view with $this-
>render('viewPath').
I believe scaffolding works in a vaguely similar way. But as I said,
there are other approaches too...
On 3 Jul, 09:44, FluF <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm working on a project to display many statistics from many
> Models( clients, phonecalls, benefits, ..).
> Those statistics have the same presentation :
> - html table with different CSS but the same HTML code
> - ordonnable columns (not all)
> - tooltips for columns
> ...
> - graphics using GD2
>
> So before i found CakePhp ( and MVC) , i wrote this:
>
> class ArrayToTable {
> public function __construct($my2DArray, $params){
> /*...*/
> }
> /* other functions */
> public function process(){
> /* do some stuff with my2DArray */
> }
> public function render(){
> /* return the HTML code */
> }
>
> };
>
> And i used
> $bar = new ArrayToTable($result);
> /* work with $bar */ ;
> echo $bar->render();
>
> I found requestAction, but i don't know if it is the correct way.
>
> So how can i do that with cakePHP ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---