Multiples apps with one Cake core and one webroot

2008-07-22 Thread inma

Hello,

¿It's possible to have multiple applications into CakePHP sharing the
same Cake core libs and the same webroot folder? A folder structure
like this:

/root
   /app
  /config
  /controllers
  /models
  /plugins
  /tmp
  /vendors
  /views
  index.php
  /app_2
  /app_3
  /cake
  /docs
  /vendors
  /webroot
  /css
  /img
  /js
  index.php

I have been searching the way to do it, but I think it's not
possible...

Can someone tell me if it's possible? And if it is, how can I do it?

Thanks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~--~~~~--~~--~--~---



Re: Multiples apps with one Cake core and one webroot

2008-07-22 Thread inma

Thanks to both for your answers!

leo:
I want to structure the folders this way because I have some different
applications into my website. And these aplications are using the
ExtJS libraries to show the views. So, following cake default folder
structure, I have to put ExtJS library files into each app/webroot/js
folder. And for new versions or extension from this framework I will
have to update them into each app/webroot/js folder.
Perhaps there is another way to do it better. Perhaps I can put ExtJS
libraries into /root/vendors, but I don't know how to do it this
way...

Amit:
I already had seen the Cookbook chapter about installing cakePHP
application in three separate app, but it explains how to configure it
for one application, it doesn't explain how to configure it to work
with different apps.

Thank you.

On 22 jul, 13:56, "Amit Badkas" <[EMAIL PROTECTED]> wrote:
> 2008/7/22 inma <[EMAIL PROTECTED]>:
>
>
>
>
>
>
>
> > Hello,
>
> > ¿It's possible to have multiple applications into CakePHP sharing the
> > same Cake core libs and the same webroot folder? A folder structure
> > like this:
>
> > /root
> >   /app
> >      /config
> >      /controllers
> >      /models
> >      /plugins
> >      /tmp
> >      /vendors
> >      /views
> >      index.php
> >  /app_2
> >  /app_3
> >  /cake
> >  /docs
> >  /vendors
> >  /webroot
> >      /css
> >      /img
> >      /js
> >  index.php
>
> > I have been searching the way to do it, but I think it's not
> > possible...
>
> > Can someone tell me if it's possible? And if it is, how can I do it?
>
> - Cookbook has chapter about installing cakePHP application in three
> separate app, cake and webroot directories, 
> athttp://book.cakephp.org/view/35/advanced-installation
>
> --
> Amit
>
> http://amitrb.wordpress.com/http://coppermine-gallery.net/http://cheesecake-photoblog.org/http://www.sanisoft.com/blog/author/amitbadkas-
>  Ocultar texto de la cita -
>
> - Mostrar texto de la cita -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~--~~~~--~~--~--~---



Re: Catch errors (urgent)

2008-04-30 Thread inma

Ok. I will take a look.

Thanks.

On 30 abr, 13:28, Sliv <[EMAIL PROTECTED]> wrote:
> Look at the validationErrors property
> Look at the beforeSave methodhttp://api.cakephp.org/1.2/class_model.html
>
> Look at the validationErrors 
> propertyhttp://api.cakephp.org/1.2/class_view.html
>
> Look at the validateErrors 
> methodhttp://api.cakephp.org/1.2/class_controller.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~--~~~~--~~--~--~---



Re: FindAll field condition

2008-04-30 Thread inma

findAll("datetime1 > datetime2")

On 30 abr, 12:22, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hi
> I have a model with two datetime (datetime1 datetime2).
> Now I must find all records with datetime1 > datetime2.
> How must I write findAll condition to do this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~--~~~~--~~--~--~---



Catch errors (urgent)

2008-04-30 Thread inma

Hi,

I need to catch model and controller errors and send it to the view
throw json. I need to send to the view something lik: {success: false,
error: "model/controller errors"}

How can I catch the model errors from $validate rules?

And how can I catch errors from controller in actions like save()
action?

Thanks for your support.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~--~~~~--~~--~--~---



Re: HABTM and conditions ?

2008-04-23 Thread inma

Take a look at: 
http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/

Regards.

On 23 abr, 11:41, Neveldo <[EMAIL PROTECTED]> wrote:
> Anybody has a solution ?
>
> thank !
>
> Cordially,
> Neveldo :http://www.neveldo.fr

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~--~~~~--~~--~--~---



Re: Introduction

2008-04-22 Thread inma

Good job Federico!

Gracias por compartirlo.

Un saludo!

On 22 abr, 04:32, "Federico Rinaldi" <[EMAIL PROTECTED]>
wrote:
> http://www.ad7six.com/MiBlog/Blogs/view/GenericFileUploadBehavior
>
> Regards,
>
> eyesonly.
>
>
>
> On Mon, Apr 21, 2008 at 10:15 AM, Krommenaas <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > Where can I find this Upload and Image behaviour from ad7six? Might
> > interest me but can't find it, not even on his blog :)
>
> > On Apr 21, 6:02 am, "Federico Rinaldi" <[EMAIL PROTECTED]>
> > wrote:
> > > Hi everyone, my name is Federico Rinaldi, my nick is eyesonly and I've
> > been
> > > a silent reader of the group posts for quite a while by now. I don't
> > want to
> > > bother with a long introduction so I'll tell a few words about me.
>
> > > I have a small start up in Argentina where me and my team work,
> > recommend to
> > > our clients for almost every new project CakePHP. There are a few times
> > > where they want us to use an speciffic architecture like .Net or Java.
> > I've
> > > been using CakePHP since the last year from the version 1.1, before that
> > we
> > > used to work with Prado but I love the MVC so Cake cought my attention
> > > really fast as we were investigating rails to move to that framework.
>
> > > I can't show much of my work as it is for private companies but I'll try
> > to
> > > give my experience of future projects through this great channel. For
> > now a
> > > can show you this web  that is my first
> > > CakePHP app, it was made with 1.1 with some small ajax things and this
> > other
> > > web  that has been made with 1.2 and has more
> > > complicated stuff (some Extjs and it uses the Upload and Image behaviour
> > > from ad7six, btw man u rock, I've read lot of stuff from you that save
> > me
> > > tons of time).
>
> > > That's all for now, Thanks for all the hard work behind this great
> > > Framework, I will try from now on to contribute with code and stuff that
> > > take me a while to figure out and can save you guys some time.- Ocultar 
> > > texto de la cita -
>
> - Mostrar texto de la cita -

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~--~~~~--~~--~--~---



Re: CakePHP with ExtJS

2008-04-21 Thread inma

Thanks to all for your interesting replies.

Actually, I'm working on a project with Cake + Extjs. It has and
administration area that uses a few CRUD screens, too. It works fine.
It has layouts, tabs, etc., and into the forms there are textfields,
numberfields, combos, and some ExtJS extensions like
Ext.ux.form.DateTime extension.

By the moment, I don't use any helper/component to do it. And, like
some of you, I use json to send data to ExtJs view. But in the future,
when I will have time to dedicate it, I will try to create helpers/
components to integrate both.

Through my development experience, I found:

- There aren't a lot of resources for integrating the two. I took the
opportunity to thank hydra12 (http://www.ntatd.org/mark/) and DjZoNe
(http://djz.hu/blog/posts/689) for your tutorials.

- The resources I found are the beginning to integrate both. So, if
you want a little more complex functionality (like forms), you have to
expend for a while to find the way to do it.

- If you don't use any helper/component, I think you loose some
"automagic" of Cake.

- You can use Debug=2 because it breaks views presentation... Ho do
you solve this point? By the moment, I use debug() function to
debugging...


And I have these quesions, also:

- How do you show the model validations and controllers erros into
your Extjs views? I know you can send them throw json arrays, but how
do it exactly and how to catch them into the views?

- How do you show combos into extjs forms? How do you implement
generateList() function?


Federico, it will be great if you could share your app_controller
logic.


Best regards.

On 21 abr, 06:16, "Federico Rinaldi" <[EMAIL PROTECTED]>
wrote:
> I've been working with ExtJS quite a while now, and right now I'm working in
> a large project that uses a lor of CRUD screens that has to be done with
> ExtJS grid and forms so I'm also working with the idea of a
> helper/component. For now I created in the app_controller the logic to feed
> every "index" action with the data of the {modelClass} as a json object and
> dinamically create the ExtJS grids based on the model of the database, as
> soons as I clean a little the code I'll share it with you guys.
>
> Eyesonly
>
> On Fri, Apr 18, 2008 at 8:59 AM, [EMAIL PROTECTED] <
>
>
>
> [EMAIL PROTECTED]> wrote:
>
> > ExtJS and Cake do indeed work quite nicely together. Having used them
> > together for several projects now, I have started working on a
> > component and a helper to try and produce some of the more common Ext
> > bits in a sort of scaffolded automagic way. The main things I see the
> > helper helping with would be Ext forms (based on the form helper) and
> > things like stores (who wants to re-type all those field: properties
> > and grid column models when you already have the schema in the cake
> > model? I also have a view which I use to return data to the
> > JsonReader, which does things like handle the totalProperty column
> > integrated with Cake's pager. I'm thinking it might be worth batching
> > some stuff into a component which intercepts scafolding stuff, so you
> > can effectively use your cake scafolded controllers with an all ext
> > frontend and save implementing any crud actions.
>
> > This is coming along nicely, but I'm not quite ready to release it to
> > everyone just yet. As soon as I have something worth contributing, I
> > will GPL it and put it up on the ext forums, and the bakery if they'll
> > have it.
>
> > Just some ideas. They'll be backed up with code shortly.
>
> > Simon
> >http://www.simonellistonball.com/
>
> > On Apr 18, 12:39 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> > > Works very well - just finishing a fairly large project with it but
> > there
> > > are no helpers and perhaps you are better off that way
>
> > > T
>
> > > On Fri, Apr 18, 2008 at 1:18 PM, inma <[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
>
> > > > I'm interested to know how many people are using ExtJS with CakePHP.
>
> > > --
> > > =
> > > Cheesecake-Photoblog:http://cheesecake-photoblog.org
> > > PHP for E-Biz:http://sanisoft.com
> > > =- Ocultar 
> > > texto de la cita -
>
> - Mostrar texto de la cita -

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~--~~~~--~~--~--~---



CakePHP with ExtJS

2008-04-18 Thread inma

Hi,

I'm interested to know how many people are using ExtJS with CakePHP.

And how do you integrate it? Does someone use some helper to integrate
both (listings, forms, etc.)?

Regards.

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



Json format

2008-04-17 Thread inma

Into a "Uer" model, I have a field named "cod_serial" defined as
varchar(6) into database.

I use json to render the view. But when I parse the data to json
format (with utf8_encode($javascript->Object($users)))

The result is:

{"User":{"user_id":1, "name": "", "cod_serial":08}}

It seems that cod_serial is integer, but it is varchar. The result
must to be (cod_serial with quotes):

{"User":{"user_id":1, "name": "", "cod_serial": "08"}}

Why does it happen?

Thanks!!

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



How to use Set::Combine function?

2008-04-11 Thread inma

Array
(
[User] => Array
(
user data
)

[PermissionGroup] => Array
(
[0] => Array
(
[id] => 5
[numero_horas] => 10

)

[1] => Array
(
[id] => 10
[numero_horas] => 7
)

[2] => Array
(
[id] => 15
[numero_horas] => 19
)

)
)


I need to put this data into this format array:

Array
(
[5] => Array
(
['disponible'] => 10
}
[10] => Array
(
['disponible'] => 7
}
[15] => Array
(
['disponible'] => 19
}
)

How can I do it?

I think I could use Set::combine function. I have tried this way:

$newArray = Set::combine($arrayData, 'PermissionGroup.{n}.id',
'PermissionGroup.{n}.numero_horas');

But this creates this array:

Array
(
[5] => 10
[10] => 7
[15] => 19
)

Thanks for your help!

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



Re: hasAndBelongsToMany relation issue

2008-04-10 Thread inma

Thanks Joel!

I will try it.

On 10 abr, 00:32, Joel <[EMAIL PROTECTED]> wrote:
> The query:
>
> $records = $this->Author->findAll();
>
> will return nested associative arrays in the form:
>
> Array
> (
>     [0] => Array
>         (
>             [Author] => Array
>                 (
>                     ...// Fields from the Author model
>                 )
>             [Book] => Array
>                 (
>                     [0] => Array
>                         (
>                             .. // Fields from the Book model.
>
>                             [AuthorsBooks] => Array
>                                 (
>                                     ..// The join Model information
>                                 )
>
>                         )
>                     [1] => Array
>                         (
>                             .. // Fields from the Book model.
>
>                             [AuthorsBooks] => Array
>                                 (
>                                     ..// The join Model information
>                                 )
>
>                         )
>                 )
>         )
> )
>
> etc.
>
> From the above structure (which you can view by calling
> debug($records) ), and the article I linked earlier on the
> Set::extract methods, you should be able to massage
> the data into whatever logical form you desire.
>
> Hope this helps.
>
> -Joel.
>
> On Apr 9, 11:31 am,inma<[EMAIL PROTECTED]> wrote:
>
>
>
> > Thanks for your replies!
>
> > martin, if you have this tables:
> > CREATE TABLE `authors` (
> >   `id` int(11) NOT NULL auto_increment,
> >   `name` varchar(255) NOT NULL
> >   PRIMARY KEY  (`id`)
> > );
>
> > CREATE TABLE `books` (
> >   `id` int(11) NOT NULL auto_increment,
> >   `name` varchar(255) NOT NULL,
> >   `price` float(8,2) NOT NULL
> >   PRIMARY KEY  (`id`)
> > );
>
> > CREATE TABLE `authors_books` (
> >   `id` int(11) NOT NULL auto_increment,
> >   `author_id` int(11) NOT NULL,
> >   `book_id` int(11) NOT NULL,
> >   PRIMARY KEY  (`id`)
> > );
>
> > And this relation:
>
> > class Author extends AppModel
> > {
> >         var $name = 'Author';
> >         var $hasAndBelongsToMany = array('Book');
>
> > }
>
> > class Book extends AppModel
> > {
> >         var $name = 'Book';
> >         var $hasAndBelongsToMany = array('Author');
>
> > }
>
> > How do you display a report with all authors and their books?
>
> > author.id   ||   author.name  ||   book.name  ||    book.price
>
> > I know it is a basic question, but I don't know how to do it
> > correctly...
>
> > Thanks.
>
> > On 9 abr, 17:00, "[EMAIL PROTECTED]"
>
> > <[EMAIL PROTECTED]> wrote:
> > > The usual and unhelpful answer applies:
> > > You will have to rearrange your array-data yourself if you need it in
> > > that format.
>
> > > I would take another look at the javascript-component you are using...
> > > because I can't really figure out why it would require the data in
> > > that format. Repeating the user-data for each group sounds strange.
>
> > > So if you really want to rearrange the data I would prefer to do it in
> > > the User Model. You could create a method called "getUsersForExtJS()"
> > > or something and in that method you do the actual findAll and some
> > > data-manipulation before returning the data to the controller.
>
> > > I would not use afterFind in this case since I really think it is only
> > > something you want to do for some specific JS-component and not every
> > > time you find a user.
>
> > > On Apr 9, 4:28 pm,inma<[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
>
> > > > I have an User class and a PermissionGroup class. User has defined a
> > > > hasAndBelongsToMany relation with PermissionGroup.
>
> > > > If into database exists one user with two permission grups assigned,
> > > > when I run this code:
>
> > > > $userA = $this->User->findAll($sort, $limit, $page); //gets all the
> > > > User records and sorts them.
>
> > > > It returns an array that contains the user data array and the
> > > > permission groups array:
>
> > > > Array(
> > > >   [User] => Array(
> > > >                     her

Re: hasAndBelongsToMany relation issue

2008-04-09 Thread inma

Thanks for your replies!

martin, if you have this tables:
CREATE TABLE `authors` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL
  PRIMARY KEY  (`id`)
);

CREATE TABLE `books` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `price` float(8,2) NOT NULL
  PRIMARY KEY  (`id`)
);

CREATE TABLE `authors_books` (
  `id` int(11) NOT NULL auto_increment,
  `author_id` int(11) NOT NULL,
  `book_id` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
);


And this relation:

class Author extends AppModel
{
var $name = 'Author';
var $hasAndBelongsToMany = array('Book');
}

class Book extends AppModel
{
var $name = 'Book';
var $hasAndBelongsToMany = array('Author');
}

How do you display a report with all authors and their books?

author.id   ||   author.name  ||   book.name  ||book.price


I know it is a basic question, but I don't know how to do it
correctly...

Thanks.

On 9 abr, 17:00, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> The usual and unhelpful answer applies:
> You will have to rearrange your array-data yourself if you need it in
> that format.
>
> I would take another look at the javascript-component you are using...
> because I can't really figure out why it would require the data in
> that format. Repeating the user-data for each group sounds strange.
>
> So if you really want to rearrange the data I would prefer to do it in
> the User Model. You could create a method called "getUsersForExtJS()"
> or something and in that method you do the actual findAll and some
> data-manipulation before returning the data to the controller.
>
> I would not use afterFind in this case since I really think it is only
> something you want to do for some specific JS-component and not every
> time you find a user.
>
> On Apr 9, 4:28 pm, inma <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > I have an User class and a PermissionGroup class. User has defined a
> > hasAndBelongsToMany relation with PermissionGroup.
>
> > If into database exists one user with two permission grups assigned,
> > when I run this code:
>
> > $userA = $this->User->findAll($sort, $limit, $page); //gets all the
> > User records and sorts them.
>
> > It returns an array that contains the user data array and the
> > permission groups array:
>
> > Array(
> >   [User] => Array(
> >                     here the user data
> >               )
> >   [PermissionGroup] => Array(
> >                    [0] => Array(
> >                here the FIRST permission data
> >                           )
> >                    [1] => Array(
> >                              here the SECOND permission data
> >                           )
> >                 )
> > )
>
> > I turn it into a json format because I use ExtJS library into the
> > views:
>
> > {"total":1, "users":[{"User":{ here the user data },
> > "PermissionGroup":
> > [{ here the first permission data }, { here the second permission
> > data }]}]}
>
> > But I need an array for each permission group assigned to user. Like
> > this:
>
> > Array(
> >   [User] => Array(
> >                                here the user data
> >               )
> >   [PermissionGroup] => Array(
> >                    [0] => Array(
> >                here the FIRST permission data
> >                           )
> >                 )
> > ),
> > Array(
> >   [User] => Array(
> >                                here the user data
> >               )
> >   [PermissionGroup] => Array(
> >                    [0] => Array(
> >                here the SECOND permission data
> >                           )
> >                 )
> > )
>
> > Turned into json format:
>
> > {"total":2,
> > "users":[{"User":{ here the user data }, "PermissionGroup":{ here the
> > FIRST permission data }},
> > {"User":{ here the user data }, "PermissionGroup":{ here the SECOND
> > permission data }}
> > ]}
>
> > ¿How can I do it?
>
> > Thanks in advance!
>
> > P.S: ( I have asked this questions a few hours ago, but it doesn't
> > appear. So I have repeated it...)- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -

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



hasAndBelongsToMany relation issue

2008-04-09 Thread inma

Hi,

I have an User class and a PermissionGroup class. User has defined a
hasAndBelongsToMany relation with PermissionGroup.

If into database exists one user with two permission grups assigned,
when I run this code:

$userA = $this->User->findAll($sort, $limit, $page); //gets all the
User records and sorts them.

It returns an array that contains the user data array and the
permission groups array:

Array(
  [User] => Array(
here the user data
  )
  [PermissionGroup] => Array(
   [0] => Array(
   here the FIRST permission data
  )
   [1] => Array(
 here the SECOND permission data
  )
)
)

I turn it into a json format because I use ExtJS library into the
views:

{"total":1, "users":[{"User":{ here the user data },
"PermissionGroup":
[{ here the first permission data }, { here the second permission
data }]}]}

But I need an array for each permission group assigned to user. Like
this:

Array(
  [User] => Array(
   here the user data
  )
  [PermissionGroup] => Array(
   [0] => Array(
   here the FIRST permission data
  )
)
),
Array(
  [User] => Array(
   here the user data
  )
  [PermissionGroup] => Array(
   [0] => Array(
   here the SECOND permission data
  )
)
)

Turned into json format:

{"total":2,
"users":[{"User":{ here the user data }, "PermissionGroup":{ here the
FIRST permission data }},
{"User":{ here the user data }, "PermissionGroup":{ here the SECOND
permission data }}
]}

¿How can I do it?

Thanks in advance!


P.S: ( I have asked this questions a few hours ago, but it doesn't
appear. So I have repeated it...)

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



Re: organizing controlleres into subdirectories

2008-04-09 Thread inma

Yes, you can group your models, controllers and views into
subdirectories.

You have to set additional paths to models, views and controllers into
documentRoot/app/config/bootstrap.php.

For example:

$modelPaths = array(MODELS."usuarios".DS, MODELS."sistema".DS,
MODELS."proyectos".DS);

$controllerPaths = array(CONTROLLERS."usuarios".DS,
CONTROLLERS."sistema".DS, CONTROLLERS."proyectos".DS);

$viewPaths= array(VIEWS."usuarios".DS, VIEWS."sistema".DS,
VIEWS."proyectos".DS);


It works to the structure:

/ DocumentRoot
  / app
/ models
  / usuarios
  / sistema
  / proyectos
/ controllers
  / usuarios
  / sistema
  / proyectos
/ views
  / usuarios
  / sistema
  / proyectos



On 9 abr, 13:11, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> Yes, but you will have to learn to use google for this.
>
>
>
> On Wed, Apr 9, 2008 at 5:00 AM, MarcS <[EMAIL PROTECTED]> wrote:
>
> >  Hi,
>
> >  I'm wondering if it is is somehow possible to put controllers into
> >  subdirectories.
> >  sort of like
> >  www.cakeapp.com/subdirectory/controller/action
> >  www.cakeapp.com/subdirectory2/controller/action
> >  and have the same for the views.
>
> >  It is not really essential but in large apps with lots of controllers
> >  it would be good if it was possible to put them in groups.- Ocultar texto 
> > de la cita -
>
> - Mostrar texto de la cita -

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



hasAndBelongsToMany issue

2008-04-09 Thread inma

I have an User class and a PermissionGroup class. User has defined a
hasAndBelongsToMany relation with PermissionGroup.

If into database exists one user with two permission grups assigned,
when I run this code:

$userA = $this->User->findAll($sort, $limit, $page); //gets all the
User records and sorts them.

It returns an array that contains the user data array and the
permission groups array:

Array(
   [User] => Array(
 here the user data
   )
   [PermissionGroup] => Array(
[0] => Array(
here the FIRST permission data
   )
[1] => Array(
  here the SECOND permission data
   )
 )
)

I turn it into a json format because I use ExtJS library into the
views:

{"total":1, "users":[{"User":{ here the user data }, "PermissionGroup":
[{ here the first permission data }, { here the second permission
data }]}]}

But I need an array for each permission group assigned to user. Like
this:

Array(
   [User] => Array(
here the user data
   )
   [PermissionGroup] => Array(
[0] => Array(
here the FIRST permission data
   )
 )
),
Array(
   [User] => Array(
here the user data
   )
   [PermissionGroup] => Array(
[0] => Array(
here the SECOND permission data
   )
 )
)

Turned into json format:
{"total":2,
"users":[{"User":{ here the user data }, "PermissionGroup":{ here the
FIRST permission data }},
{"User":{ here the user data }, "PermissionGroup":{ here the SECOND
permission data }}
]}

¿How can I do it?

Thanks in advance!

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



Re: How combine CakePHP + ExtJS?

2008-01-15 Thread inma

Thanks hydra12 for the forms tutorial. It will help a lot of people.

Best regards.

On 12 ene, 14:47, foxmask <[EMAIL PROTECTED]> wrote:
> on my side i get the grid and the string :
> {"total":2, "users":[{"username":"foxmask", "title":"",
> "realname":""}, {"username":"Invité", "title":"", "realname":""}]}
>
> display just after the grid .
>
> On Jan 11, 11:15 pm, hydra12 <[EMAIL PROTECTED]> wrote:
>
>
>
> > OK, the forms tutorial is up now.  You can find it 
> > here:http://www.ntatd.org/mark/?p=31. Have a great weekend!
>
> > On Jan 11, 8:38 am, hydra12 <[EMAIL PROTECTED]> wrote:
>
> > > That's what it's supposed to do.  getAllUsers just returns a json
> > > string with data from the database.  Now call myroot/users/index.  It
> > > should show a datagrid with all the json data in it.  The way it works
> > > is this: index is pretty much blank, but it loads myScript.js (or
> > > whatever you named it).  myScript.js calls getAllUsers on line 17:
>
> > >      proxy: new Ext.data.HttpProxy({url: 'http://'+host+'/ext/users/
> > > getAllUsers'}),
>
> > > When you call index, it should call getAllUsers and load the data
> > > returned into your store.  When you render your datagrid, it pulls
> > > data from the store and puts it in the grid.  The fact that you are
> > > getting the json string when you call getAllUsers directly means
> > > you're on the right track.  Let me know if I can help.
>
> > > BTW, I'm about 1/2 way done on a forms tutorial . . .
>
> > > hydra12
>
> > > On Jan 11, 8:13 am, inma <[EMAIL PROTECTED]> wrote:
>
> > > > Thank you Hidra12!
>
> > > > I read your datagrid tutorial for ext-2.0.
>
> > > > I'm using ext-2.0 and CakePHP 1.2 Beta, too.
>
> > > > But when I call to myroot//users/getAllUsers, it shows that:
>
> > > > {"total":8, "users":[{"id":6, "username":"archangel",
> > > > "fullname":"Worthington, Warren"}, {"id":2, "username":"cyclops",
> > > > "fullname":"Summers, Scott"}, {"id":8, "username":"gambit",
> > > > "fullname":"LeBeau, Remy"}, {"id":1, "username":"hydra12",
> > > > "fullname":"Buckner, Mark"}, {"id":5, "username":"iceman",
> > > > "fullname":"Drake, Bobby"}, {"id":3, "username":"nightcrawler",
> > > > "fullname":"Wagner, Kurt"}, {"id":7, "username":"storm",
> > > > "fullname":"Munroe, Ororo"}, {"id":4, "username":"wolverine",
> > > > "fullname":"Logan"}]}
>
> > > > On 10 ene, 21:37, hydra12 <[EMAIL PROTECTED]> wrote:
>
> > > > > OK, I did some searching and found this 
> > > > > thread:http://groups.google.com/group/cake-php/browse_thread/thread/32d4c152...-
> > > > >  Ocultar texto de la cita -
>
> - Mostrar texto de la cita -

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



Re: How combine CakePHP + ExtJS?

2008-01-11 Thread inma

Thank you Hidra12!

I read your datagrid tutorial for ext-2.0.

I'm using ext-2.0 and CakePHP 1.2 Beta, too.

But when I call to myroot//users/getAllUsers, it shows that:

{"total":8, "users":[{"id":6, "username":"archangel",
"fullname":"Worthington, Warren"}, {"id":2, "username":"cyclops",
"fullname":"Summers, Scott"}, {"id":8, "username":"gambit",
"fullname":"LeBeau, Remy"}, {"id":1, "username":"hydra12",
"fullname":"Buckner, Mark"}, {"id":5, "username":"iceman",
"fullname":"Drake, Bobby"}, {"id":3, "username":"nightcrawler",
"fullname":"Wagner, Kurt"}, {"id":7, "username":"storm",
"fullname":"Munroe, Ororo"}, {"id":4, "username":"wolverine",
"fullname":"Logan"}]}



On 10 ene, 21:37, hydra12 <[EMAIL PROTECTED]> wrote:
> OK, I did some searching and found this 
> thread:http://groups.google.com/group/cake-php/browse_thread/thread/32d4c152...

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



Re: How combine CakePHP + ExtJS?

2008-01-10 Thread inma

Thanks for your answers!

Although your examples show a datagrid, I will try to adapt it to show
and validate a form...

Kind regards.

On 9 ene, 20:02, hydra12 <[EMAIL PROTECTED]> wrote:
> I'm working on a new version of my tutorial that works with 2.0.  I'll
> try to get it done soon, depending on my work schedule.
>
> hydra12http://www.ntatd.org/mark
>
> On Jan 9, 12:23 pm, DjZoNe <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi inma,
>
> > I started to write here a little help, but it became bigger as I
> > expected.
> > So I rather posted into my blog:http://djz.hu/blog/posts/689
>
> > --
> > DjZoNe
>
> > > Hi,
>
> > > I'm newbie in CakePHP andExtJS. I'm developing a new application with
> > > CakePHP, and I want to integrate theExtJSforms into this
> > > application. I was looking some posts about it.
>
> > >  Nevertheless, I don't know how to match Cake model, controller and
> > > view withExtJSexactly. :-(
>
> > >  Can someone post an example (basic example) with this combination
> > > (cake model, controller and view withExtJS)?
>
> > > Thanks a lot.- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -

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



How combine CakePHP + ExtJS?

2008-01-09 Thread inma

Hi,

I'm newbie in CakePHP and ExtJS. I'm developing a new application with
CakePHP, and I want to integrate the ExtJS forms into this
application. I was looking some posts about it.

 Nevertheless, I don't know how to match Cake model, controller and
view with ExtJS exactly. :-(

 Can someone post an example (basic example) with this combination
(cake model, controller and view with ExtJS)?

Thanks a lot.

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



filter/search/paginate

2007-10-23 Thread inma

Hello,

 I'm looking for component or helper to filter/search/paginate
results. I need it for version 1.1.15 (not version 1.2).

 I want something exactly like this 
http://www.javascriptkit.com/script/script2/tablefilter.shtml,
but I need to  refresh data from database when the filter or the
pagination are applied, and this script doesn't do it.

Thanks in advance.


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



Different data sources

2007-10-11 Thread inma

Hello,

 I need to know the way to define two different data sources at the
same time (MySQL & Oracle). Is this possible?

 I have to read data from both data sources and show it at the same
screen.


Thanks in advance.


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