Thank you "3lancer.eu" that's solves my problem =)
    My next step is to generate :
                1- xml or   2-json from the database records .
i tried to do so ,and i succeeded , but i think the cakePHp generate a
non standard JSON format .

4 example (JSON)  ,from my categories table : it generated like
this !!!
 [{"Category":{"id":"1","name":"CSS"}},{"Category":
{"id":"2","name":"XHTML"}},{"Category":{"id":"3","name":"JQUERY"}}]
I guess this is not the correct forme of a JSON file !!
Even parsing it with jquery is quite hard due to the incorrect
format !!


I also tried with xml and i get a valid xml format but to make the
parsing code with jquery work in IE6 & FF is impossible so , I'm
pretty sure that JSON will be my lonely solution .


How can I generate A valid JSON Format with JQUERY (AGAIn I tried
alost all the tutorials on the web ,but still without solution :S )
Thx Again







On Jul 14, 8:34 pm, "3lancer.eu" <[email protected]> wrote:
> Hello,
>
> > Actually I have 4 tables in my database :
>
> > 1-comments
> > 2-posts
> > 3-categories
> > 4-work
>
> > And i have a lonely page : default.php (my web site is juste 1 page ).
> > which is located in my webSite Root.
>
> Any reason not to follow the Cake MVC pattern / file structure?
>
> > So i want to get all the tables records in my page(default.php) ,all
> > my models r working ,my controllers as well .
>
> > The problem is i want to show all my tables records in the same page ,
> > how can i do that without being forced to use every view of every model
> > (table) .
>
> If I understand your goal right, you can always instantinate/import
> models (using App::import('model', ...)) in any controller action and
> just pass results to the views. Even better would be to add all 4
> model names to the controller var $uses array, then you can just use:
>
> $this->Comment->find
> $this->Post->find
> $this->Categories->find
>
> etc.
>
> Of course in case of relationships you can usually do it with even
> less code.
>
> Regards,
> Piotr
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to