Re: Just getting started and have a problem with relationships

2008-11-22 Thread php.baker

I very much doubt that the problem relates to php and/or apache.
Please post your controller classes Also, what url did u use to
"hit the post
controller"?

As far as debugging goes... Set debug to 3 (in .../config/core.php)
and you should be able to see very quickly if your models are linked.
http://book.cakephp.org/view/155/Debugging

I would recommend you try using the bake console. Bake your models,
controllers, and views, and then look for differences between your
code and the code generated by bake. Bake is a great way for beginners
and experts to get apps going quickly(imho).



On Nov 22, 2:36 pm, "James.Diss" <[EMAIL PROTECTED]> wrote:
> I actually tried this first in an effort to get it working.
>
> Currently the model for 'Post' looks like;
>
> //      app/models/Post.php
> class Post extends AppModel {
>         var $name = 'Post';
>         var $validate = array();
>         var $belongsTo = array('User'=>array
> ('className'=>'User','foreignKey'=>'user_id'));
>
> }
>
> The model for 'User' looks like;
>
> //      app/models/User.php
> class User extends AppModel {
>         var $name = 'User';
>         var $validate = array();
>         var $hasMany = array('Post');
>
> }
>
> The thing is that I suspect that I'm keeping to the conventions with
> the following DDLs;
>
> CREATE TABLE `users` (
>   `id` int(11) unsigned NOT NULL auto_increment,
>   `name` varchar(100) default NULL,
>   `email` varchar(150) default NULL,
>   `firstname` varchar(60) default NULL,
>   `lastname` varchar(60) default NULL,
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
>
> CREATE TABLE `posts` (
>   `id` int(11) unsigned NOT NULL auto_increment,
>   `name` varchar(255) default NULL,
>   `date` datetime default NULL,
>   `content` text,
>   `user_id` int(11) default NULL,
>   PRIMARY KEY  (`id`),
>   KEY `user_id` (`user_id`)
> ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
>
> (before anyone points out the index 'user_id' after the primary key,
> it's not that, I checked.  I would have been disappointed if an index
> threw things out of kilter, though)
>
> At this moment I'm leaning towards something being wrong with the
> install, and I'm humble enough to think it's PHP/Apache2.  Is there
> any configuration in either of those can stop associations being made?
> (Although they're both as vanilla as possible for deploying code on
> live servers)
>
> TIA
>
> On Nov 22, 3:42 pm, Rob <[EMAIL PROTECTED]> wrote:
>
> > You probably want to add the foreigh_key to your hasMany and
> > belongsTo, especially if they don't follow the cake conventions.
>
> > In my models, I have ID columns like 'user_id', and the foreign_key is
> > typically the same name, so for instance in my Users to Groups
> > relationship I have something like:
>
> > // Users model ...
> >     var $hasMany = array(
> >         'UserGroup' => array(
> >             'className'     => 'UserGroup',
> >             'foreignKey'    => 'user_id',
> >             'limit'         => '5',
> >             'dependent'     => true
> >         )
> >     );
>
> >     // Link to groups
> >     var $hasAndBelongsToMany = array(
> >         'Group' =>
> >         array(
> >                 'className'             => 'Group',
> >                 'joinTable'             => 'user_groups',
> >                 'foreignKey'            => 'user_id',
> >                 'associationForeignKey' => 'group_id',
> >                 'conditions'            => '',
> >                 'order'                 => '',
> >                 'limit'                 => '',
> >                 'unique'                => true,
> >                 'finderQuery'           => '',
> >                 'deleteQuery'           => '',
> >                 'insertQuery'           => ''
> >         )
> >     );
>
> > // Groups model
> >     var $hasMany = array(
> >         'UserGroup' => array(
> >             'className'     => 'UserGroup',
> >             'foreignKey'    => 'group_id',
> >             'limit'         => '5',
> >             'dependent'     => true
> >         )
> >     );
>
> >     // Link to users
> >     var $hasAndBelongsToMany = array(
> >         'User' =>
> >             array(
> >                 'className'             => 'User',
> >                 'joinTable'             => 'user_groups',
> >                 'foreignKey'            => 'group_id',
> >                 'associationForeignKey' => 'user_id',
> >                 'conditions'            => '',
> >                 'order'                 => '',
> >                 'limit'                 => '',
> >                 'unique'                => true,
> >                 'finderQuery'           => '',
> >                 'deleteQuery'           => '',
> >                 'insertQuery'           => ''
> >         )
> >     );
>
> > On Nov 22, 9:45 am, "James.Diss" <[EMAIL PROTECTED]> wrote:
>
> > > The failing isn't really in understanding the relationships, just
> > > something 

Re: CSS formatting not appearing

2008-11-22 Thread CJL

Fixed it, you guys are the best!  Firebug is amazing.  Long story
short, my default.thtml was all screwy.  Very basic html stuff.
Thanks!

On Nov 22, 9:21 pm, "sijo jose" <[EMAIL PROTECTED]> wrote:
> I agree with ROD. If it is CSS, firebug rocks.
>
>
>
> On Sun, Nov 23, 2008 at 2:22 AM, Rob <[EMAIL PROTECTED]> wrote:
>
> > First, I would suggest you get a copy of Firebug - it rocks when
> > trying to debug CSS issues.
>
> > What exactly do you mean 'none of my CSS formats were applied'?
>
> > If you left off the punctuation when you modified the #content, that
> > would break things, but if all you did was to change the first element
> > in the padding from 0px to 10px, that would only fail if another CSS
> > tag prevented the change from being applied.
>
> > On Nov 21, 12:05 pm, CJL <[EMAIL PROTECTED]> wrote:
> > > (sorry I hit send by accident)
>
> > > Below is my original style.css:
>
> > > #content {
> > >   clear:both;
> > >         margin-left: auto;
> > >         margin-right: auto;
> > >   padding: 0px 40px 10px 40px;
> > >   background-color: #fff;
> > >   color: #333;
> > >         text-align: left;
> > >         width: 100%;
>
> > > Then I just changed the padding to:
>
> > > padding: 20px 40px 10px 40px
>
> > > After that, none of my CSS formats were applied.  I went back to the
> > > style.css file and changed the padding back to the original settings,
> > > but still none of my CSS formats are appearing.  Any help would be
> > > greatly appreciated.  Thanks!
>
> > > On Nov 21, 11:51 am, CJL <[EMAIL PROTECTED]> wrote:
>
> > > > Hello,
>
> > > > First off, I'm new to CakePHP and web development in general, so I
> > > > apologize in advance if my question is a stupid one or has been asked
> > > > already.  I've read up to chapter 7 in the cookbook, and I'd say I
> > > > understand it on a high level, but can figure out the details if I
> > > > know where to look.  I've installed CakePHP 1.1 and I am using MAMP.
>
> > > > Problem: My CSS formatting is not appearing, but what's strange is
> > > > that it worked at first, then I made a tiny change to a padding
> > > > argument, and now all my formatting is gone.  Below is my app/views/
> > > > layouts/default.thtml:
>
> > > > 
> > > > 
> > > > 
> > > > My Page -- 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
>
> > > > 
> > > >         
> > > >                 
> > > >                         image('logo.jpg')?>
> > > >                 
> > > >                 
> > > >                           renderElement('menu',
> > array('key'=>'val'))?>
> > > >                 
>
> > > >                 
> > > >                         flash();?>
> > > >                 
>
> > > >                 
> > > >                         
> > > >                 
> > > >         
> > > >         
> > > > 
>
> > > > 
> > > > 
>
> > > > So initially, like I said, my CSS worked.  I wanted to mess around and
> > > > change my #content in the CSS file.  Below is the original style.css:
>
> --
> Sijo Jose Chakramakkil
--~--~-~--~~~---~--~~
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: the screencast quicktime videos are not playing

2008-11-22 Thread xfhxfh

yea this is the solution.

thx man.

Frank
--~--~-~--~~~---~--~~
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: CSS formatting not appearing

2008-11-22 Thread sijo jose
I agree with ROD. If it is CSS, firebug rocks.

On Sun, Nov 23, 2008 at 2:22 AM, Rob <[EMAIL PROTECTED]> wrote:

>
> First, I would suggest you get a copy of Firebug - it rocks when
> trying to debug CSS issues.
>
> What exactly do you mean 'none of my CSS formats were applied'?
>
> If you left off the punctuation when you modified the #content, that
> would break things, but if all you did was to change the first element
> in the padding from 0px to 10px, that would only fail if another CSS
> tag prevented the change from being applied.
>
> On Nov 21, 12:05 pm, CJL <[EMAIL PROTECTED]> wrote:
> > (sorry I hit send by accident)
> >
> > Below is my original style.css:
> >
> > #content {
> >   clear:both;
> > margin-left: auto;
> > margin-right: auto;
> >   padding: 0px 40px 10px 40px;
> >   background-color: #fff;
> >   color: #333;
> > text-align: left;
> > width: 100%;
> >
> > Then I just changed the padding to:
> >
> > padding: 20px 40px 10px 40px
> >
> > After that, none of my CSS formats were applied.  I went back to the
> > style.css file and changed the padding back to the original settings,
> > but still none of my CSS formats are appearing.  Any help would be
> > greatly appreciated.  Thanks!
> >
> > On Nov 21, 11:51 am, CJL <[EMAIL PROTECTED]> wrote:
> >
> > > Hello,
> >
> > > First off, I'm new to CakePHP and web development in general, so I
> > > apologize in advance if my question is a stupid one or has been asked
> > > already.  I've read up to chapter 7 in the cookbook, and I'd say I
> > > understand it on a high level, but can figure out the details if I
> > > know where to look.  I've installed CakePHP 1.1 and I am using MAMP.
> >
> > > Problem: My CSS formatting is not appearing, but what's strange is
> > > that it worked at first, then I made a tiny change to a padding
> > > argument, and now all my formatting is gone.  Below is my app/views/
> > > layouts/default.thtml:
> >
> > > 
> > > 
> > > 
> > > My Page -- 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> >
> > > 
> > > 
> > > 
> > > image('logo.jpg')?>
> > > 
> > > 
> > >   renderElement('menu',
> array('key'=>'val'))?>
> > > 
> >
> > > 
> > > flash();?>
> > > 
> >
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> >
> > > 
> > > 
> >
> > > So initially, like I said, my CSS worked.  I wanted to mess around and
> > > change my #content in the CSS file.  Below is the original style.css:
> >
> >
> >
>


-- 
Sijo Jose Chakramakkil

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



How do I use "find" to retreive data from multiple tables

2008-11-22 Thread pkclarke

I have the following tables:

sites
 - id
 - title

site_users
 - id
 - site_id
 - user_id


How do I construct a "find()" to retrieve equivalent of the following
query:

SELECT a.id, a.title FROM sites a, site_users b WHERE a.id = b.site_id
AND b.user_id = 1;

I tried "find('list', array('fields'=>array('SiteUser.site_id',
'SiteUser.Site.title')))" but nothing is that easy ;-)
--~--~-~--~~~---~--~~
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: Ajax "link" not updating "div" with "ctp" template

2008-11-22 Thread pkclarke

I found the problem: I was trying to call the "updatecontent" template
from the "signon" view.  Because I was not logged in yet, the "Auth"
component was not allowing the "updatecontent" template to be
displayed!!!  That is 24 hours of my life I will never get back :-)
To fix the problem I added the "updatecontent" template to the Auth
"allow" list:

$this->Auth->allow('register', 'updatesites');



On Nov 23, 10:54 am, pkclarke <[EMAIL PROTECTED]> wrote:
> Thanks for your help Kyo.  I've implemented your suggestions & also
> added the "render()" function (see below).  However I must be missing
> something, as it is still not returning the content to the main
> template.
>
> Main Template (login.ctp):
> <
> 
>   replace this
> 
>
>    echo $ajax->link('Click here', null, array('url' => 'updatecontent',
> 'update' => 'testcontent'));
> ?>
> >
>
> Main Controller (users_controller.php):
> <
> function updatecontent() {
>   $this->layout='ajax';
>   if ($this->RequestHandler->isAjax()) {
>     $this->set('content', 'sample content');
>     $this->render('updatecontent', 'ajax' );
>   }}
>
> >
>
> Ajax content template (updatecontent.ctp):
> <
>    echo "content: ";
>   echo $content;
> ?>
> >
>
> Again, thanks for any assistance in advance.
--~--~-~--~~~---~--~~
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: several database settings

2008-11-22 Thread francky06l

That will not work for shell ... but maybe you do not need
Cheers

On Nov 22, 12:06 am, "Ricardo Valfreixo" <[EMAIL PROTECTED]> wrote:
> Ok, I ask and also reply..
>
> directly on the app/config/database.php
>
> something like:
>
> classe DATABASE_CONFIG
> {
> var $default = NULL;
>
> var $dev = array(
> //your dev settings
> );
> var $prod = array(
> //your prod settings
> );
>
> function __construct()
> {
> if(isset($_SERVER['SERVER_NAME'])
> {
> if($_SERVER['SERVER_NAME'] == )
> {
> $this->default = $this->prod;
> }
> else
> {
> $this->default = $this->dev;
> }
> }
> }
>
> }
>
> et voilá
>
> @teknoid
>
> This way I don't need to worry about overwriting all the files. I can simply
> delete all and reupload the entire source.
>
> Zen
>
> On Fri, Nov 21, 2008 at 10:45 PM, Ricardo Valfreixo <[EMAIL PROTECTED]>wrote:
>
> > Hello once more. I'm a real pain, I know..
>
> > I have two database settings. one $default and one $production. How can I
> > make the code sensitive to the url? I have the php magic system variables
> > which I can use, But were, in the code, should I put the "selector"?
>
> > Thank you
>
> > Zen
--~--~-~--~~~---~--~~
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: Just getting started and have a problem with relationships

2008-11-22 Thread James.Diss

Is there any debug code I can throw into the controller to expose
whether things are being passed?  I'm kinda of completely in the dark
because I know it should be working.



On Nov 22, 4:36 pm, "James.Diss" <[EMAIL PROTECTED]> wrote:
> I actually tried this first in an effort to get it working.
>
> Currently the model for 'Post' looks like;
>
> //      app/models/Post.php
> class Post extends AppModel {
>         var $name = 'Post';
>         var $validate = array();
>         var $belongsTo = array('User'=>array
> ('className'=>'User','foreignKey'=>'user_id'));
>
> }
>
> The model for 'User' looks like;
>
> //      app/models/User.php
> class User extends AppModel {
>         var $name = 'User';
>         var $validate = array();
>         var $hasMany = array('Post');
>
> }
>
> The thing is that I suspect that I'm keeping to the conventions with
> the following DDLs;
>
> CREATE TABLE `users` (
>   `id` int(11) unsigned NOT NULL auto_increment,
>   `name` varchar(100) default NULL,
>   `email` varchar(150) default NULL,
>   `firstname` varchar(60) default NULL,
>   `lastname` varchar(60) default NULL,
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
>
> CREATE TABLE `posts` (
>   `id` int(11) unsigned NOT NULL auto_increment,
>   `name` varchar(255) default NULL,
>   `date` datetime default NULL,
>   `content` text,
>   `user_id` int(11) default NULL,
>   PRIMARY KEY  (`id`),
>   KEY `user_id` (`user_id`)
> ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
>
> (before anyone points out the index 'user_id' after the primary key,
> it's not that, I checked.  I would have been disappointed if an index
> threw things out of kilter, though)
>
> At this moment I'm leaning towards something being wrong with the
> install, and I'm humble enough to think it's PHP/Apache2.  Is there
> any configuration in either of those can stop associations being made?
> (Although they're both as vanilla as possible for deploying code on
> live servers)
>
> TIA
>
> On Nov 22, 3:42 pm, Rob <[EMAIL PROTECTED]> wrote:
>
> > You probably want to add the foreigh_key to your hasMany and
> > belongsTo, especially if they don't follow the cake conventions.
>
> > In my models, I have ID columns like 'user_id', and the foreign_key is
> > typically the same name, so for instance in my Users to Groups
> > relationship I have something like:
>
> > // Users model ...
> >     var $hasMany = array(
> >         'UserGroup' => array(
> >             'className'     => 'UserGroup',
> >             'foreignKey'    => 'user_id',
> >             'limit'         => '5',
> >             'dependent'     => true
> >         )
> >     );
>
> >     // Link to groups
> >     var $hasAndBelongsToMany = array(
> >         'Group' =>
> >         array(
> >                 'className'             => 'Group',
> >                 'joinTable'             => 'user_groups',
> >                 'foreignKey'            => 'user_id',
> >                 'associationForeignKey' => 'group_id',
> >                 'conditions'            => '',
> >                 'order'                 => '',
> >                 'limit'                 => '',
> >                 'unique'                => true,
> >                 'finderQuery'           => '',
> >                 'deleteQuery'           => '',
> >                 'insertQuery'           => ''
> >         )
> >     );
>
> > // Groups model
> >     var $hasMany = array(
> >         'UserGroup' => array(
> >             'className'     => 'UserGroup',
> >             'foreignKey'    => 'group_id',
> >             'limit'         => '5',
> >             'dependent'     => true
> >         )
> >     );
>
> >     // Link to users
> >     var $hasAndBelongsToMany = array(
> >         'User' =>
> >             array(
> >                 'className'             => 'User',
> >                 'joinTable'             => 'user_groups',
> >                 'foreignKey'            => 'group_id',
> >                 'associationForeignKey' => 'user_id',
> >                 'conditions'            => '',
> >                 'order'                 => '',
> >                 'limit'                 => '',
> >                 'unique'                => true,
> >                 'finderQuery'           => '',
> >                 'deleteQuery'           => '',
> >                 'insertQuery'           => ''
> >         )
> >     );
>
> > On Nov 22, 9:45 am, "James.Diss" <[EMAIL PROTECTED]> wrote:
>
> > > The failing isn't really in understanding the relationships, just
> > > something odd is happening that I want to get a perspective on as a
> > > beginner.
>
> > > I have two models with backing database tables.  The models are;
>
> > > //      app/models/User.php
> > > class User extends AppModel {
> > >         var $name = 'User';
> > >         var $validate = array();
> > >         var $hasMany = array('Post');
>
> > > }
>
> > > //      app/models/Post.php
> > > class Post extends AppModel {
> >

Re: Ajax "link" not updating "div" with "ctp" template

2008-11-22 Thread pkclarke

Thanks for your help Kyo.  I've implemented your suggestions & also
added the "render()" function (see below).  However I must be missing
something, as it is still not returning the content to the main
template.

Main Template (login.ctp):
<

  replace this


link('Click here', null, array('url' => 'updatecontent',
'update' => 'testcontent'));
?>
>

Main Controller (users_controller.php):
<
function updatecontent() {
  $this->layout='ajax';
  if ($this->RequestHandler->isAjax()) {
$this->set('content', 'sample content');
$this->render('updatecontent', 'ajax' );
  }
}
>

Ajax content template (updatecontent.ctp):
<

>

Again, thanks for any assistance in advance.

--~--~-~--~~~---~--~~
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: Just getting started and have a problem with relationships

2008-11-22 Thread James.Diss

I actually tried this first in an effort to get it working.

Currently the model for 'Post' looks like;

//  app/models/Post.php
class Post extends AppModel {
var $name = 'Post';
var $validate = array();
var $belongsTo = array('User'=>array
('className'=>'User','foreignKey'=>'user_id'));
}

The model for 'User' looks like;

//  app/models/User.php
class User extends AppModel {
var $name = 'User';
var $validate = array();
var $hasMany = array('Post');
}

The thing is that I suspect that I'm keeping to the conventions with
the following DDLs;

CREATE TABLE `users` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `name` varchar(100) default NULL,
  `email` varchar(150) default NULL,
  `firstname` varchar(60) default NULL,
  `lastname` varchar(60) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

CREATE TABLE `posts` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `name` varchar(255) default NULL,
  `date` datetime default NULL,
  `content` text,
  `user_id` int(11) default NULL,
  PRIMARY KEY  (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

(before anyone points out the index 'user_id' after the primary key,
it's not that, I checked.  I would have been disappointed if an index
threw things out of kilter, though)

At this moment I'm leaning towards something being wrong with the
install, and I'm humble enough to think it's PHP/Apache2.  Is there
any configuration in either of those can stop associations being made?
(Although they're both as vanilla as possible for deploying code on
live servers)

TIA

On Nov 22, 3:42 pm, Rob <[EMAIL PROTECTED]> wrote:
> You probably want to add the foreigh_key to your hasMany and
> belongsTo, especially if they don't follow the cake conventions.
>
> In my models, I have ID columns like 'user_id', and the foreign_key is
> typically the same name, so for instance in my Users to Groups
> relationship I have something like:
>
> // Users model ...
>     var $hasMany = array(
>         'UserGroup' => array(
>             'className'     => 'UserGroup',
>             'foreignKey'    => 'user_id',
>             'limit'         => '5',
>             'dependent'     => true
>         )
>     );
>
>     // Link to groups
>     var $hasAndBelongsToMany = array(
>         'Group' =>
>         array(
>                 'className'             => 'Group',
>                 'joinTable'             => 'user_groups',
>                 'foreignKey'            => 'user_id',
>                 'associationForeignKey' => 'group_id',
>                 'conditions'            => '',
>                 'order'                 => '',
>                 'limit'                 => '',
>                 'unique'                => true,
>                 'finderQuery'           => '',
>                 'deleteQuery'           => '',
>                 'insertQuery'           => ''
>         )
>     );
>
> // Groups model
>     var $hasMany = array(
>         'UserGroup' => array(
>             'className'     => 'UserGroup',
>             'foreignKey'    => 'group_id',
>             'limit'         => '5',
>             'dependent'     => true
>         )
>     );
>
>     // Link to users
>     var $hasAndBelongsToMany = array(
>         'User' =>
>             array(
>                 'className'             => 'User',
>                 'joinTable'             => 'user_groups',
>                 'foreignKey'            => 'group_id',
>                 'associationForeignKey' => 'user_id',
>                 'conditions'            => '',
>                 'order'                 => '',
>                 'limit'                 => '',
>                 'unique'                => true,
>                 'finderQuery'           => '',
>                 'deleteQuery'           => '',
>                 'insertQuery'           => ''
>         )
>     );
>
> On Nov 22, 9:45 am, "James.Diss" <[EMAIL PROTECTED]> wrote:
>
> > The failing isn't really in understanding the relationships, just
> > something odd is happening that I want to get a perspective on as a
> > beginner.
>
> > I have two models with backing database tables.  The models are;
>
> > //      app/models/User.php
> > class User extends AppModel {
> >         var $name = 'User';
> >         var $validate = array();
> >         var $hasMany = array('Post');
>
> > }
>
> > //      app/models/Post.php
> > class Post extends AppModel {
> >         var $name = 'Post';
> >         var $validate = array();
> >         var $belongsTo = array('User');
>
> > }
>
> > I also have two controllers that basically use the scaffold.  The
> > users controller does what it's supposed to do, but hitting the post
> > controller doesn't show the user select box, which indicates to me
> > that the relationship isn't being built. The foreign key in the posts
> > table is 'user_id'.
>
> > As I'm just getting started, I'm at a loss to

Re: Custom query Doubt/problem please help me..

2008-11-22 Thread Takuo Doi

Hi.

The error messages indicates the undifined index of "total". Is it right?

I think you mistake the data structure which Model::query returns.
If you put the statement "print_r ($t);" in the model code, you can 
understand the problem quickly.

The structure of $t is below:
Array
(
 [0] => Array
 (
 [0] => Array
 (
 [total] => 4500
 )
 )
)

Thus, the correct code of model is below:

$totalAmount = $t[0][0]['total'];
return $totalAmount;


Best Wishes,

Takuo Doi

renju wrote:
>  Any body can explain Custom Queries with example...
> My problem is that ..i have two table
> 1)campaigns
> 2)donations
> i need the total amount of particular campaign by using the sql
> query..
> CODE
> SELECT sum(amount) as total FROM `v1_donations` WHERE campaign_id=1
> 
> campaign Model
> CODE
> function getTotalAmount(){
>$t = $this->query("SELECT sum(amount) as total FROM
> `v1_donations` WHERE campaign_id=1");
> $totalAmount = $t[0]['total'];
>  return $totalAmount;
> }
> 
> campaign Controller
> CODE
> function index() {
>$this->Campaign->recursive = 0;
>$t = $this->Campaign->getTotalAmount();
>$this->set('totolAmount',$t);
>$this->set('campaigns', $this->paginate());
>}
> 
> 
> But when i go to the url i am getting the error as
> 
> Undefined index:  amount [APP\models\campaign.php, line 25]
> 
> Error Context
> 
> $t=array(
> array(
> "v1_donations" => array()
> )
> )
> 
> Error Code in
> 
>   $t = $this->query("SELECT amount FROM `v1_donations` WHERE
> campaign_id=1");
>   $totalAmount = $t[0]['total']; //this line is highlighted
> 
> 
> So please help me to solve this problem...
> 
> > 
> 
> 


--~--~-~--~~~---~--~~
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: drop down in cake php

2008-11-22 Thread Rob

You need to describe what it is you are trying to display as a drop-
down. It all depends on your data model and how you baked things.

On Nov 20, 8:32 pm, ammu <[EMAIL PROTECTED]> wrote:
> I'm a newbie in cake php as well as programming..I'm using scaffold in
> my application..and I tried to customize scaffold by creating .ctp
> files in app/view/scaffolds.but it doesn't work.. Is there any way to
> create dropdown from the database values without using scaffold..Plzz
> help me..
--~--~-~--~~~---~--~~
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: How can I view the SQl Serach string?

2008-11-22 Thread Rob

You should be able to use the same approach in the XAMPP environment
that validkeys pointed you to before.

The post was about setting up logging for MySQL, not MAMP specific.

On Nov 21, 4:29 am, "Liebermann, Anja Carolin"
<[EMAIL PROTECTED]> wrote:
> Hi Validkeys,
>
> Unluckily my development environment is a XAMPP. And for obvious reasons I 
> don't want to upload this code on the productive Linux environment. :c)
>
> My find expression is as follows:
>                 $textmaster = $this->Textmaster->find('all',
>                 array(  'condition' => array ('Textmaster.id' => $id),
>                                 'contain'=> array(
>                                         'Textart'=> array(
>                                                         
> 'fields'=>array('id','name'),
>                                                         
> 'conditions'=>array('Textart.id ='=>'Textmaster.textart_id')),
>                                         'Verhoteltextmaster'=> array(
>                                                         
> 'Hotelmaster'=>array('fields'=>array('id','name'),
>                                                         
> 'conditions'=>array('Hotelmaster.id 
> ='=>'Verhoteltextmaster.hotelmaster_id'))),
>                                         'Verorttextmaster'=> array(
>                                                         
> 'Ortmaster'=>array('fields'=>array('id','name'),
>                                                         
> 'conditions'=>array('Ortmaster.id ='=>'Verorttextmaster.ortmaster_id'))),
>                                         'Verzielgebiettextmaster'=> array(
>                                                         
> 'Zielgebietmaster'=>array('fields'=>array('id','name'),
>                                                         
> 'conditions'=>array('Zielgebietmaster.id 
> ='=>'Verzielgebiettextmaster.zielgebietmaster_id'))),
>                                         'Katalogobjekt',
>                                         'Sprache',
>                                         'User'=> array(
>                                                         
> 'fields'=>array('fields'=>array('id','name')))
>                                         )//end contain
>                         )//end conditions etc...
>                 );//end find
>
> Without the conditions I get a huge data array. What I wonder is if the 
> conditions reduce only the final array size in my controller or also the 
> found data by the SELECT query.
>
> My
>
> -Ursprüngliche Nachricht-
> Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von 
> validkeys
> Gesendet: Freitag, 21. November 2008 13:19
> An: CakePHP
> Betreff: Re: How can I view the SQl Serach string?
>
> If you are using 
> MAMP:http://particletree.com/notebook/logging-mysql-queries-on-mamp/
>
> Otherwise, just find your Apache log, open up a *nix terminal, cd to the 
> directory with your mysql_sql.log file and type tail -f mysql_sql.log
>
> That will auto udpate every time a query is passed and you can see everything 
> run through Apache. I am not to sure about the 2nd part of your question. 
> What do you mean "filter"?
>
> On Nov 21, 5:54 am, "Liebermann, Anja Carolin"
>
> <[EMAIL PROTECTED]> wrote:
> > Hi everybody,
>
> > I have a quite complex find request with contain and my memory gets
> > exhausted.
>
> > 2 Questions:
> > Ist: What I would like to know what exact SQL condition is generated.
> > How can I view it before my browser throws the error with the memory?
> > 2nd: Does contain filter the result after or before requesting them?
>
> > Thank you in advance!
>
> > Anja
>
>
--~--~-~--~~~---~--~~
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: CSS formatting not appearing

2008-11-22 Thread Rob

First, I would suggest you get a copy of Firebug - it rocks when
trying to debug CSS issues.

What exactly do you mean 'none of my CSS formats were applied'?

If you left off the punctuation when you modified the #content, that
would break things, but if all you did was to change the first element
in the padding from 0px to 10px, that would only fail if another CSS
tag prevented the change from being applied.

On Nov 21, 12:05 pm, CJL <[EMAIL PROTECTED]> wrote:
> (sorry I hit send by accident)
>
> Below is my original style.css:
>
> #content {
>   clear:both;
>         margin-left: auto;
>         margin-right: auto;
>   padding: 0px 40px 10px 40px;
>   background-color: #fff;
>   color: #333;
>         text-align: left;
>         width: 100%;
>
> Then I just changed the padding to:
>
> padding: 20px 40px 10px 40px
>
> After that, none of my CSS formats were applied.  I went back to the
> style.css file and changed the padding back to the original settings,
> but still none of my CSS formats are appearing.  Any help would be
> greatly appreciated.  Thanks!
>
> On Nov 21, 11:51 am, CJL <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > First off, I'm new to CakePHP and web development in general, so I
> > apologize in advance if my question is a stupid one or has been asked
> > already.  I've read up to chapter 7 in the cookbook, and I'd say I
> > understand it on a high level, but can figure out the details if I
> > know where to look.  I've installed CakePHP 1.1 and I am using MAMP.
>
> > Problem: My CSS formatting is not appearing, but what's strange is
> > that it worked at first, then I made a tiny change to a padding
> > argument, and now all my formatting is gone.  Below is my app/views/
> > layouts/default.thtml:
>
> > 
> > 
> > 
> > My Page -- 
> > 
> > 
> > 
> > 
> > 
> > 
>
> > 
> >         
> >                 
> >                         image('logo.jpg')?>
> >                 
> >                 
> >                           renderElement('menu', 
> > array('key'=>'val'))?>
> >                 
>
> >                 
> >                         flash();?>
> >                 
>
> >                 
> >                         
> >                 
> >         
> >         
> > 
>
> > 
> > 
>
> > So initially, like I said, my CSS worked.  I wanted to mess around and
> > change my #content in the CSS file.  Below is the original style.css:
>
>
--~--~-~--~~~---~--~~
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: Just getting started and have a problem with relationships

2008-11-22 Thread Rob

You probably want to add the foreigh_key to your hasMany and
belongsTo, especially if they don't follow the cake conventions.

In my models, I have ID columns like 'user_id', and the foreign_key is
typically the same name, so for instance in my Users to Groups
relationship I have something like:

// Users model ...
var $hasMany = array(
'UserGroup' => array(
'className' => 'UserGroup',
'foreignKey'=> 'user_id',
'limit' => '5',
'dependent' => true
)
);

// Link to groups
var $hasAndBelongsToMany = array(
'Group' =>
array(
'className' => 'Group',
'joinTable' => 'user_groups',
'foreignKey'=> 'user_id',
'associationForeignKey' => 'group_id',
'conditions'=> '',
'order' => '',
'limit' => '',
'unique'=> true,
'finderQuery'   => '',
'deleteQuery'   => '',
'insertQuery'   => ''
)
);


// Groups model
var $hasMany = array(
'UserGroup' => array(
'className' => 'UserGroup',
'foreignKey'=> 'group_id',
'limit' => '5',
'dependent' => true
)
);

// Link to users
var $hasAndBelongsToMany = array(
'User' =>
array(
'className' => 'User',
'joinTable' => 'user_groups',
'foreignKey'=> 'group_id',
'associationForeignKey' => 'user_id',
'conditions'=> '',
'order' => '',
'limit' => '',
'unique'=> true,
'finderQuery'   => '',
'deleteQuery'   => '',
'insertQuery'   => ''
)
);



On Nov 22, 9:45 am, "James.Diss" <[EMAIL PROTECTED]> wrote:
> The failing isn't really in understanding the relationships, just
> something odd is happening that I want to get a perspective on as a
> beginner.
>
> I have two models with backing database tables.  The models are;
>
> //      app/models/User.php
> class User extends AppModel {
>         var $name = 'User';
>         var $validate = array();
>         var $hasMany = array('Post');
>
> }
>
> //      app/models/Post.php
> class Post extends AppModel {
>         var $name = 'Post';
>         var $validate = array();
>         var $belongsTo = array('User');
>
> }
>
> I also have two controllers that basically use the scaffold.  The
> users controller does what it's supposed to do, but hitting the post
> controller doesn't show the user select box, which indicates to me
> that the relationship isn't being built. The foreign key in the posts
> table is 'user_id'.
>
> As I'm just getting started, I'm at a loss to debug what appears to be
> a very basic piece of code.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Custom query Doubt/problem please help me..

2008-11-22 Thread renju

 Any body can explain Custom Queries with example...
My problem is that ..i have two table
1)campaigns
2)donations
i need the total amount of particular campaign by using the sql
query..
CODE
SELECT sum(amount) as total FROM `v1_donations` WHERE campaign_id=1

campaign Model
CODE
function getTotalAmount(){
   $t = $this->query("SELECT sum(amount) as total FROM
`v1_donations` WHERE campaign_id=1");
$totalAmount = $t[0]['total'];
 return $totalAmount;
}

campaign Controller
CODE
function index() {
   $this->Campaign->recursive = 0;
   $t = $this->Campaign->getTotalAmount();
   $this->set('totolAmount',$t);
   $this->set('campaigns', $this->paginate());
   }


But when i go to the url i am getting the error as

Undefined index:  amount [APP\models\campaign.php, line 25]

Error Context

$t=array(
array(
"v1_donations" => array()
)
)

Error Code in

  $t = $this->query("SELECT amount FROM `v1_donations` WHERE
campaign_id=1");
  $totalAmount = $t[0]['total']; //this line is highlighted


So please help me to solve this problem...

--~--~-~--~~~---~--~~
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: Email layouts not working

2008-11-22 Thread RyOnLife


Ah! Thanks Adam.
-- 
View this message in context: 
http://n2.nabble.com/Email-layouts-not-working-tp1564302p1566470.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
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: OT: PHP IDE with GIT and SVN Plugins

2008-11-22 Thread Rob

I use NetBeans which has nice PHP support, and there is a Git plugin
available for it as well (http://nbgit.org/)

Personally I like it better than Eclipse because it comes with most
everything that I need for web development. They have Cake on their
radar as one of the next things they want to add support for.

On Nov 21, 2:23 am, Penfold <[EMAIL PROTECTED]> wrote:
> With the announcement of the release of the cakephp book source code
> on chaw.com which is a GIT repository,
> has posed an issue, I currently use easyeclipse for my IDE using a SVN
> Repository for my code.
>
> With the possibility of future projects along with future release of
> Cake and Bakery using Chaw.com.
> My research so far had lead me to the conclusion that the is not a GIT
> plugin available for eclipse.
>
> I'm currently using windows but i can swap to linux if there is a IDE
> that can cater for my needs.
> I'm now on the hunt for an OS IDE that can support SVN and GIT, can
> anyone recommend one?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Create/Update multiple records from one form

2008-11-22 Thread WildFoxMedia


I am working on a website for a fleet company. The vehicles will all show up
up a 31 day calendar with there respective personnel and tasks.

My issue right now is that they would like forms for all of there vehicles
to show up on the form for each day. For instance, every day will have an
edit page where you will be able to see all of the vehicles, each with there
own respective forms for personnel assigned and tasks.

What is the best way to go about this as it doesnt seem that I can really
follow the standard Cake guidelines given that they essentially want to mash
4-5 seperate forms into one page that will all POST at the same time.

Thank you
-- 
View this message in context: 
http://www.nabble.com/Create-Update-multiple-records-from-one-form-tp20640161p20640161.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
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: Migration to Cake 1.2

2008-11-22 Thread Lakshmi
Hi Kyo,

Thanks for the suggestion.  Appreciate if we could know how long it may take
for this stable release.  Lot of our plans and timelines for this project
based on the assumption of cake we take.

Regards,
Lakshmi

On Sat, Nov 22, 2008 at 10:12 PM, Kyo <[EMAIL PROTECTED]> wrote:

>
> The Cookbook is a good place to start migrating.
> http://book.cakephp.org/view/581/Possible-Migration-Approach
>
> I don't see any major problems with the current version of Cake.
> Do just replace the cake core folder when CakePHP 1.2 stable is ready.
> I think it's only a matter of time.
>
> hth
> >
>

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



Just getting started and have a problem with relationships

2008-11-22 Thread James.Diss

The failing isn't really in understanding the relationships, just
something odd is happening that I want to get a perspective on as a
beginner.

I have two models with backing database tables.  The models are;

//  app/models/User.php
class User extends AppModel {
var $name = 'User';
var $validate = array();
var $hasMany = array('Post');
}

//  app/models/Post.php
class Post extends AppModel {
var $name = 'Post';
var $validate = array();
var $belongsTo = array('User');
}

I also have two controllers that basically use the scaffold.  The
users controller does what it's supposed to do, but hitting the post
controller doesn't show the user select box, which indicates to me
that the relationship isn't being built. The foreign key in the posts
table is 'user_id'.

As I'm just getting started, I'm at a loss to debug what appears to be
a very basic piece of code.


--~--~-~--~~~---~--~~
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: Associations with Conditions and multiple Databases

2008-11-22 Thread jmmg77

Okay, I think I know why this is happening.  Cake doesn't assume that
the databases are all on the same server and have the same credentials
so it doesn't create multiple database queries like:

SELECT local.shoes.name, global.shoebrands.name FROM local.shoes LEFT
JOIN global.shoebrands ON global.shoebrands.id =
local.shoebrands.shoebrand_id WHERE global.shoebrands.name LIKE '%nike
%'

It seems that it just drops anything from the query that isn't in the
same database as the primary model being searched.

My question now is more specific.  Is there some way to override this
behavior without hacking cakephp's core?  I tried actually putting the
database name in the prefix in the database config file, but this is
only a prefix for table names.  Again, I can see why cakephp does this
by default, but there must be some way to specify that these databases
belong together.

Has anyone gotten this to work?

I appreciate any help on this issue.

Thank You.

On Nov 21, 9:07 am, jmmg77 <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have been trying to figure this one out for a while.  When I do
> findAll and try to filter by another associated model it works fine
> unless that model is in another database.
>
> Instead of HABTM, I'm using hasMany and belongsTo.  Still, when I try
> to filter by a model in another database, I get an error.  When I read
> the SQL being generated it became obvious why this isn't working.  For
> some reason, all models in the first database are in the query, but
> any models in another database are totally excluded from the query.
>
> These models that don't show up in the query still show up in the
> results.
>
> An example would be like this.
>
> DB1: local
> DB2: global
>
> I've got models "individuals", "shoes", "individualshoes" in the local
> database.
> Then, I've go models "shoetypes", "shoebrands" in the global database.
>
> My dilema is this: How do I perform a findAll on individuals with
> conditions like this "shoebrands.name LIKE '%nike%'".
>
> I realize that in this example, I would be better off filtering by
> shoes.shoebrand_id, but for what I'm doing I need my example to work.
>
> Basically this example just won't work any way I try unless shoebrands
> is in the local database too.  Again, I'm not using habtm because I've
> found it impossible to filter by different models at all that way.  I
> am using hasMany, hasOne and belongsTo where appropriate.  I am also
> using $useDbConfig.
--~--~-~--~~~---~--~~
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: Migration to Cake 1.2

2008-11-22 Thread Kyo

The Cookbook is a good place to start migrating.
http://book.cakephp.org/view/581/Possible-Migration-Approach

I don't see any major problems with the current version of Cake.
Do just replace the cake core folder when CakePHP 1.2 stable is ready.
I think it's only a matter of time.

hth
--~--~-~--~~~---~--~~
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: Ajax "link" not updating "div" with "ctp" template

2008-11-22 Thread Kyo

Your update_content method should look like:

function update_content() {
$this->layout="ajax";
if ($this->RequestHandler->isAjax()) {
$this->set('your_variable', 'sample content');
}
}

Besides, if you are using cake's default layout, it contains  already. The update div's id must be replaced with
something unique.

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



Migration to Cake 1.2

2008-11-22 Thread Lakshmi
Hi,

We have been using Cake PHP version 1.13 for our application which is
stable.  We now plan to revamp the apllication to have the same
functionalities.  We want to take this opportunity to also look at upgrading
our version of cake to 1.2 version.  We request the gurus in this to give us
their views about the following:

   1. Is this something advisable?
   2. What are the features that have been revamped and we need to take
   care?
   3. Where would be get help to check on how to upgrade with minimum
   effort?
   4. What is the date that has been decided for a stable release of Cake
   PHP 1.2?  We are looking at starting development mid december for the
   revamp, would cake stable version of 1.2 be released by then?

Do let us know your views and is there anything that has been missed out
when we do a migration.

Thank you all in advance for the help and suggestions.  We are sure that an
answer to this thread will help a lot of members who have the same query but
have not raised it.

Regards,
Lakshmi

--~--~-~--~~~---~--~~
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: Sementation fault with $uses variable in app_controller

2008-11-22 Thread AD7six



On Nov 22, 5:36 am, docwondergroup <[EMAIL PROTECTED]> wrote:
> Tonight, my Apache instance (OSX 10.5.5 Apache/2.2.9 (Unix) mod_ssl/
> 2.2.9 OpenSSL/0.9.7l DAV/2 PHP/5.2.5  CakePHP 1.2.0.7692 RC3) threw a
> segmentation fault when I tried to use one of my Models from the
> app_controller. In my code, this is how I had this setup:
>
> class AppController extends Controller {
>         var $helpers = array('Html', 'Javascript', 'ForLayout', 'Tree');
>         var $components = array('Session', 'obAuth', 'Cookie');
>         var $uses = array('Contentpage'); /* THIS IS THE OFFENDING LINE */
> ...
>
> }
>
> I discovered this by systematically commenting out every piece of code
> that was implementing my Contentpage model. When I commented out the
> $uses variable, the segmentation fault went away.
>
> So now my code reads like this to remind me.
>
> class AppController extends Controller {
>         var $helpers = array('Html', 'Javascript', 'ForLayout', 'Tree');
>         var $components = array('Session', 'obAuth', 'Cookie');
>         /*
>          * WARNING!!! THIS CAUSES A SEGMENTATION FAULT!! DO NOT USE!!!
>          * var $uses = array('Contentpage');
>          *
>          */
> ...
>
> }

More than likely, defining uses in your app controller (which
generally speaking, is a bad idea anyway) is triggering an error, the
error process creates a new controller which triggers the same error
again ad infinitum - seg fault.


>
> I've seen some issues in the CakePHP trac regarding segmentation
> faults, but nothing of this exact same nature.
>
> As a side note, I thought I would try to use it from another
> controller. Initially this worked fine, but when it ran functions
> inside of obAuth, I got very unpredictable results. I'm still not
> really sure exactly what the nature of that error was. While I was
> debugging this, the segmentation fault started up again.

Some other kind of error loop.

> At any rate, I found a way to work around this so it doesn't hinder my
> work by putting a different layout on the controllers and actions that
> I originally wanted this functionality to execute on.

You can probably now draw a conclusion as to why given ^^ and .

> However, I'm not
> sure what I'll do if I need a Model available to the app controller.

Your app controller is in principle an abstract class, what are you
trying to put in it?

AD
--~--~-~--~~~---~--~~
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: Working with forms for CMS

2008-11-22 Thread Jon Bennett

>  1. The value appears to be set early on the life of the model, so
>  overriding afterwards has no affect on the fields array cake uses for
>  form->inputs().

'The value' of SCHEMA! crucial piece of info forgotten there!

j

-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
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: Working with forms for CMS

2008-11-22 Thread Jon Bennett

Hi Flipflops,

>  >  class FormsController extends AppController {
>  >
>  > var $name = 'Forms';
>  >
>  > /**
>  > * a generic method to handle the submited forms
>  > * looks up a schema / and validation rules based on the id of the
>  >  formthis-
>  > */
>  > submit_handler(){
>  >
>  > if(isset($this->data)){
>  >
>  > $id = $this->data['Form']['id'];
>  > // get all the data about the form
>  > $meta = $this->Form->read(null, $id)
>  > // set the validation array we want to use
>  > $this->Form->validate = $meta['validation_rules'];
>  >
>  > if ($this->Form->validates()) {
>  > // it validated logic
>  > } else {
>  > // didn't validate logic
>  > }
>  > }
>  > }
>  >  }
>  >

I've now had a little play, and I don't think it's possible, at least
now how we'd imagined. So far I've hit on 2 problems.

1. The value appears to be set early on the life of the model, so
overriding afterwards has no affect on the fields array cake uses for
form->inputs().
2. When I attempt to set the validation rules, although the array is
passed, it appears to be doing a merge of sorts, as I get
'array_key_exists' errrors, I think because I have 2 'name' fields,
one for the default rules used when adding a new sign up form, and one
in my custom rules.

I've compressed the files up in case anyone wants to have a bash at
this http://www.jben.net/temp/form_app.zip . I think I'm going to have
to go for a lower-tech solution, at least for now.

Thanks,

Jon

-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
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: Sementation fault with $uses variable in app_controller

2008-11-22 Thread Marcelo Andrade
On Sat, Nov 22, 2008 at 1:36 AM, docwondergroup
<[EMAIL PROTECTED]> wrote:
> (..)

Reinstall or recompile your Apache with php support.

Best regards.
--
MARCELO DE F. ANDRADE (aka "eleKtron")
Belem, PA, Amazonia, Brazil
Linux User #221105

[EMAIL PROTECTED] ~]# links http://pa.slackwarebrasil.org/

--~--~-~--~~~---~--~~
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: the screencast quicktime videos are not playing

2008-11-22 Thread XefNed


Try waiting for the whole thing to load, then saving the .mov file to
your desktop.

That helped in my case where I could hear no audio in the browser
window - but it played just fine from my desktop.


On Nov 22, 4:22 am, xfhxfh <[EMAIL PROTECTED]> wrote:
> ... I've installed the latest quicktime on my WinXP but the
> screencasts are still not playing ...
> any suggestion how I can get this to work ?
>
> Regards,
> F.
--~--~-~--~~~---~--~~
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: Problems installing phpGACL for CakePHP 1.2

2008-11-22 Thread gunung pangrango
i'm now currently working with cake 1.2 RC3...
i guest phpgacl doesn't work with that cake version...

--~--~-~--~~~---~--~~
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: Strange problem with App:Import of controller class

2008-11-22 Thread Daniel Hofstetter

Hi Alex,

> I have two controller classes:
> class PagesController extends AppController {
> (...)
>     function home() {
>         App::import('Controller', 'NewsPosts');
>         $controller = new NewsPostsController();
>         $this->set('NewsGrouped', $controller->_getNewsGrouped());
>     }
> (...)}
>
> and
> class NewsPostsController extends AppController {
>     var $name = 'NewsPosts';
>     var $uses = array('NewsPost', 'NewsType');
> (...)
>     function index(){
>         $this->set('NewsGrouped', $this->_getNewsGrouped());
>     }
>     function _getNewsGrouped(){
>         $types = $this->NewsType->find('all', array('conditions' =>
> array('max_num >' => 0),
>                                                     'order' =>
> 'NewsType.order'));
> (...)
>     }
> (...)
>
> }
>
> When I callhttp://mysite/news_posts/index, everything works fine, but
> when I callhttp://mysite, that is mapped to PagesController::home
> action, I get an error:
>         Fatal error: Call to a member function find() on a non-object
> in Z:\home\test1.ru\www\app\controllers\news_posts_controller.php on
> line 24
> I can't really understand that, since I use the same scheme in several
> other places and it works fine everytime. What could be the problem??

Call $controller->constructClasses(); after you create an instance of
the controller with $controller = new NewsPostsController();

Hope that helps!

--
Daniel Hofstetter
http://cakebaker.42dh.com
--~--~-~--~~~---~--~~
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: Session Problem...

2008-11-22 Thread Aneesh S
Thanks Kyo...
Now its showing no probs..

Aneesh S


On Sat, Nov 22, 2008 at 3:56 PM, Kyo <[EMAIL PROTECTED]> wrote:

>
> Set the 'Security.level' to 'medium' in /app/config/core.php
> CakePHP  regenerates session IDs for every request if 'Security.level'
> is set to 'high'.
> >
>

--~--~-~--~~~---~--~~
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: Session Problem...

2008-11-22 Thread Kyo

Set the 'Security.level' to 'medium' in /app/config/core.php
CakePHP  regenerates session IDs for every request if 'Security.level'
is set to 'high'.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



the screencast quicktime videos are not playing

2008-11-22 Thread xfhxfh

... I've installed the latest quicktime on my WinXP but the
screencasts are still not playing ...
any suggestion how I can get this to work ?

Regards,
F.
--~--~-~--~~~---~--~~
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: OT: PHP IDE with GIT and SVN Plugins

2008-11-22 Thread [EMAIL PROTECTED]

How about Emacs?  http://tsgates.cafe24.com/git/git-emacs.html

On Nov 22, 12:39 am, mark_story <[EMAIL PROTECTED]> wrote:
> Eclipse should do everything you need.  However, I heard the git
> plugin is eclipse 3.4 only.  There is always terminal as well :)
> Outside of eclipse I don't know of any other IDE's that have any Git
> support, except Textmate.
>
> -Mark
>
> On Nov 21, 5:23 am, Penfold <[EMAIL PROTECTED]> wrote:
>
> > With the announcement of the release of the cakephp book source code
> > on chaw.com which is a GIT repository,
> > has posed an issue, I currently use easyeclipse for my IDE using a SVN
> > Repository for my code.
>
> > With the possibility of future projects along with future release of
> > Cake and Bakery using Chaw.com.
> > My research so far had lead me to the conclusion that the is not a GIT
> > plugin available for eclipse.
>
> > I'm currently using windows but i can swap to linux if there is a IDE
> > that can cater for my needs.
> > I'm now on the hunt for an OS IDE that can support SVN and GIT, can
> > anyone recommend one?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Ajax "link" not updating "div" with "ctp" template

2008-11-22 Thread pkclarke

I have a simple template (login.ctp) which includes:
<

  replace this


 'update_content', 'update' => 'content');
  echo $ajax->link('Click here', null, $options);
?>
>

my controller (users_controller.php) includes the following function:
<
function update_content() {
  $content = 'sample content';
}
>

I have another simple template (update_content.ctp):
<

>

When I click on the "Click here" link I expect the "content" div to be
changed from "replace this" to "content: sample content".  However, it
is replaced with nothing (i.e. "replace this" disappears, but is not
replaced").  Ajax is obviously working (or nothing would happen),
however the "update_content.ctp" is not being returned.  What am I
doing wrong?

Thanks for any assistance in advance.

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



Sementation fault with $uses variable in app_controller

2008-11-22 Thread docwondergroup

Tonight, my Apache instance (OSX 10.5.5 Apache/2.2.9 (Unix) mod_ssl/
2.2.9 OpenSSL/0.9.7l DAV/2 PHP/5.2.5  CakePHP 1.2.0.7692 RC3) threw a
segmentation fault when I tried to use one of my Models from the
app_controller. In my code, this is how I had this setup:

class AppController extends Controller {
var $helpers = array('Html', 'Javascript', 'ForLayout', 'Tree');
var $components = array('Session', 'obAuth', 'Cookie');
var $uses = array('Contentpage'); /* THIS IS THE OFFENDING LINE */
...
}


I discovered this by systematically commenting out every piece of code
that was implementing my Contentpage model. When I commented out the
$uses variable, the segmentation fault went away.

So now my code reads like this to remind me.

class AppController extends Controller {
var $helpers = array('Html', 'Javascript', 'ForLayout', 'Tree');
var $components = array('Session', 'obAuth', 'Cookie');
/*
 * WARNING!!! THIS CAUSES A SEGMENTATION FAULT!! DO NOT USE!!!
 * var $uses = array('Contentpage');
 *
 */
...
}


I've seen some issues in the CakePHP trac regarding segmentation
faults, but nothing of this exact same nature.

As a side note, I thought I would try to use it from another
controller. Initially this worked fine, but when it ran functions
inside of obAuth, I got very unpredictable results. I'm still not
really sure exactly what the nature of that error was. While I was
debugging this, the segmentation fault started up again.

At any rate, I found a way to work around this so it doesn't hinder my
work by putting a different layout on the controllers and actions that
I originally wanted this functionality to execute on. However, I'm not
sure what I'll do if I need a Model available to the app controller.

Has anyone else had this issue?

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



Strange problem with App:Import of controller class

2008-11-22 Thread Alex, the Marrch Ca'at

I have two controller classes:
class PagesController extends AppController {
(...)
function home() {
App::import('Controller', 'NewsPosts');
$controller = new NewsPostsController();
$this->set('NewsGrouped', $controller->_getNewsGrouped());
}
(...)
}
and
class NewsPostsController extends AppController {
var $name = 'NewsPosts';
var $uses = array('NewsPost', 'NewsType');
(...)
function index(){
$this->set('NewsGrouped', $this->_getNewsGrouped());
}
function _getNewsGrouped(){
$types = $this->NewsType->find('all', array('conditions' =>
array('max_num >' => 0),
'order' =>
'NewsType.order'));
(...)
}
(...)
}

When I call http://mysite/news_posts/index, everything works fine, but
when I call http://mysite, that is mapped to PagesController::home
action, I get an error:
Fatal error: Call to a member function find() on a non-object
in Z:\home\test1.ru\www\app\controllers\news_posts_controller.php on
line 24
I can't really understand that, since I use the same scheme in several
other places and it works fine everytime. What could be the problem??

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