Sunday, February 1, 2009

Re: DebugKit for 1.2 Final throws error

I'm getting the same error using version 1.2.1.8004.

Would having moved the app folder cause this I wonder?

--~--~---------~--~----~------------~-------~--~----~
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 cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Batch adding records using Tree Behavior

On Feb 1, 4:05 am, mscdex <msc...@gmail.com> wrote:
> I have a model that contains a hasMany relationship with a model that
> "actsAs" a Tree. This Tree model has a hasMany 'child' relationship as
> well as a belongsTo 'parent' relationship to the same model. This
> setup works just fine when the user is interactively adding children
> nodes and such. However, I also have a function that gathers data from
> a flat file and inserts new records based on that data using saveAll.
>
> My problem is I cannot find a quick and easy way to automatically
> insert children at the same time. If I have a multidimensional array
> ('TodoChild' in the example below), is there a way to get the Tree
> Behavior to use it to create the children and automatically assign
> them to the proper parent?
>
> The only way I thought to do it was by somehow using a recursive
> method and doing a save on the parent first, then set the parent_id
> for each direct child below it and saving each of those (then repeat
> recursively). But that approach just seemed a bit much just to simply
> add children.
>
> My hasMany and belongsTo relationships for the model with Tree
> Behavior only have the foreignKey set to "parent_id." Here is an
> example data array with the same structure I am working with:
>
> [User] => Array
>     (
>        [name] => John
>     )
>
> [Todo] => Array
>     (
>        [0] => Array
>            (
>                [type] => single
>                [note] => bread, milk, eggs
>            )
>
>        [1] => Array
>            (
>                [type] => multiple
>                [TodoChild] => Array
>                     (
>                          [0] => Array
>                              (
>                                  [type] => single
>                                  [note] => cereal
>                              )
>
>                          [1] => Array
>                              (
>                                  [type] => single
>                                  [note] => dessert
>                              )
>
>                     )
>
>            )
>
>     )

Duplicate post. Please disregard.
--~--~---------~--~----~------------~-------~--~----~
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 cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Upgrade to Cake 1.2.1 stable problems

Yes, its dynamic.

It seems that in the 1.2 stable that HABTM for a model will always
create a default model for the join table unless the join table is
listed first in the uses for the controller.
--~--~---------~--~----~------------~-------~--~----~
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 cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: i wants to know how can i import contacts from Google, yahoo or others using cakephp

There is no such api to import contacts.. All the solutions will either use curl or wget to import stuff... This is the contact grabber i have been using

http://www.phpclasses.org/browse/package/3895.html

Get the lib and import it as vendor in your cake application.

Thanks.

On Sun, Feb 1, 2009 at 4:56 PM, hellfish <ruicruz.h3@gmail.com> wrote:

You can check out the Zend Framworkd which has some libs on Gdata
protocol.

You can use them as vendors in cakephp.




On Feb 1, 5:55 am, amar goud <amardeen...@gmail.com> wrote:
> hi all,
>
> i am doing an application which requires importing contacts from the mail
> servers like Google , yahoo and hot mail.
>
> how can i get Google API for contacts.....
>
> can any body tell this. what i have to do first.
>
> please reply me if you know.
>
> thank u.




--
Thanks & Regards,
Novice.

--~--~---------~--~----~------------~-------~--~----~
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 cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

URL Problem | Adding Slash at the end makes any difference ?

Hi All,

I am new to CakePHP. In my site i am facing this problem

when i say http://examplesite/products  everything is working fine.
But when i add a slash at the end of url (http://examplesite/products/), the page is displaying without CSS.

Please help me to solve this.

- - - - - - - - - - - - - - -
Thanks & Regards
S Kuppalli N


--~--~---------~--~----~------------~-------~--~----~
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 cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Where to define constants

Hi everyone.

If I want to use constants within my model code and have those the
constants defined within a separate file (i.e. /
english_constants.php), where can I call require_once('constants.php)
so that my "whole" application (models, views and controllers) can see
those constants?

If I put it in the AppController::beforeFilter(), the constants don't
seem to be available within the model.

Thanks
Turgs

--~--~---------~--~----~------------~-------~--~----~
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 cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Help Cake newbie (i really want to bake succesfully)

Cake does support MyISAM - that's what I use all the time, as a
personal preference. The only real advantage of using InnoDB with Cake
is its transaction support for saves on multiple models.

You need to explicitly state your associations inside your two models,
Author and Book, i.e.:

author.php:


book.php:

var $belongsTo = array(
'Author' => array('className' => 'Author',
'foreignKey' => 'author_id'
)
);

author.php:

var $hasMany = array(
'Book' => array('className' => 'Book',
'foreignKey' => 'author_id',
'dependent' => false
)
);

Now, due to your recursive level, a find on authors should bring back
all the books they've written!


On Feb 1, 6:13 am, CP <in...@leatherbelts.com> wrote:
> Hi
>
> thanks for the response. I am not sure if I have this figured out but
> I believe its not working for me because my database is a myISAM db.
> From what I read I think cake only suports INNODB joins automatically
> (as to say it can only automatically relate tables based on foreign
> keys which are only possible in an INNODB database). Am I right?
>
> If not and I am still missing something here is the code you
> requested.
>
> views/authors/index.ctp
> <?php foreach($authors as $author): ?><h2><?php echo $author['Author']
> ['name'] ?></h2><hr /><h3>Book(s):</h3><ul><?php foreach($author
> ['Book'] as $book): ?><li><?php echo $book['title'] ?></li><?php
> endforeach; ?></ul><?php endforeach; ?>
>
> /controllers/authors_controller.php
>
> <?php
> class AuthorsController extends AppController {
>         var $name = 'Authors';
>         function index() {
>         $this->Author->recursive = 1;
>         $authors = $this->Author->find('all');
>         $this->set('authors', $authors);   }}
>
> ?>
>
> On Jan 31, 10:32 pm, brian <bally.z...@gmail.com> wrote:
>
> > As you're in the authors view, I'll assume that you're trying to
> > retrieve associated Books for Author. If you post the contents of your
> > view action, as well as the $hasMany and $belongsTo arrays for Author
> > and Book respectively, I'm sure someone can help you sort it out.
>
> > Also, if you're using $this->Author->paginate() instead of find(),
> > post your controller's $paginate array.
>
> > On Sat, Jan 31, 2009 at 8:48 PM, CP <in...@leatherbelts.com> wrote:
>
> > > I followed this artcielhttp://www.packtpub.com/article/working-with-simple-associations-usin...
>
> > > But when was unable to get everything working correctly.
> > > I got everything working up to a point but at this point "Retrieving
> > > Related Model Data in One-To-Many Relation" is where I started having
> > > problems.
>
> > > the error I am getting is below:
>
> > > Notice (8): Undefined index:  Book [APP/views/authors/index.ctp, line
> > > 1]
>
> > > Anyone have any suggestions? Perhaps I have created the foreign key
> > > incorrectly? I have been trying to figure it out for the past hour and
> > > no luck. I hope someone can help me.
>
> > > Signed
>
> > > new baker- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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 cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---