Re: getting an SQL error with this code

2007-08-21 Thread AD7six



On Aug 22, 1:15 am, rtanz <[EMAIL PROTECTED]> wrote:
> hi anyone can help me figure out why im having this error
>
> Query: changestatus

The method changestatus isn't in the model (look at your brackets)

hth

AD


--~--~-~--~~~---~--~~
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: Kae's filemanager - FCKeditor - $_SERVER['DOCUMENT_ROOT'] problem

2007-08-21 Thread double07

Nevermind, got this sorted out.

On Aug 21, 9:02 am, double07 <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm trying to configure Kae's filemanager (http://kfm.verens.com/) for
> FCKeditor and I'm having a problem with cake. You can see my post over
> at the KFM forums (http://kfm.verens.com/phpBB3/viewtopic.php?
> f=2&t=152) that the developer is saying $_SERVER['DOCUMENT_ROOT'] is
> not returning a path. On my testing server at home it works fine but
> on my production server I'm getting the errors. Also on a non cake
> site on the same server KFM works fine.
>
> Is anybody familiar with these apps/plugins and does anyone know what
> could be causing this?
>
> TIA - Brett.


--~--~-~--~~~---~--~~
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: Oracle Driver problem for delete

2007-08-21 Thread [EMAIL PROTECTED]

Same here - no answer yet.
Although i have overwritten the connection $config variables with a
string in dbo_oracle.php

Still searching...

On Jul 24, 5:09 am, starkey <[EMAIL PROTECTED]> wrote:
> I've traced the code, trying to figure out the cause of this issue.
> If anyone can help clarify this I sure would appreciate it.  It
> appears that the wrong fetchRow method is getting called from
> DboSource.  Inside DboSource's hasAny method it creates an SQL query
> and calls fetchRow:
> $this->fetchRow( SQL );
> and instead of branching to DboSource's fetchRow method (which expects
> an SQL statement) it is going to the overloaded fetchRow in DboOracle
> which does not expect any parameters.  So the query getting passed to
> fetchRow isn't getting executed.  This would make perfect sense to me,
> given that DboOracle is the child, however the parameters do not match
> so I'd expect the call to stay in DboSource.
>
> Is anyone else experiencing this?
>
> Thanks!
>
> On Jul 20, 4:51 pm, starkey <[EMAIL PROTECTED]> wrote:
>
> > Hello!  I am a developer at the University of Richmond; we are an
> >Oracleshop.  I am testing Cake for some projects we have planned and
> > am using theOracledriver (the version in 1.2alpha).  To learn Cake's
> > functionality I'm walking through the 15 minute Blog tutorial from the
> > manual.  I am having a problem when trying to delete records.  I've
> > searched the Internet and cakephp.org and have not found a comment
> > anywhere on this problem or a trac item so I figure I'm doing
> > something wrong.  I'd be grateful if someone would enlighten me.
>
> > This is what appears to happen:
> > posts_controller.php calls Post->del($id)
> > model_php5.php del() method calls exists()
> >  exists() calls hasAny()
> > dbo_source.php hasAny() method calls fetchRow()
> > dbo_oracle.php fetchRow() method starts with the following line
> > if ($this->_currentRow >= $this->_numRows) {
> > Problem: Both _currentRow and _numRows are empty so fetchRow returns
> > false.  This is before any count(*) query has been executed and the
> > record is never deleted.
>
> > Here is the output when trying to delete a post:
> > Warning: ocifreestatement(): 43 is not a valid oci8 statement resource
> > in /WWW/external/devphpfw1/cake/cake/libs/model/dbo/dbo_oracle.php on
> > line 323
>
> > Warning: ocifreestatement(): 43 is not a valid oci8 statement resource
> > in /WWW/external/devphpfw1/cake/cake/libs/model/dbo/dbo_oracle.php on
> > line 323
>
> > The post with id: 4 has been deleted.
>
> > 3 queries took 253 ms NrQuery   Error   AffectedNum. rows   
> > Took (ms)
> > 1   ALTER SESSION SET NLS_DATE_FORMAT='-MM-DD HH24:MI:SS'   
> > 0   2
> > 2   SELECT view_name AS name FROM user_views UNION SELECT table_name AS
> > name FROM user_tables   3   3   246
> > 3   SELECT COLUMN_NAME, DATA_TYPE FROM user_tab_columns WHERE table_name
> > = 'POSTS'   5   5   5
>
> > Thank you for any assistance!
> > Shawn


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



trying first scaffold with notes

2007-08-21 Thread jvandal

Hi,
I am running Win XP Pro and wamp(PHP, mysql, and Apache).
I installed cake in D:\wamp\www\cake. I run and get cakephp default
page. I create note.php for models, and notes_controller.php in
controller. I run d:/localhost/cake/notes/. (I have alias set up for
this as D:/wamp/www/cake/amp/). I can get the directory displayed in
the firefox page. I can't get it to run and create the files using
scaffolding. I uncommented the LoadModule andadded the AddModule but
the restart of services hangs up.

JIM


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



HELP! - Need some help with Jake

2007-08-21 Thread bkarnes

I have installed Jake onto a test server (MAMP - Mac) as per the Jake
site (along with Joomla and Cake).  I can't get anything to show up
within my Joomla install.  I get nothing.  I have seen the Demo site
for Jake with Cheesecake, but I am at a loss as to what I am doing
wrong.  I have searched Google, Yahoo and this group for anything
having to do with Jake.  Is there no one out there using it?  I think
it is a pretty sweet set up (if I could get it working).

I have tried and gotten some of my application set up with the newer
com_cake component (but man, do I have to change a lot of stuff), so I
assume I am doing something correct, but what?

Anyway, if either of the developers (for the com_cake or Jake
component) are listening, can someone please explain the set up/ see
what I am doing wrong?  I am using:
Joomla - 1.0.13
CakePHP - 1.1.16.5421
PHP - 5.2.1
MySql - 5.0.37

Thanks.
--BLK


--~--~-~--~~~---~--~~
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: Need a mentor

2007-08-21 Thread Geoff Ford

One of the best places for mentoring is the IRC channel.  A lot of
cake gurus spend some time in there on a regular basis.

Geoff
--
http://lemoncake.wordpress.com

On Aug 22, 8:21 am, Bravo_Kernel <[EMAIL PROTECTED]> wrote:
> Hook me up too. I could use a kickstart as well ;)
>
> On 21 aug, 22:33, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
> > Baz,
>
> > Sure thing. We'll have to figure out some time where all of us can
> > meet [online] and talk about Cake.
>
> > Steve
>
> > On Aug 21, 12:46 pm, Baz <[EMAIL PROTECTED]> wrote:
>
> > > Hey,
>
> > > Can I piggy back also? I'm generally ok, except with authentication. It's
> > > kicking my butt. The only thing I can get to work is obAuth, but I can see
> > > an application in my not to distant future, where that isn't going to be
> > > enouogh.
> > > --
> > > Baz L
> > > Day In The Life of Bazhttp://www.LifeOfBaz.com/
>
> > > On 8/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > > > Coding with Cake is a piece of cake.
>
> > > > Shoot me an email and I'll help you get started.
>
> > > > Steve
>
> > > > On Aug 20, 1:34 am, Prashant <[EMAIL PROTECTED]> wrote:
> > > > > I need someone to mentor me in Cake PHP. I am finding it bit difficult
> > > > > on my own.
>
> > > > > In return for his time and effort I am willing write code for him at
> > > > > no cost.


--~--~-~--~~~---~--~~
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: problems with saving

2007-08-21 Thread rtanz

ok solved

On Aug 22, 12:03 am, rtanz <[EMAIL PROTECTED]> wrote:
> hi i have the following code set up for my years model, however when i
> try to use the edit function to edit my year it is not changing. any
> idea why this is so? thanks
>
> http://bin.cakephp.org/view/1911162233


--~--~-~--~~~---~--~~
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: Help Needed: Cake Convention on Model Associations and How to Override Them

2007-08-21 Thread anch

Thanks a lot, Coder. I am working with 1.1 too. I will try.

Anch

On Aug 21, 9:07 am, Angry Coder <[EMAIL PROTECTED]> wrote:
> I forgot to mention I am working with Cake 1.1
>
> On Aug 21, 10:05 am, Angry Coder <[EMAIL PROTECTED]> wrote:
>
> > Hi Anch,
>
> > Here are some of the things within the Model class which you can
> > override that may help:
>
> > var $useTable = null;
> > var $displayField = null;
> > var $primaryKey = null;
>
> > 1. $primaryKey variable will allow you to override the column used as
> > the primary key.
>
> > 2. Yes you need specify the details in your associations
>
> > For instance in your Article Model:
>
> > var $hasAndBelongsToMany = array(
> > 'Users' =>
> > array('className' => 'Users',
> > 'joinTable' => 
> > 'user_articles',
> > 'foreignKey' => 
> > 'article_id',
> > 'associationForeignKey' => 
> > 'user_id',
> > 'conditions' => '',
> > 'fields' => '',
> > 'order' => '',
> > 'limit' => '',
> > 'offset' => '',
> > 'unique' => '',
> > 'finderQuery' => '',
> > 'deleteQuery' => '',
> > 'insertQuery' => ''
> > ),
>
> > );
>
> > I left in the other fields you can specify for completeness sake.
>
> > Also if the other field is a auto increment field you can ignore it it
> > should just by populated by the database.
>
> > Cheers,
>
> > Coder
>
> > On Aug 21, 9:30 am, anch <[EMAIL PROTECTED]> wrote:
>
> > > Hi, I am building a CakePHP-based application using all the database
> > > tables built by another application. However, the database tables
> > > related to models are defined differently from CakePHP's convention.
>
> > > We have the following tables: articles, users, ratings for the models:
> > > Article, User, and Rating; the associations among them include the
> > > following, "Article hasOne Rating" and "User hasAndBelongsToMany
> > > Article"
>
> > > I have the following questions:
>
> > > 1. In the articles table, article_id was used as the column name for
> > > the article id (the primary key). When I try to access ratings records
> > > associated with Article, it generated the following error:
>
> > > SQL Error: 1054: Unknown column 'Article.id' in 'on clause' in /var/
> > > www/html/cake/cake/libs/model/datasources/dbo_source.php on line 463
>
> > > I guess CakePHP was expecting the column name to be 'id' in the
> > > articles table. If so, can I work around this problem without changing
> > > the column name?
>
> > > 2. The join table was named as user_articles. According to CakePHP
> > > convention, it should be articles_users. Is there anyway I can
> > > override the CakePHP convention to use user_articles instead? Also
> > > there was an extra field for record id (thus it has three columns: id,
> > > article_id, user_id), can we live with this?
>
> > > Could anybody help me to resolve the above issues to override the
> > > CakePHP convention? Thanks a lot.
>
> > > Best regards,
> > > Anch


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



Ajax problem

2007-08-21 Thread [EMAIL PROTECTED]



Firebug tells me an error : missing } in XML expression
and:Sortable is not defined

I include the files:




This is my view:



'
class='slides'>
image($slide['Photo']['miniaturka'],array('alt'=>
$slide['Photo']['opis'],
 'border'=>'0'));
?>



sortable('sortable_thumbs',
array('ghosting'=>'true',
'constraint'=>'false')); ?>


What i'm doing wrong?

Please help

Stan


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



getting an SQL error with this code

2007-08-21 Thread rtanz

hi anyone can help me figure out why im having this error

Query: changestatus
Warning: SQL Error: 1064: You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the right
syntax to use near 'changestatus' at line 1 in W:\www\cake\cake\libs
\model\datasources\dbo_source.php on line 463

Warning: Cannot modify header information - headers already sent by
(output started at W:\www\cake\cake\basics.php:696) in W:\www\cake\cake
\libs\controller\controller.php on line 447

with this code:

 
($afterdata['Review']
['int_exam_fback']))
{
$conditions = 
array("TaskTemplate.review_field"=>"int_exam_fback");
$tasktemplateid = $this->TaskTemplate-
>find($conditions,"TaskTemplate.id");
$tasktemplateid = $tasktemplateid['TaskTemplate']['id'];
//print_r($tasktemplateid);
$conditions2 =
array("Task.task_template_id"=>"$tasktemplateid","Task.module_id"=>"$moduleid");
$this->changestatus($conditions2);
}

}

function changestatus($conditions2) {
if($this->data = $this->find($conditions2)) {
$this->data['Task']['status']='Complete';
unset($this->data['Task']['modified']);
$this->save($this->data);
}}

?>


--~--~-~--~~~---~--~~
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: new "With" Associations in a HABTM

2007-08-21 Thread Marcin Domanski aka kabturek

Ive read the pdf but i dont expect a pdf to tell me everything ;) and
i know how it worked 2 weeks ago (sorry - vacations ;) from the
beggining of the 'with' existance :)
So 2 weeks ago you had/should create a model for use with 'with' key.
If you would looks at 
http://api.cakephp.org/1.2/dbo__source_8php-source.html#l01108
then everything should be clearer.
greets,


On Aug 20, 6:53 pm, DLMax <[EMAIL PROTECTED]> wrote:
> If you read the PDF, written by phpnut, that doekie linked to, you see
> that no model has to be created for the join-table in the HABTM
> relation.
>
> You can get the HABTM to work like this:
> Post Model:
> 
> class Post extends AppModel {
> var $name='Post';
>
> var $hasAndBelongsToMany = array(
> 'Tag' => array('className' => 'Tag'));
>
> function beforeSave() {
> if(!empty($this->data['Tag'])) {
>   $this->PostTag->save($this->data['Tag']);
>  }
> }
>
> }
>
> Posts Controller:
>  class PostsController extends AppController {
>
> var $name = 'Posts';
> var $helpers = array('Html', 'Form' );
>
> function tags() {
> $this->set('tags', $this->Post->PostTag->findAll());
> }}
>
> ?>
> Tags view:
>  pr($tags);
> foreach ($tags as $tag) :
> echo $tag['Post']['title'];
> echo $tag['Tag']['name'];
> echo $tag['PostTag']['date'];
> endforeach;
> ?>
>
> You can access the date field from the posts_tags table right now, but
> the beforesafe errors on saving a post and the Post and Tag are not
> accessible from the view.
>
> Any further help would be appreciated !
>
> Thanks in advance,
>
> Max
>
> On 20 aug, 10:48, Marcin Domanski aka kabturek <[EMAIL PROTECTED]>
> wrote:
>
> > have you created the model ?
>
> > On Aug 19, 5:04 pm, doekie <[EMAIL PROTECTED]> wrote:
>
> > > In the OCPHP sheets (http://www.cakephp.org/files/OCPHP.pdf) there was
> > > an example of the use of the new "With" Associations in a HABTM. So it
> > > must be easy to get values out-of the join-table in CakePHP 1.2
>
> > > var $hasAndBelongsToMany = array('Tag'=>
> > >   
> > > array('className'=>'Tag','with'=>'TaggedPost'));
>
> > > But i still getting errors like: No class found for the TaggedPost
> > > model...
> > > (The HABTM works without with (join-table-name: posts_tags))
>
> > > Has somebody an example/explanation how it works?


--~--~-~--~~~---~--~~
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: A problem with paths

2007-08-21 Thread Geoff Ford
Have you included the javascript helper in AppController?

Geoff

On 8/21/07, ifcanduela <[EMAIL PROTECTED]> wrote:
>
>
> Thanks, a lot, after some chats with the hosting people, they deleted
> the .htaccess files specified in the blog tutorial and almost
> everything is working now.
>
> I have another problem though, and this time it's related to including
> javascript files. I use
>
> echo $javascript->link('prototype');
>
> to include Prototype in the templates. I've already tried with some
> other methods listed in the API docs. I guess this should add
> something like
>
> 
>
> to the page, but it doesn't. PHP just halts execution of the script
> and the page returned to the browser is 7 lines long -- from the
> doctype declaration to a css link made with $html->link(). If instead
> of the cake code I write the HTML 

problems with saving

2007-08-21 Thread rtanz

hi i have the following code set up for my years model, however when i
try to use the edit function to edit my year it is not changing. any
idea why this is so? thanks

http://bin.cakephp.org/view/1911162233


--~--~-~--~~~---~--~~
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: Need a mentor

2007-08-21 Thread Bravo_Kernel

Hook me up too. I could use a kickstart as well ;)

On 21 aug, 22:33, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Baz,
>
> Sure thing. We'll have to figure out some time where all of us can
> meet [online] and talk about Cake.
>
> Steve
>
> On Aug 21, 12:46 pm, Baz <[EMAIL PROTECTED]> wrote:
>
> > Hey,
>
> > Can I piggy back also? I'm generally ok, except with authentication. It's
> > kicking my butt. The only thing I can get to work is obAuth, but I can see
> > an application in my not to distant future, where that isn't going to be
> > enouogh.
> > --
> > Baz L
> > Day In The Life of Bazhttp://www.LifeOfBaz.com/
>
> > On 8/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > > Coding with Cake is a piece of cake.
>
> > > Shoot me an email and I'll help you get started.
>
> > > Steve
>
> > > On Aug 20, 1:34 am, Prashant <[EMAIL PROTECTED]> wrote:
> > > > I need someone to mentor me in Cake PHP. I am finding it bit difficult
> > > > on my own.
>
> > > > In return for his time and effort I am willing write code for him at
> > > > no cost.


--~--~-~--~~~---~--~~
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: Need a mentor

2007-08-21 Thread [EMAIL PROTECTED]

Baz,

Sure thing. We'll have to figure out some time where all of us can
meet [online] and talk about Cake.

Steve

On Aug 21, 12:46 pm, Baz <[EMAIL PROTECTED]> wrote:
> Hey,
>
> Can I piggy back also? I'm generally ok, except with authentication. It's
> kicking my butt. The only thing I can get to work is obAuth, but I can see
> an application in my not to distant future, where that isn't going to be
> enouogh.
> --
> Baz L
> Day In The Life of Bazhttp://www.LifeOfBaz.com/
>
> On 8/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > Coding with Cake is a piece of cake.
>
> > Shoot me an email and I'll help you get started.
>
> > Steve
>
> > On Aug 20, 1:34 am, Prashant <[EMAIL PROTECTED]> wrote:
> > > I need someone to mentor me in Cake PHP. I am finding it bit difficult
> > > on my own.
>
> > > In return for his time and effort I am willing write code for him at
> > > no cost.


--~--~-~--~~~---~--~~
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: Controller.action_name ?

2007-08-21 Thread rtconner

Do you want to use $this->name and $this->action>


On Aug 21, 2:48 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> This method returns me a name of the current controller and its
> action. So in my view in title tag i have for example value like this
> Photos:show
>
> I don't know if something like this exists in Cake PHP ?
>
> On Aug 21, 10:02 pm, LS <[EMAIL PROTECTED]> wrote:
>
> > Don't you mean  ?
>
> > On 21 ago, 15:51, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > > Hello
>
> > > In Ruby on Rails  in my layout i write something like this:
> > > Photos: <%= controller.action_name %> 
>
> > > Any ideas how to do this in CakePHP ?
>
> > > I try do search this in the Api but i cant find something
>
> > > Stachu


--~--~-~--~~~---~--~~
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: Controller.action_name ?

2007-08-21 Thread [EMAIL PROTECTED]

This method returns me a name of the current controller and its
action. So in my view in title tag i have for example value like this
Photos:show

I don't know if something like this exists in Cake PHP ?


On Aug 21, 10:02 pm, LS <[EMAIL PROTECTED]> wrote:
> Don't you mean  ?
>
> On 21 ago, 15:51, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > Hello
>
> > In Ruby on Rails  in my layout i write something like this:
> > Photos: <%= controller.action_name %> 
>
> > Any ideas how to do this in CakePHP ?
>
> > I try do search this in the Api but i cant find something
>
> > Stachu


--~--~-~--~~~---~--~~
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: Saving search criteria - Clueless!

2007-08-21 Thread [EMAIL PROTECTED]

Thanks a bunch djiize - I didn't know about serialize. The perfect
solution!

On Aug 21, 4:25 pm, djiize <[EMAIL PROTECTED]> wrote:
> complex way:
> create a table searches with fields for all conditions:
>   id
>   user_id
>   bedrooms
>   price
>   area_id
> and its Model
>
> and save your condition:
> user_id = 2
> bedrooms = 3
> price = 'BETWEEN 500 AND 600'
> area_id = '02,03' // in string format, choose a separator
>
> and:
> // get user conditions from db
> $conditions = $this->Search->read(null, $search_id);
> // convert some fields, would be better in afterFind in Search Model
> $conditions['Search']['area_id'] = explode(',', $conditions['Search']
> ['area_id']); // to recover array from string
> // search properties with conditions
> $properties = $this->Property->findAll($conditions);
>
> I didn't tested this code, but you've the idea.
> Tell me if you have questions
>
> On 21 août, 17:12, djiize <[EMAIL PROTECTED]> wrote:
>
> > simple way:
> > you can serialize your conditions array in a new 
> > fieldhttp://php.net/serialize
> > but beware of future DB modifications (field renaming, etc...)
>
> > On 21 août, 16:00, "[EMAIL PROTECTED]"
>
> > <[EMAIL PROTECTED]> wrote:
> > > I'm building a property site (trying anyway!)
>
> > > I've constructed my search $conditions from the data submitted in the
> > > search form - it gives me an array:
>
> > > Array ( [Letting] => Array ( [bedrooms] => 3 [price] => BETWEEN 500
> > > AND 600 [area_id] => Array ( [0] => 02 [1] => 03 ) ) )
>
> > > which in the SQL request gets converted by CAKE into:
>
> > > WHERE (`bedrooms` = 3) AND (`price` BETWEEN '500' AND '600') AND
> > > (`area_id` IN (02, 03) )
>
> > > but I want to offer the option for the user to save these search
> > > criteria so the site will email new property details to the  user
> > > automagically.
>
> > > If I split the $conditions array apart I'll need to save four or more
> > > separate rows and build logic to reconstruct them when the time comes
> > > to check for new properties.
>
> > > Can I just grab the complete query (without running it) and cram it
> > > into a field?


--~--~-~--~~~---~--~~
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: Controller.action_name ?

2007-08-21 Thread LS

Don't you mean  ?

On 21 ago, 15:51, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hello
>
> In Ruby on Rails  in my layout i write something like this:
> Photos: <%= controller.action_name %> 
>
> Any ideas how to do this in CakePHP ?
>
> I try do search this in the Api but i cant find something
>
> Stachu


--~--~-~--~~~---~--~~
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: new "With" Associations in a HABTM

2007-08-21 Thread Mech7

This pdf looks handy :D am wondering too if this with is allready
functional ?


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



Error with CAKEPHP and CURL

2007-08-21 Thread [EMAIL PROTECTED]

Hi,

New to this group and world of cakePHP and CURL.

I am using XAMPP on my machine

According to the requirements of the authrize.net seen the super power
of XAMPP I  setup the environment and stuff in CAKEPHP php.ini file by
uncommenting the CURL and OPENSSL extensions.

I have the login and key from authorize.net

Next I tried to use the simple authorize.net sample code for PHP on my
side (I had to turn the mod_rewrite off for that) .
The var_dump of $resp (response variable defined in the sample file)
shows me the value bool(false).

I tried to work this out on CAKEPHP framework too and still the $resp
is  bool(false)

There is one really good to understand tutorial I used as reference.
http://www.merchant-account-services.org/article/authorize-net-php-integration/1

Now what I want to know is .. after looking at the $resp which is same
for normal php code as well as cakephp style coding.. does it mean I
have connection problem or something else like its getting connected
but the response is a serious ERROR for some reasons... if not what is
the solution??

Kindly reply,

Shri


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



Controller.action_name ?

2007-08-21 Thread [EMAIL PROTECTED]

Hello

In Ruby on Rails  in my layout i write something like this:
Photos: <%= controller.action_name %> 

Any ideas how to do this in CakePHP ?

I try do search this in the Api but i cant find something

Stachu


--~--~-~--~~~---~--~~
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: Need a mentor

2007-08-21 Thread Baz
Hey,

Can I piggy back also? I'm generally ok, except with authentication. It's
kicking my butt. The only thing I can get to work is obAuth, but I can see
an application in my not to distant future, where that isn't going to be
enouogh.
--
Baz L
Day In The Life of Baz
http://www.LifeOfBaz.com/

On 8/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> Coding with Cake is a piece of cake.
>
> Shoot me an email and I'll help you get started.
>
> Steve
>
> On Aug 20, 1:34 am, Prashant <[EMAIL PROTECTED]> wrote:
> > I need someone to mentor me in Cake PHP. I am finding it bit difficult
> > on my own.
> >
> > In return for his time and effort I am willing write code for him at
> > no cost.
>
>
> >
>

--~--~-~--~~~---~--~~
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: Conceptual hints on inheritance

2007-08-21 Thread Bravo_Kernel

@Nagarjuna and Jon:

Nice feedback and funny enough I just ran into the tree-issue myself
as well :)

Your suggestions for a unique id in the base table pointing to an
external MPTT tree table for the hierarchy position is exactly what I
am already using in a similar (non-Cake) project. I will be using that
method here again because it is pretty error proof and scales
perfectly without losing performance. My base class (large table) will
contain all entries/nodes with the commonly shared meta information.

Looking at my demo I think that an extra pointer in the base table to
an external table holding the Model type (mammel, lizard, etc.) would
complement things . By loading the corresponding Model at runtime I
will get all the needed database fields through Cake's inheritance
logic without the need to lookup tables for myself. I can clearly see
the benefits in that: create a model once, never look back.

This looks like the most OOP'ish solution to me. The problems with
searching through the many tables is still there but perhaps Lucene
could handle that.

Once again, I have not been using Cake for too long so if this is not
making any sense please let me know. Remember, I am looking for the
Cake approach here. No need in holding on to my old structural
thinking ;)

  Bravo


On 21 aug, 19:20, Jon Langevin <[EMAIL PROTECTED]> wrote:
> nagarjuna, looks like your suggestion is similar to the one I just sent
> :-)  Nice to see someone else thinking along a similar pattern
>
> nagarjuna wrote:
> > I am working on a similar project and decided to use a taxonomic_unit
> > as the basic element. I have one table taxonomic_units where all
> > levels get stored, as well as the hierarchical relations between them.
> > You should look into modified pre-order tree traversal (see
> >http://www.sitepoint.com/article/hierarchical-data-database). Of
> > course each level will have different additional characteristics
> > besides just the taxonomic relationships, and I use separate tables to
> > store these characteristics (i.e. kingdom_characteristics,
> > phylum_characteristics, etc.). I have just one model and one
> > controller for the taxonomic units and in my controller I go the
> > relevant additonal table, extract the other details, and my views are
> > set up generically to display the info.
>
> > I am not sure if this is the most cake like approach, but it makes
> > maintenance easier even if the coding is a bit uglier (lots of switch
> > statements for example).
>
> > Hope that helps.


--~--~-~--~~~---~--~~
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: basic tutorial bookmark or first bite

2007-08-21 Thread Baz
Why are you running Localhost/app?

It should just be locahost/notes/

that should route you where you need to go.

I've had problems with running Cake in a sub directory. I know it was my own
stupidity, but I just figured that it wasn't worth the time to try and
figure out. Anytime I deploy, it's going to be on a root folder anyway.
Either it can't find stuff, or the links to files for my layout get trashed.

Do yourself a favor, if you're testing locally, just stick cake on the root
and everything should work out of the box.
--
Baz L
Day In The Life of Baz
http://www.LifeOfBaz.com/

On 8/21/07, SIXS <[EMAIL PROTECTED]> wrote:
>
>  Hi,
> I am trying cakephp again. I gret the cake page and I see that it
> recognizes my database.
> I then create the basic model and controller that includes scaffolding.
>
> I run localhost/app and i get the basic cake wheet.
> I run localhost/app/notes and it tells me that I  can't find the page.
> What am I not doing ??
> or what am I doing wrong
> JIm
>
>
> >
>

--~--~-~--~~~---~--~~
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: wrong summation using php to read mysql database

2007-08-21 Thread [EMAIL PROTECTED]

I believe - the problem is not with cake. Its with the SQL you have
written.

When you use HAVING on a query, only the output is filtered after
running the query.
You should be using WHERE condition. Please read up the MYSQL manual
for details.

cheers
R

On Aug 21, 5:00 pm, Asembereng <[EMAIL PROTECTED]> wrote:
> I want to read from a database using php commands and grouping by
> timetype jobdatefrom endyear and nctype and summing the groups for
> everymonth but instead it sums up for all the months. Here are the
> Codes i wrote for that:
>
> $query = mysql_query("select distinct sum(ChargeTime) as ChargeTime,
> sum(Amount) as AmounT , ClientName,
> JobDateFrom,JobDateTo,endYear,NcType from jobs where TimeType=0 group
> by TimeType, JobDateFrom, endYear, NcType having
> JobDateFrom>=Date('$startdate') and JobDateTo=('$enddate')");
>
> thats the query i am using. Can anyone help me on this?? Its an urgent
> matter. thank you!!


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



basic tutorial bookmark or first bite

2007-08-21 Thread SIXS
Hi,
I am trying cakephp again. I gret the cake page and I see that it recognizes my 
database.
I then create the basic model and controller that includes scaffolding.

I run localhost/app and i get the basic cake wheet.
I run localhost/app/notes and it tells me that I  can't find the page.
What am I not doing ??
or what am I doing wrong
JIm

--~--~-~--~~~---~--~~
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 to write my own ajax with cakephp

2007-08-21 Thread [EMAIL PROTECTED]

Greetings,

I learned how to do Cake Ajax with this guy's website. It's easy to
understand and I've recommended it many times before.

http://www.grahambird.co.uk/cake/tutorials/ajax.php

Hope that helps too!

Steve

Wimg wrote:
> can anyone give me a little example of ajax with cakephp?


--~--~-~--~~~---~--~~
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: Need a mentor

2007-08-21 Thread [EMAIL PROTECTED]

Coding with Cake is a piece of cake.

Shoot me an email and I'll help you get started.

Steve

On Aug 20, 1:34 am, Prashant <[EMAIL PROTECTED]> wrote:
> I need someone to mentor me in Cake PHP. I am finding it bit difficult
> on my own.
>
> In return for his time and effort I am willing write code for him at
> no cost.


--~--~-~--~~~---~--~~
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: Conceptual hints on inheritance

2007-08-21 Thread nagarjuna

I am working on a similar project and decided to use a taxonomic_unit
as the basic element. I have one table taxonomic_units where all
levels get stored, as well as the hierarchical relations between them.
You should look into modified pre-order tree traversal (see
http://www.sitepoint.com/article/hierarchical-data-database ). Of
course each level will have different additional characteristics
besides just the taxonomic relationships, and I use separate tables to
store these characteristics (i.e. kingdom_characteristics,
phylum_characteristics, etc.). I have just one model and one
controller for the taxonomic units and in my controller I go the
relevant additonal table, extract the other details, and my views are
set up generically to display the info.

I am not sure if this is the most cake like approach, but it makes
maintenance easier even if the coding is a bit uglier (lots of switch
statements for example).

Hope that helps.


--~--~-~--~~~---~--~~
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: Conceptual hints on inheritance

2007-08-21 Thread Jon Langevin

nagarjuna, looks like your suggestion is similar to the one I just sent 
:-)  Nice to see someone else thinking along a similar pattern

nagarjuna wrote:
> I am working on a similar project and decided to use a taxonomic_unit
> as the basic element. I have one table taxonomic_units where all
> levels get stored, as well as the hierarchical relations between them.
> You should look into modified pre-order tree traversal (see
> http://www.sitepoint.com/article/hierarchical-data-database ). Of
> course each level will have different additional characteristics
> besides just the taxonomic relationships, and I use separate tables to
> store these characteristics (i.e. kingdom_characteristics,
> phylum_characteristics, etc.). I have just one model and one
> controller for the taxonomic units and in my controller I go the
> relevant additonal table, extract the other details, and my views are
> set up generically to display the info.
> 
> I am not sure if this is the most cake like approach, but it makes
> maintenance easier even if the coding is a bit uglier (lots of switch
> statements for example).
> 
> Hope that helps.
> 
> 
> > 
> 

--~--~-~--~~~---~--~~
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: Conceptual hints on inheritance

2007-08-21 Thread Jon Langevin

@Bravo, what are the differences that would go into each distinction?
Wouldn't it be better to keep everything stored in fewer tables (again, 
for searching), and classify each species using rules found in 
additional tables

btw, since this is a massive hierarchy, a version of the Nested Set 
model may be usable here (but I dunno if it would be good for the sheer 
number of entries you're proposing. that would be worth investigating). 
Nested Set is a different approach to categorizing data hierarchy

so, the examples you provided of lifeforms -> reptiles -> squamata -> 
lizards, etc, could be entirely contained in a single table using Nested 
Set, and it would be a simple matter for you to find all siblings, 
children, parents, and the complete path to a nested row of data

that's personally how I would handle it, as otherwise you may run into 
maintenance problems when it comes to updating the many models that your 
current proposal would require

btw, for your example, using Nested Sets, your table would be 
considered/named "lifeforms", and everything would be stored therein

if this data is likely to be changed/moved often, then another approach 
(to still use Nested Sets) is to keep your lifeform data in a table with 
no hierarchy references. each entry would simply have a unique id. then 
you could have a join table that would manage the unique ids using the 
Nested Set model. that way, if you're moving entries around often, 
there's less load on the larger table.

CakePHP 1.2 has built-in support for Nested Set trees, and differs 
slightly from typical Nested Set models (which usually just have 
uniqueid,lft,rght) by also including parentid, which allows for speedier 
data access at times.

if you'd like to discuss this further, lemme know. good luck :-)
-Jon L

Bravo_Kernel wrote:
> @Woodman:
> Thanks you for the suggestions, I will try to set up a test using a
> single Controller that dynamically calls the needed Model(s) and
> View(s) for editing the objects and see how things perform.
> 
> @Coder:
> Many thanks for the warning. You have a very good point about the
> number of tables that will be created and the effect it will have on
> searches and so on.
> However, because I know there will not be (many) duplicate columns I
> don't really see an alternative. If you do, please let me know.
> 
> 
> Thanks again,
>Rob
> 
> 
> On 21 aug, 17:14, Angry Coder <[EMAIL PROTECTED]> wrote:
>> Hi Bravo,
>>
>> I am not sure if going the route you have chosen will actually save
>> you effort later, it might even cause some headaches.
>>
>> Won't each of these separate tables contain mostly the same columns?
>> And if you want to search across entire classes of animals won't all
>> of these tables cause more harm then good?
>>
>> As to answer your questions: (keeping in mind I am still new to
>> cakephp)
>>
>> 1. I don't think so but it might make it more complicated. You might
>> want to use some method of dynamically loading the models, if you plan
>> to have so many.
>>
>> 2. You should be able to reuse some views by specifying which to load
>> using:
>>
>> $this->render('name_of_template.thtml');
>>
>> within your controller functions.
>>
>> Cheers,
>>
>> Coder
>>
>> On Aug 21, 8:54 am, Bravo_Kernel <[EMAIL PROTECTED]> wrote:
>>
>>> Hi group,
>>> I am building an application to (theoretically) store characteristics
>>> for all existing lifeforms on this planet and need some conceptual
>>> pointers on the best approach for solving this with Cake.
>>> To keep things maintanable and extendible I am thinking of creating
>>> lots of Models (with different database tables) using class
>>> inheritance, for example:
>>> classLifeForms -> classReptiles -> classSquamata -> classLizards
>>> classLifeForms -> classReptiles -> classSquamata -> classSnakes
>>> classLifeForms -> classMammals -> etc.
>>> Assuming the Model approach is valid I will have to build hundreds of
>>> Models. Now for my questions:
>>> 1. Will this force me to build a different controller to handle adding/
>>> deleting/modifying each subclass or would it be possible to reuse a
>>> single controller?
>>> 2. Will this force me to build a different view for each subclass or
>>> is reusing an option here as well?
>>> Any feedback is highly appreciated.
>>>   TIA Bravo
> 
> 
> > 
> 

--~--~-~--~~~---~--~~
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: Conceptual hints on inheritance

2007-08-21 Thread Bravo_Kernel

@Woodman:
Thanks you for the suggestions, I will try to set up a test using a
single Controller that dynamically calls the needed Model(s) and
View(s) for editing the objects and see how things perform.

@Coder:
Many thanks for the warning. You have a very good point about the
number of tables that will be created and the effect it will have on
searches and so on.
However, because I know there will not be (many) duplicate columns I
don't really see an alternative. If you do, please let me know.


Thanks again,
   Rob


On 21 aug, 17:14, Angry Coder <[EMAIL PROTECTED]> wrote:
> Hi Bravo,
>
> I am not sure if going the route you have chosen will actually save
> you effort later, it might even cause some headaches.
>
> Won't each of these separate tables contain mostly the same columns?
> And if you want to search across entire classes of animals won't all
> of these tables cause more harm then good?
>
> As to answer your questions: (keeping in mind I am still new to
> cakephp)
>
> 1. I don't think so but it might make it more complicated. You might
> want to use some method of dynamically loading the models, if you plan
> to have so many.
>
> 2. You should be able to reuse some views by specifying which to load
> using:
>
> $this->render('name_of_template.thtml');
>
> within your controller functions.
>
> Cheers,
>
> Coder
>
> On Aug 21, 8:54 am, Bravo_Kernel <[EMAIL PROTECTED]> wrote:
>
> > Hi group,
>
> > I am building an application to (theoretically) store characteristics
> > for all existing lifeforms on this planet and need some conceptual
> > pointers on the best approach for solving this with Cake.
>
> > To keep things maintanable and extendible I am thinking of creating
> > lots of Models (with different database tables) using class
> > inheritance, for example:
> > classLifeForms -> classReptiles -> classSquamata -> classLizards
> > classLifeForms -> classReptiles -> classSquamata -> classSnakes
> > classLifeForms -> classMammals -> etc.
>
> > Assuming the Model approach is valid I will have to build hundreds of
> > Models. Now for my questions:
> > 1. Will this force me to build a different controller to handle adding/
> > deleting/modifying each subclass or would it be possible to reuse a
> > single controller?
> > 2. Will this force me to build a different view for each subclass or
> > is reusing an option here as well?
>
> > Any feedback is highly appreciated.
>
> >   TIA Bravo


--~--~-~--~~~---~--~~
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: habtm with different roles

2007-08-21 Thread RichardAtHome

What you have is:

A message has an author and a recipient. Both the author and recipient
are users so

Message Table:

id, Primary Key
author_id, Foreign Key to Users table
recipient_id, Foreign Key to Users table

Check out the docs for $belongsTo, you can tell cake that the
author_id field points Users.id and recipient_id points to Users.id
(the same or a different user).


On Aug 21, 4:04 pm, deepc <[EMAIL PROTECTED]> wrote:
> A question to habtm.
> I have an object message and user
> A message could be a sent or an received message and belongs to an
> user.
> Is it possible to model such different roles between the same object
> in cake?


--~--~-~--~~~---~--~~
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: habtm with different roles

2007-08-21 Thread RichardAtHome

Meant to add, this is not a HABTM relationship unless you want to link
the message to multiple recipients and/or multiple authors

On Aug 21, 4:04 pm, deepc <[EMAIL PROTECTED]> wrote:
> A question to habtm.
> I have an object message and user
> A message could be a sent or an received message and belongs to an
> user.
> Is it possible to model such different roles between the same object
> in cake?


--~--~-~--~~~---~--~~
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: Help Needed: Cake Convention on Model Associations and How to Override Them

2007-08-21 Thread Angry Coder

I forgot to mention I am working with Cake 1.1

On Aug 21, 10:05 am, Angry Coder <[EMAIL PROTECTED]> wrote:
> Hi Anch,
>
> Here are some of the things within the Model class which you can
> override that may help:
>
> var $useTable = null;
> var $displayField = null;
> var $primaryKey = null;
>
> 1. $primaryKey variable will allow you to override the column used as
> the primary key.
>
> 2. Yes you need specify the details in your associations
>
> For instance in your Article Model:
>
> var $hasAndBelongsToMany = array(
> 'Users' =>
> array('className' => 'Users',
> 'joinTable' => 
> 'user_articles',
> 'foreignKey' => 'article_id',
> 'associationForeignKey' => 
> 'user_id',
> 'conditions' => '',
> 'fields' => '',
> 'order' => '',
> 'limit' => '',
> 'offset' => '',
> 'unique' => '',
> 'finderQuery' => '',
> 'deleteQuery' => '',
> 'insertQuery' => ''
> ),
>
> );
>
> I left in the other fields you can specify for completeness sake.
>
> Also if the other field is a auto increment field you can ignore it it
> should just by populated by the database.
>
> Cheers,
>
> Coder
>
> On Aug 21, 9:30 am, anch <[EMAIL PROTECTED]> wrote:
>
> > Hi, I am building a CakePHP-based application using all the database
> > tables built by another application. However, the database tables
> > related to models are defined differently from CakePHP's convention.
>
> > We have the following tables: articles, users, ratings for the models:
> > Article, User, and Rating; the associations among them include the
> > following, "Article hasOne Rating" and "User hasAndBelongsToMany
> > Article"
>
> > I have the following questions:
>
> > 1. In the articles table, article_id was used as the column name for
> > the article id (the primary key). When I try to access ratings records
> > associated with Article, it generated the following error:
>
> > SQL Error: 1054: Unknown column 'Article.id' in 'on clause' in /var/
> > www/html/cake/cake/libs/model/datasources/dbo_source.php on line 463
>
> > I guess CakePHP was expecting the column name to be 'id' in the
> > articles table. If so, can I work around this problem without changing
> > the column name?
>
> > 2. The join table was named as user_articles. According to CakePHP
> > convention, it should be articles_users. Is there anyway I can
> > override the CakePHP convention to use user_articles instead? Also
> > there was an extra field for record id (thus it has three columns: id,
> > article_id, user_id), can we live with this?
>
> > Could anybody help me to resolve the above issues to override the
> > CakePHP convention? Thanks a lot.
>
> > Best regards,
> > Anch


--~--~-~--~~~---~--~~
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: Help Needed: Cake Convention on Model Associations and How to Override Them

2007-08-21 Thread Angry Coder

Hi Anch,

Here are some of the things within the Model class which you can
override that may help:

var $useTable = null;
var $displayField = null;
var $primaryKey = null;

1. $primaryKey variable will allow you to override the column used as
the primary key.

2. Yes you need specify the details in your associations

For instance in your Article Model:

var $hasAndBelongsToMany = array(
'Users' =>
array('className' => 'Users',
'joinTable' => 'user_articles',
'foreignKey' => 'article_id',
'associationForeignKey' => 
'user_id',
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'unique' => '',
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
),

);

I left in the other fields you can specify for completeness sake.

Also if the other field is a auto increment field you can ignore it it
should just by populated by the database.

Cheers,

Coder

On Aug 21, 9:30 am, anch <[EMAIL PROTECTED]> wrote:
> Hi, I am building a CakePHP-based application using all the database
> tables built by another application. However, the database tables
> related to models are defined differently from CakePHP's convention.
>
> We have the following tables: articles, users, ratings for the models:
> Article, User, and Rating; the associations among them include the
> following, "Article hasOne Rating" and "User hasAndBelongsToMany
> Article"
>
> I have the following questions:
>
> 1. In the articles table, article_id was used as the column name for
> the article id (the primary key). When I try to access ratings records
> associated with Article, it generated the following error:
>
> SQL Error: 1054: Unknown column 'Article.id' in 'on clause' in /var/
> www/html/cake/cake/libs/model/datasources/dbo_source.php on line 463
>
> I guess CakePHP was expecting the column name to be 'id' in the
> articles table. If so, can I work around this problem without changing
> the column name?
>
> 2. The join table was named as user_articles. According to CakePHP
> convention, it should be articles_users. Is there anyway I can
> override the CakePHP convention to use user_articles instead? Also
> there was an extra field for record id (thus it has three columns: id,
> article_id, user_id), can we live with this?
>
> Could anybody help me to resolve the above issues to override the
> CakePHP convention? Thanks a lot.
>
> Best regards,
> Anch


--~--~-~--~~~---~--~~
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: Conceptual hints on inheritance

2007-08-21 Thread Angry Coder

Hi Bravo,

I am not sure if going the route you have chosen will actually save
you effort later, it might even cause some headaches.

Won't each of these separate tables contain mostly the same columns?
And if you want to search across entire classes of animals won't all
of these tables cause more harm then good?

As to answer your questions: (keeping in mind I am still new to
cakephp)

1. I don't think so but it might make it more complicated. You might
want to use some method of dynamically loading the models, if you plan
to have so many.

2. You should be able to reuse some views by specifying which to load
using:

$this->render('name_of_template.thtml');

within your controller functions.

Cheers,

Coder

On Aug 21, 8:54 am, Bravo_Kernel <[EMAIL PROTECTED]> wrote:
> Hi group,
>
> I am building an application to (theoretically) store characteristics
> for all existing lifeforms on this planet and need some conceptual
> pointers on the best approach for solving this with Cake.
>
> To keep things maintanable and extendible I am thinking of creating
> lots of Models (with different database tables) using class
> inheritance, for example:
> classLifeForms -> classReptiles -> classSquamata -> classLizards
> classLifeForms -> classReptiles -> classSquamata -> classSnakes
> classLifeForms -> classMammals -> etc.
>
> Assuming the Model approach is valid I will have to build hundreds of
> Models. Now for my questions:
> 1. Will this force me to build a different controller to handle adding/
> deleting/modifying each subclass or would it be possible to reuse a
> single controller?
> 2. Will this force me to build a different view for each subclass or
> is reusing an option here as well?
>
> Any feedback is highly appreciated.
>
>   TIA Bravo


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



habtm with different roles

2007-08-21 Thread deepc

A question to habtm.
I have an object message and user
A message could be a sent or an received message and belongs to an
user.
Is it possible to model such different roles between the same object
in cake?


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



Help Needed: Cake Convention on Model Associations and How to Override Them

2007-08-21 Thread anch

Hi, I am building a CakePHP-based application using all the database
tables built by another application. However, the database tables
related to models are defined differently from CakePHP's convention.

We have the following tables: articles, users, ratings for the models:
Article, User, and Rating; the associations among them include the
following, "Article hasOne Rating" and "User hasAndBelongsToMany
Article"

I have the following questions:

1. In the articles table, article_id was used as the column name for
the article id (the primary key). When I try to access ratings records
associated with Article, it generated the following error:

SQL Error: 1054: Unknown column 'Article.id' in 'on clause' in /var/
www/html/cake/cake/libs/model/datasources/dbo_source.php on line 463

I guess CakePHP was expecting the column name to be 'id' in the
articles table. If so, can I work around this problem without changing
the column name?


2. The join table was named as user_articles. According to CakePHP
convention, it should be articles_users. Is there anyway I can
override the CakePHP convention to use user_articles instead? Also
there was an extra field for record id (thus it has three columns: id,
article_id, user_id), can we live with this?

Could anybody help me to resolve the above issues to override the
CakePHP convention? Thanks a lot.

Best regards,
Anch


--~--~-~--~~~---~--~~
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: Saving search criteria - Clueless!

2007-08-21 Thread djiize

complex way:
create a table searches with fields for all conditions:
  id
  user_id
  bedrooms
  price
  area_id
and its Model

and save your condition:
user_id = 2
bedrooms = 3
price = 'BETWEEN 500 AND 600'
area_id = '02,03' // in string format, choose a separator

and:
// get user conditions from db
$conditions = $this->Search->read(null, $search_id);
// convert some fields, would be better in afterFind in Search Model
$conditions['Search']['area_id'] = explode(',', $conditions['Search']
['area_id']); // to recover array from string
// search properties with conditions
$properties = $this->Property->findAll($conditions);

I didn't tested this code, but you've the idea.
Tell me if you have questions

On 21 août, 17:12, djiize <[EMAIL PROTECTED]> wrote:
> simple way:
> you can serialize your conditions array in a new fieldhttp://php.net/serialize
> but beware of future DB modifications (field renaming, etc...)
>
> On 21 août, 16:00, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > I'm building a property site (trying anyway!)
>
> > I've constructed my search $conditions from the data submitted in the
> > search form - it gives me an array:
>
> > Array ( [Letting] => Array ( [bedrooms] => 3 [price] => BETWEEN 500
> > AND 600 [area_id] => Array ( [0] => 02 [1] => 03 ) ) )
>
> > which in the SQL request gets converted by CAKE into:
>
> > WHERE (`bedrooms` = 3) AND (`price` BETWEEN '500' AND '600') AND
> > (`area_id` IN (02, 03) )
>
> > but I want to offer the option for the user to save these search
> > criteria so the site will email new property details to the  user
> > automagically.
>
> > If I split the $conditions array apart I'll need to save four or more
> > separate rows and build logic to reconstruct them when the time comes
> > to check for new properties.
>
> > Can I just grab the complete query (without running it) and cram it
> > into a field?


--~--~-~--~~~---~--~~
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: Conceptual hints on inheritance

2007-08-21 Thread the_woodsman

Reusing views should be easy; controllers can redirect to a particular
view, so just make sure the view uses generic variable names and all
should be clear.

You should be able to do this in one controller as well, although it
will be a bit more complex than usual... it will have to dynamically
decide which model(s) to use based on the GET or POST params... I dont
think this is too much work tho.



On Aug 21, 12:15 pm, Bravo_Kernel <[EMAIL PROTECTED]> wrote:
> Thanks for the quick confirmation that the technical approach
> (building loads of Models) seems the right Cake-way to do it.
>
> But what about the two other questions?
>
> Insights appreciated!
>
> On 21 aug, 17:06, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
>
>
>
> > perhaps something modeled more on the standard classification with a
> > model for each of
> > Kingdom
>
> > Phylum
>
> > Class
>
> > Order
>
> > Family
>
> > Genus
>
> > Species
>
> > where kingdom has many phylum and phylum has many class
>
> > On 8/21/07, Bravo_Kernel <[EMAIL PROTECTED]> wrote:
>
> > > Hi group,
>
> > > I am building an application to (theoretically) store characteristics
> > > for all existing lifeforms on this planet and need some conceptual
> > > pointers on the best approach for solving this with Cake.
>
> > > To keep things maintanable and extendible I am thinking of creating
> > > lots of Models (with different database tables) using class
> > > inheritance, for example:
> > > classLifeForms -> classReptiles -> classSquamata -> classLizards
> > > classLifeForms -> classReptiles -> classSquamata -> classSnakes
> > > classLifeForms -> classMammals -> etc.
>
> > > Assuming the Model approach is valid I will have to build hundreds of
> > > Models. Now for my questions:
> > > 1. Will this force me to build a different controller to handle adding/
> > > deleting/modifying each subclass or would it be possible to reuse a
> > > single controller?
> > > 2. Will this force me to build a different view for each subclass or
> > > is reusing an option here as well?
>
> > > Any feedback is highly appreciated.
>
> > >   TIA Bravo
>
> > --
> > (the old fart) the advice is free, the lack of crankiness will cost you
>
> > - its a fine line between a real question and an idiot
>
> >http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/- 
> >Hide quoted text -
>
> - Show quoted text -


--~--~-~--~~~---~--~~
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: Conceptual hints on inheritance

2007-08-21 Thread Bravo_Kernel

Thanks for the quick confirmation that the technical approach
(building loads of Models) seems the right Cake-way to do it.

But what about the two other questions?

Insights appreciated!

On 21 aug, 17:06, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> perhaps something modeled more on the standard classification with a
> model for each of
> Kingdom
>
> Phylum
>
> Class
>
> Order
>
> Family
>
> Genus
>
> Species
>
> where kingdom has many phylum and phylum has many class
>
> On 8/21/07, Bravo_Kernel <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi group,
>
> > I am building an application to (theoretically) store characteristics
> > for all existing lifeforms on this planet and need some conceptual
> > pointers on the best approach for solving this with Cake.
>
> > To keep things maintanable and extendible I am thinking of creating
> > lots of Models (with different database tables) using class
> > inheritance, for example:
> > classLifeForms -> classReptiles -> classSquamata -> classLizards
> > classLifeForms -> classReptiles -> classSquamata -> classSnakes
> > classLifeForms -> classMammals -> etc.
>
> > Assuming the Model approach is valid I will have to build hundreds of
> > Models. Now for my questions:
> > 1. Will this force me to build a different controller to handle adding/
> > deleting/modifying each subclass or would it be possible to reuse a
> > single controller?
> > 2. Will this force me to build a different view for each subclass or
> > is reusing an option here as well?
>
> > Any feedback is highly appreciated.
>
> >   TIA Bravo
>
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/


--~--~-~--~~~---~--~~
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: Saving search criteria - Clueless!

2007-08-21 Thread djiize

simple way:
you can serialize your conditions array in a new field http://php.net/serialize
but beware of future DB modifications (field renaming, etc...)

On 21 août, 16:00, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I'm building a property site (trying anyway!)
>
> I've constructed my search $conditions from the data submitted in the
> search form - it gives me an array:
>
> Array ( [Letting] => Array ( [bedrooms] => 3 [price] => BETWEEN 500
> AND 600 [area_id] => Array ( [0] => 02 [1] => 03 ) ) )
>
> which in the SQL request gets converted by CAKE into:
>
> WHERE (`bedrooms` = 3) AND (`price` BETWEEN '500' AND '600') AND
> (`area_id` IN (02, 03) )
>
> but I want to offer the option for the user to save these search
> criteria so the site will email new property details to the  user
> automagically.
>
> If I split the $conditions array apart I'll need to save four or more
> separate rows and build logic to reconstruct them when the time comes
> to check for new properties.
>
> Can I just grab the complete query (without running it) and cram it
> into a field?


--~--~-~--~~~---~--~~
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: Newbie starting questions for 1.2.x!

2007-08-21 Thread djiize

you're welcome, happy your code work ;)

On 21 août, 16:55, cronet <[EMAIL PROTECTED]> wrote:
> I think it's clear now to me...
>
> I get exactly what I wanted with the following:
> ---%<
> function beforeFilter() {
> if( $this->action != 'view' AND
> $this->action != 'index' ) {
> $this->__validateLoginStatus();
> }
> }
> ---%<
>
> Thank you for your help djiize !!!
>
> Bye...
>
> On 21 Aug., 14:57, djiize <[EMAIL PROTECTED]> wrote:
>
> > the beforeFilter function have no parameters
> > but you can get the parameters sent to the action by $this->params
>
> > On 21 août, 13:28, cronet <[EMAIL PROTECTED]> wrote:
>
> > > 2. Great. This works!
>
> > > 3. That's great for debbugging!
> > > ehm. But:
> > > I tried to figure out what params the beforeFilter function accepts.
> > > That isn't in the output...
>
> > > On 21 Aug., 12:57, djiize <[EMAIL PROTECTED]> wrote:
>
> > > > 2. create a file app_controller.php in /app and write that (or copy
> > > > from /cake/app_controller.php):
> > > >  > > > class AppController extends Controller {
>
> > > >   // callback example
> > > >   function beforeFilter() {
> > > > // will be called for ALL controllers
> > > >   }
>
> > > >   // custom function example
> > > >   function __myprivate() {
> > > > // available in every controller with $this->__myprivate()
> > > >   }}
>
> > > > ?>
>
> > > > 3. look at the content of $this
> > > >   pr($this)
> > > > and you'll see:
> > > > $this->name // name of the controller (string)
> > > > $this->action // name of the action (string)
> > > > $this->params // parameters of the action (array)
> > > > $this->passedArgs // named parameters of the action (array)
>
> > > > On 21 août, 12:22, cronet <[EMAIL PROTECTED]> wrote:
>
> > > > > Thank you for your reply.
> > > > > 1. Ok. 1 is clear now.
>
> > > > > 2. How do i extend AppController?
>
> > > > > 3. I wanted to get behind the 'action' Parameter for the beforeFilter
> > > > > function, because i only want to use it on specific actions.
> > > > > So I thought I look at the API...
>
> > > > > On 21 Aug., 12:07, djiize <[EMAIL PROTECTED]> wrote:
>
> > > > > > 1. in Cake conventions, function prefixed with __ is private, so
> > > > > > you're correct
>
> > > > > > 2. if you need to access a function from several controllers, don't
> > > > > > put it in a specific one, move it to app_controller.php.
> > > > > > Since all your controllers extend AppController, 
> > > > > > $this->__validateLogin() is OK
>
> > > > > > IMHO a validateLogin() function is more in a Model than in a
> > > > > > Constroller, but depends of what you're doing in it.
>
> > > > > > 3. just override beforeFilter in your controller, and you'll have
> > > > > > access to controller's variables with $this.
> > > > > > Maybe I don't understand well your question here...
>
> > > > > > On 21 août, 11:25, cronet <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Hi There,
>
> > > > > > > I just started using cake, and having heavy troubles getting some
> > > > > > > basic things to work
>
> > > > > > > 1. How do I define a function without a view?
> > > > > > > I read somewhere on the net, that these actions/functions start 
> > > > > > > with a
> > > > > > > double underscore...
> > > > > > > example: function __validateLogin()
> > > > > > > Is this okay?
>
> > > > > > > 2. How to access the function defined in 1 from other Controllers?
> > > > > > > In the same controller i simply use $this->__validateLogin();
> > > > > > > But in other controllers?
>
> > > > > > > 3. How to get infos from the API?
> > > > > > > e.g. i tried to get informations, what parameters could be used 
> > > > > > > in the
> > > > > > > beforeFilter function...
> > > > > > > I simply searched the api for "beforeFilter" and found the first 
> > > > > > > entry
> > > > > > > useful : "Controller::beforeFilter()";
> > > > > > > But on line 1127 of file controller.php only
>
> > > > > > > 01123 /**
> > > > > > > 01124  * Called before the controller action.  Overridden in
> > > > > > > subclasses.
> > > > > > > 01125  *
> > > > > > > 01126  */
> > > > > > > 01127 function beforeFilter() {
> > > > > > > 01128 }
>
> > > > > > > Nothing more... Wher can I find the source to get the params 
> > > > > > > section?
>
> > > > > > > Perhaps someone could help me and describes how to solve this...
>
> > > > > > > Greetings,
> > > > > > > Alexander


--~--~-~--~~~---~--~~
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: Conceptual hints on inheritance

2007-08-21 Thread Samuel DeVore

perhaps something modeled more on the standard classification with a
model for each of
Kingdom

Phylum

Class

Order

Family

Genus

Species

where kingdom has many phylum and phylum has many class

On 8/21/07, Bravo_Kernel <[EMAIL PROTECTED]> wrote:
>
> Hi group,
>
> I am building an application to (theoretically) store characteristics
> for all existing lifeforms on this planet and need some conceptual
> pointers on the best approach for solving this with Cake.
>
> To keep things maintanable and extendible I am thinking of creating
> lots of Models (with different database tables) using class
> inheritance, for example:
> classLifeForms -> classReptiles -> classSquamata -> classLizards
> classLifeForms -> classReptiles -> classSquamata -> classSnakes
> classLifeForms -> classMammals -> etc.
>
> Assuming the Model approach is valid I will have to build hundreds of
> Models. Now for my questions:
> 1. Will this force me to build a different controller to handle adding/
> deleting/modifying each subclass or would it be possible to reuse a
> single controller?
> 2. Will this force me to build a different view for each subclass or
> is reusing an option here as well?
>
> Any feedback is highly appreciated.
>
>   TIA Bravo
>
>
> >
>


-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

--~--~-~--~~~---~--~~
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: CakePHP support for Berkeley DB?

2007-08-21 Thread bingo

Thanks Olexandr, Nate

The link Olexandr sent was useful. However I am using Mysql 5, so I
don't think I can use BDB as storage engine. I will try what nate
suggested, to rewrite BDB driver.

Regards,
Ritesh

On Aug 20, 7:27 pm, "Olexandr Melnyk" <[EMAIL PROTECTED]> wrote:
> Um?
>
> You can use BDB as MySQL storage engine (MySQL <= 5.0):
>
> http://www.mysql.org/doc/refman/5.0/en/bdb-storage-engine.html
>
> 2007/8/20, nate <[EMAIL PROTECTED]>:
>
>
>
>
>
>
>
> > Okay, dude, you need to stop spamming the mailing list now.  Fix your
> > mail client or whatever.
>
> > On Aug 20, 11:12 am, "Olexandr Melnyk" <[EMAIL PROTECTED]> wrote:
> > > In case you use it MySQL storage engine.
>
> > > 2007/8/20, bingo <[EMAIL PROTECTED]>:
>
> > > > hi,
>
> > > > this is just an open question. Recently I have been  reading a lot of
> > > > Berkeley DB and came to know that many big companies such as google
> > > > and amazon use Berkeley DB. I am wondering does CakePHP support the
> > > > use of Berkeley DB ?
>
> > > > Regards,
> > > > bingo
>
> > > --
> > > Sincerely yours,
> > > Olexandr Melnykhttp://omelnyk.net/
>
> --
> Sincerely yours,
> Olexandr Melnykhttp://omelnyk.net/- Hide quoted text -
>
> - Show quoted text -


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



Conceptual hints on inheritance

2007-08-21 Thread Bravo_Kernel

Hi group,

I am building an application to (theoretically) store characteristics
for all existing lifeforms on this planet and need some conceptual
pointers on the best approach for solving this with Cake.

To keep things maintanable and extendible I am thinking of creating
lots of Models (with different database tables) using class
inheritance, for example:
classLifeForms -> classReptiles -> classSquamata -> classLizards
classLifeForms -> classReptiles -> classSquamata -> classSnakes
classLifeForms -> classMammals -> etc.

Assuming the Model approach is valid I will have to build hundreds of
Models. Now for my questions:
1. Will this force me to build a different controller to handle adding/
deleting/modifying each subclass or would it be possible to reuse a
single controller?
2. Will this force me to build a different view for each subclass or
is reusing an option here as well?

Any feedback is highly appreciated.

  TIA Bravo


--~--~-~--~~~---~--~~
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: Newbie starting questions for 1.2.x!

2007-08-21 Thread cronet

I think it's clear now to me...

I get exactly what I wanted with the following:
---%<
function beforeFilter() {
if( $this->action != 'view' AND
$this->action != 'index' ) {
$this->__validateLoginStatus();
}
}
---%<

Thank you for your help djiize !!!


Bye...

On 21 Aug., 14:57, djiize <[EMAIL PROTECTED]> wrote:
> the beforeFilter function have no parameters
> but you can get the parameters sent to the action by $this->params
>
> On 21 août, 13:28, cronet <[EMAIL PROTECTED]> wrote:
>
> > 2. Great. This works!
>
> > 3. That's great for debbugging!
> > ehm. But:
> > I tried to figure out what params the beforeFilter function accepts.
> > That isn't in the output...
>
> > On 21 Aug., 12:57, djiize <[EMAIL PROTECTED]> wrote:
>
> > > 2. create a file app_controller.php in /app and write that (or copy
> > > from /cake/app_controller.php):
> > >  > > class AppController extends Controller {
>
> > >   // callback example
> > >   function beforeFilter() {
> > > // will be called for ALL controllers
> > >   }
>
> > >   // custom function example
> > >   function __myprivate() {
> > > // available in every controller with $this->__myprivate()
> > >   }}
>
> > > ?>
>
> > > 3. look at the content of $this
> > >   pr($this)
> > > and you'll see:
> > > $this->name // name of the controller (string)
> > > $this->action // name of the action (string)
> > > $this->params // parameters of the action (array)
> > > $this->passedArgs // named parameters of the action (array)
>
> > > On 21 août, 12:22, cronet <[EMAIL PROTECTED]> wrote:
>
> > > > Thank you for your reply.
> > > > 1. Ok. 1 is clear now.
>
> > > > 2. How do i extend AppController?
>
> > > > 3. I wanted to get behind the 'action' Parameter for the beforeFilter
> > > > function, because i only want to use it on specific actions.
> > > > So I thought I look at the API...
>
> > > > On 21 Aug., 12:07, djiize <[EMAIL PROTECTED]> wrote:
>
> > > > > 1. in Cake conventions, function prefixed with __ is private, so
> > > > > you're correct
>
> > > > > 2. if you need to access a function from several controllers, don't
> > > > > put it in a specific one, move it to app_controller.php.
> > > > > Since all your controllers extend AppController, 
> > > > > $this->__validateLogin() is OK
>
> > > > > IMHO a validateLogin() function is more in a Model than in a
> > > > > Constroller, but depends of what you're doing in it.
>
> > > > > 3. just override beforeFilter in your controller, and you'll have
> > > > > access to controller's variables with $this.
> > > > > Maybe I don't understand well your question here...
>
> > > > > On 21 août, 11:25, cronet <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hi There,
>
> > > > > > I just started using cake, and having heavy troubles getting some
> > > > > > basic things to work
>
> > > > > > 1. How do I define a function without a view?
> > > > > > I read somewhere on the net, that these actions/functions start 
> > > > > > with a
> > > > > > double underscore...
> > > > > > example: function __validateLogin()
> > > > > > Is this okay?
>
> > > > > > 2. How to access the function defined in 1 from other Controllers?
> > > > > > In the same controller i simply use $this->__validateLogin();
> > > > > > But in other controllers?
>
> > > > > > 3. How to get infos from the API?
> > > > > > e.g. i tried to get informations, what parameters could be used in 
> > > > > > the
> > > > > > beforeFilter function...
> > > > > > I simply searched the api for "beforeFilter" and found the first 
> > > > > > entry
> > > > > > useful : "Controller::beforeFilter()";
> > > > > > But on line 1127 of file controller.php only
>
> > > > > > 01123 /**
> > > > > > 01124  * Called before the controller action.  Overridden in
> > > > > > subclasses.
> > > > > > 01125  *
> > > > > > 01126  */
> > > > > > 01127 function beforeFilter() {
> > > > > > 01128 }
>
> > > > > > Nothing more... Wher can I find the source to get the params 
> > > > > > section?
>
> > > > > > Perhaps someone could help me and describes how to solve this...
>
> > > > > > Greetings,
> > > > > > Alexander


--~--~-~--~~~---~--~~
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 fix error on line 162 when trying update or delete warning in dbo_mssql.php

2007-08-21 Thread Apulis

I can connect to sql server, I even can create new records, but
browser displaying some errors and all with line 162 in dbo_mssql.php.
I can't delete modify data. Maybe anybody had the same problem?


--~--~-~--~~~---~--~~
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: Recordset Paging

2007-08-21 Thread [EMAIL PROTECTED]

THANKS A LOT!!!

Pagination in Cake 1.2. is much much better than in Cake 1.1

It's very easy with good example based on the link above.



--~--~-~--~~~---~--~~
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: R: Auditing

2007-08-21 Thread alan

I think it would be useful for you to look through the API.

http://api.cakephp.org/model__php5_8php-source.html#l00771

specifically:

00842 if (count($fields)) {
00843 if (!empty($this->id)) {
00844 if ($db->update($this, $fields, $values)) {
00845 if (!empty($joined)) {
00846 $this->__saveMulti($joined, $this->id);
00847 }
00848
00849 $this->afterSave();
00850 $this->data = false;
00851 $this->_clearCache();
00852 return true;
00853 } else {
00854 return false;
00855 }
00856 } else {
00857 if ($db->create($this, $fields, $values)) {
00858 if (!empty($joined)) {
00859 $this->__saveMulti($joined, $this->id);
00860 }
00861
00862 $this->afterSave();
00863 $this->data = false;
00864 $this->_clearCache();
00865 $this->validationErrors = array();
00866 return true;
00867 } else {
00868 return false;
00869 }
00870 }
00871 } else {
00872 return false;
00873 }


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



Saving search criteria - Clueless!

2007-08-21 Thread [EMAIL PROTECTED]

I'm building a property site (trying anyway!)

I've constructed my search $conditions from the data submitted in the
search form - it gives me an array:

Array ( [Letting] => Array ( [bedrooms] => 3 [price] => BETWEEN 500
AND 600 [area_id] => Array ( [0] => 02 [1] => 03 ) ) )

which in the SQL request gets converted by CAKE into:

WHERE (`bedrooms` = 3) AND (`price` BETWEEN '500' AND '600') AND
(`area_id` IN (02, 03) )

but I want to offer the option for the user to save these search
criteria so the site will email new property details to the  user
automagically.

If I split the $conditions array apart I'll need to save four or more
separate rows and build logic to reconstruct them when the time comes
to check for new properties.

Can I just grab the complete query (without running it) and cram it
into a field?


--~--~-~--~~~---~--~~
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: changing view to display name field instead of id

2007-08-21 Thread NOSLOW

Please provide a little more detail. I'm not following totally because
when you say the two models are not directly associated, but one has
the id of the other, that's a contradiction. When a table has a
foreign key, it's directly related to that other table. Just make sure
you define that relation in the model. Then you can set the recursive
level when executing a find(), and the name field of the related table
will get returned.

NOSLOW


--~--~-~--~~~---~--~~
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: Newbie: Split form accross three views ?

2007-08-21 Thread MrTufty

It's possible to do anything with Cake that you can with standard PHP
and then some.

Depending on how you wanted it to work, you could use $_POST, or
$_SESSION as you say.

$_POST would just involve having a bunch of hidden fields that you
store the information from the earlier steps into.

I don't think you'll be able to bake it though, probably a manual job!

Tufty

On Aug 21, 8:59 am, _olsen <[EMAIL PROTECTED]> wrote:
> Hello,
>
> is it possible with cake 1.2 to split a form in three views,
>
> example:
>
> http://myurl.com/addhttp://myurl.com/add2http://myurl.com/add3
>
> I want that the last view records the stuff from the other views into
> the db,
> so I have to use session.
>
> I baked one view and the tried to splitt. but I lost the data from the
> two other views..
>
> Please give me a little kick,
>
> :)
>
> Thanks,
>
> olsen


--~--~-~--~~~---~--~~
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: R: Auditing

2007-08-21 Thread zipman

The problem although is that still I do not have access to the
new row,namely I don't know what field was updated. Is there any
way to do this without triggers?

On Aug 21, 4:19 pm, zipman <[EMAIL PROTECTED]> wrote:
> Thanks a lot guys. I am using postgres and cakephp 1.1
> and I think I'd rather first try the approach m.sbragi suggested.


--~--~-~--~~~---~--~~
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: request for update of session library

2007-08-21 Thread Chris Hartjes

On 8/21/07, tombazza <[EMAIL PROTECTED]> wrote:
>
> The current session library within cake is in my opinion poorly
> constructed. I would like to request that as a priority the cake team
> take a look at this for a couple of reasons.

Feel free to go over to trac.cakephp.org and file a ticket with all
your suggestions.


-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  "Just build it, damnit!"

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



afterFilter in app_controller

2007-08-21 Thread jogo1337

Hello,

in my app_controller i will add some variables to all links in my
rendered view. Therefore i will use the afterFilter callback.
But how do i get access to the rendered view from my app_controller?

thx

Cheers


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



Error validation message

2007-08-21 Thread iritty

Hi,
I have a user registration page. cake error validation for form fields
given working correctly on local machine. but not on the server. no
msg is shown. i am using cake 1.1.
pls 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
-~--~~~~--~~--~--~---



request for update of session library

2007-08-21 Thread tombazza

The current session library within cake is in my opinion poorly
constructed. I would like to request that as a priority the cake team
take a look at this for a couple of reasons.

1. The object has a few forced options, namely the cookieLifeTime
variable, which is completely inaccessible outside of this core
library.
2. Forcing un-documented options, like referrer checking on 'high'
security? This is not good practice when you are only using 'high'
security to enforce a 0 cookieLifeTime.
3. Modifying the __construct to include instances for dealing with
cookies on multiple sub domains. This is not a complicated fix,
involving perhaps 1 explode and a bit of string manipulation to add a
'.' in front of a domain name by default (if it is not an IP address).
4. Remove the 'Session is valid' __error__?
5. Extract the database functionality out to a different class, namely
so the function names are not almost clashing with public methods to
the Session object.

Don't want to sound like I'm bitching, it's a lovely framework. But it
seems like too many people tried to add their own touch to this
particular object.

--tombazza


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



wrong summation using php to read mysql database

2007-08-21 Thread Asembereng

I want to read from a database using php commands and grouping by
timetype jobdatefrom endyear and nctype and summing the groups for
everymonth but instead it sums up for all the months. Here are the
Codes i wrote for that:


$query = mysql_query("select distinct sum(ChargeTime) as ChargeTime,
sum(Amount) as AmounT , ClientName,
JobDateFrom,JobDateTo,endYear,NcType from jobs where TimeType=0 group
by TimeType, JobDateFrom, endYear, NcType having
JobDateFrom>=Date('$startdate') and JobDateTo=('$enddate')");



thats the query i am using. Can anyone help me on this?? Its an urgent
matter. thank you!!


--~--~-~--~~~---~--~~
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: R: Auditing

2007-08-21 Thread zipman

Thanks a lot guys. I am using postgres and cakephp 1.1
and I think I'd rather first try the approach m.sbragi suggested.


--~--~-~--~~~---~--~~
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: Recordset Paging

2007-08-21 Thread Pablo Viojo

Try:

For Cake 1.1.x [1]
For Cake 1.2.x [2]

-- 
Pablo Viojo
[EMAIL PROTECTED]
http://pviojo.net


[1] http://bakery.cakephp.org/articles/view/pagination
[2] http://bakery.cakephp.org/articles/view/basic-pagination-overview-3

On 8/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I want to add next previous button in my Photos view.
>
> How to do this in very easy way, with only few lines of code?
>
> In Ruby on Rails i do something like this:
> <%= link_to 'Previous' , {: page => @photo_pages.current.previous }
> if
> @photo_pages.current.previous %>
>
> How should i do this in CakePHP?
>
> This is my controller:
>
> function view($id)
> {
> $this->set('photo', $this->Photo->findById($id));
> }
>
> Please write me some suggestions
>
> Stachu
>
>
> >
>

--~--~-~--~~~---~--~~
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: Recordset Paging

2007-08-21 Thread Howard Glynn
http://manual.cakephp.org/chapter/models

findNeighbours()

RTM etc.



On 8/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> I want to add next previous button in my Photos view.
>
>

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



Recordset Paging

2007-08-21 Thread [EMAIL PROTECTED]

I want to add next previous button in my Photos view.

How to do this in very easy way, with only few lines of code?

In Ruby on Rails i do something like this:
<%= link_to 'Previous' , {: page => @photo_pages.current.previous }
if
@photo_pages.current.previous %>

How should i do this in CakePHP?

This is my controller:

function view($id)
{
$this->set('photo', $this->Photo->findById($id));
}

Please write me some suggestions

Stachu


--~--~-~--~~~---~--~~
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: Newbie starting questions for 1.2.x!

2007-08-21 Thread djiize

the beforeFilter function have no parameters
but you can get the parameters sent to the action by $this->params

On 21 août, 13:28, cronet <[EMAIL PROTECTED]> wrote:
> 2. Great. This works!
>
> 3. That's great for debbugging!
> ehm. But:
> I tried to figure out what params the beforeFilter function accepts.
> That isn't in the output...
>
> On 21 Aug., 12:57, djiize <[EMAIL PROTECTED]> wrote:
>
> > 2. create a file app_controller.php in /app and write that (or copy
> > from /cake/app_controller.php):
> >  > class AppController extends Controller {
>
> >   // callback example
> >   function beforeFilter() {
> > // will be called for ALL controllers
> >   }
>
> >   // custom function example
> >   function __myprivate() {
> > // available in every controller with $this->__myprivate()
> >   }}
>
> > ?>
>
> > 3. look at the content of $this
> >   pr($this)
> > and you'll see:
> > $this->name // name of the controller (string)
> > $this->action // name of the action (string)
> > $this->params // parameters of the action (array)
> > $this->passedArgs // named parameters of the action (array)
>
> > On 21 août, 12:22, cronet <[EMAIL PROTECTED]> wrote:
>
> > > Thank you for your reply.
> > > 1. Ok. 1 is clear now.
>
> > > 2. How do i extend AppController?
>
> > > 3. I wanted to get behind the 'action' Parameter for the beforeFilter
> > > function, because i only want to use it on specific actions.
> > > So I thought I look at the API...
>
> > > On 21 Aug., 12:07, djiize <[EMAIL PROTECTED]> wrote:
>
> > > > 1. in Cake conventions, function prefixed with __ is private, so
> > > > you're correct
>
> > > > 2. if you need to access a function from several controllers, don't
> > > > put it in a specific one, move it to app_controller.php.
> > > > Since all your controllers extend AppController, 
> > > > $this->__validateLogin() is OK
>
> > > > IMHO a validateLogin() function is more in a Model than in a
> > > > Constroller, but depends of what you're doing in it.
>
> > > > 3. just override beforeFilter in your controller, and you'll have
> > > > access to controller's variables with $this.
> > > > Maybe I don't understand well your question here...
>
> > > > On 21 août, 11:25, cronet <[EMAIL PROTECTED]> wrote:
>
> > > > > Hi There,
>
> > > > > I just started using cake, and having heavy troubles getting some
> > > > > basic things to work
>
> > > > > 1. How do I define a function without a view?
> > > > > I read somewhere on the net, that these actions/functions start with a
> > > > > double underscore...
> > > > > example: function __validateLogin()
> > > > > Is this okay?
>
> > > > > 2. How to access the function defined in 1 from other Controllers?
> > > > > In the same controller i simply use $this->__validateLogin();
> > > > > But in other controllers?
>
> > > > > 3. How to get infos from the API?
> > > > > e.g. i tried to get informations, what parameters could be used in the
> > > > > beforeFilter function...
> > > > > I simply searched the api for "beforeFilter" and found the first entry
> > > > > useful : "Controller::beforeFilter()";
> > > > > But on line 1127 of file controller.php only
>
> > > > > 01123 /**
> > > > > 01124  * Called before the controller action.  Overridden in
> > > > > subclasses.
> > > > > 01125  *
> > > > > 01126  */
> > > > > 01127 function beforeFilter() {
> > > > > 01128 }
>
> > > > > Nothing more... Wher can I find the source to get the params section?
>
> > > > > Perhaps someone could help me and describes how to solve this...
>
> > > > > Greetings,
> > > > > Alexander


--~--~-~--~~~---~--~~
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: R: othAuth component v0.5.4.5

2007-08-21 Thread Baz
I'll give it another shot and post my error message.
--
Baz L
Day In The Life of Baz
http://www.LifeOfBaz.com

On 8/21/07, joebaker <[EMAIL PROTECTED]> wrote:
>
>
> Did I miss your error message?  or You haven't posted it yet...
> I struggled a bit initially with this component, but after a night of
> persistent debugging to understand exactly how the code works I was
> able to successfully get it working.  I'm not sure I'll be able to
> help as I'm somewhat of a newbie myself... But, I'll try ...
>
> On Aug 20, 9:52 am, NOSLOW <[EMAIL PROTECTED]> wrote:
> > > If I can get it to work, then I'll write a tutorial for morons like
> myself.
> >
> > Baz, I think you have the wrong forum. No one volunteers to write
> > documentation themselves...they get volunteered by others :)
> >
> > Seriously, though, I hope you get it to work as I'm, too, a self-
> > proclaimed moron (ok, maybe the title was "volunteered" on me by
> > others). Adding auth to my big app is something I'll do at the end
> > after I just build it first (damn it!). By that time, othAuth should
> > be at like version 12 and when it doesn't work for me, I'll be quite
> > convinced it's just me being a moron. Then I'll have you're tutorial
> > to look forward to.
> >
> > NOSLOW
>
>
> >
>

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



Assigning Permissions in Acl 1.2

2007-08-21 Thread Flan

Hello,

I'm looking at using Acl in 1.2 and came across some behaviour which
is either a bug or I haven't understood how to use the component
properly. I don't have a lot of experience with Acl and maybe I have
set it up wrong, but maybe someone has come across or can explain the
behaviour? (I have changed the code so it works for me, given below)

(I've tried this on the latest 1.2.x.x_16.08.2007 build)

I have set up some aros and acos, next I try to assign permissions as
follows;

$aroKey = array('model' => 'Group', 'foreign_key' => 5);
$acoKey = array('model' => 'ControllerAco', 'foreign_key' => 6);

$this->Acl->allow($aroKey, $acoKey, 'create');

This allows 'create' as expected but also allows 'read', 'update' and
'delete' for the $acoKey by $aroKey.

If I then do

$this->Acl->deny($aroKey, $acoKey, 'create');

it denies 'create' as expected but also 'read', 'update' and 'delete'
for the $acoKey by $aroKey even if they are not specified.

I have looked at the code and it seems to me the problem is in
DB_ACL::allow()


/*** The Original code ***/

if (isset($perms[0])) {
//$save = $perms[0]['Permission'];
$save = $perms['link'][0]['Permission'];<- My edit
}

if ($actions == "*") {
$permKeys = 
$this->_getAcoKeys($this->Aro->Permission->loadInfo());

foreach ($permKeys as $key) {
$save[$key] = $value;
}
} else {
if (!is_array($actions)) {
$actions = array('_' . $actions);
$actions = am($permKeys, $actions);
}
if (is_array($actions)) {
foreach ($actions as $action) {
if ($action{0} != '_') {
$action = '_' . $action;
}
if (in_array($action, $permKeys)) {
$save[$action] = $value;
}
}
}
}

/*** Code that works for me and what I want to do
***/

if (isset($perms['link'][0])) {
$save = $perms['link'][0]['Permission'];<- 
My edit
}

if ($actions == "*") {
$permKeys = 
$this->_getAcoKeys($this->Aro->Permission->loadInfo());

foreach ($permKeys as $key) {
$save[$key] = $value;
}
} else {
if (!is_array($actions)) {
$actions = array('_' . $actions);
//$actions = am($permKeys, $actions);   
<- My edit
}
if (is_array($actions)) {
foreach ($actions as $action) {
if ($action{0} != '_') {
$action = '_' . $action;
}
if (in_array($action, $permKeys)) {
$save[$action] = $value;
}
}
}
}


/
***/

At least in the original code for my use "$save = $perms[0]
['Permission'];" always ends up as NULL.

I realise that if this is a bug it should be in trac, but a second
opinion would be good to avoid making unnecessary bug reports.

Thanks

Adrian


--~--~-~--~~~---~--~~
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: detect updated fields in model after save

2007-08-21 Thread Grant Cox

Not exactly, because the update does not do a query first (would be
inefficient for the vast majority of cases).  But there is the
beforeSave callback which is a good place to first load the existing
data, then you can compare against what is about to be saved to see
what actually changes.


On Aug 21, 7:45 pm, rtanz <[EMAIL PROTECTED]> wrote:
> hi i would like to detect which fields have been changed after
> completion of my edit function. is there some cake automagic that
> helps in doing this? 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
-~--~~~~--~~--~--~---



Re: Newbie starting questions for 1.2.x!

2007-08-21 Thread cronet

2. Great. This works!

3. That's great for debbugging!
ehm. But:
I tried to figure out what params the beforeFilter function accepts.
That isn't in the output...



On 21 Aug., 12:57, djiize <[EMAIL PROTECTED]> wrote:
> 2. create a file app_controller.php in /app and write that (or copy
> from /cake/app_controller.php):
>  class AppController extends Controller {
>
>   // callback example
>   function beforeFilter() {
> // will be called for ALL controllers
>   }
>
>   // custom function example
>   function __myprivate() {
> // available in every controller with $this->__myprivate()
>   }}
>
> ?>
>
> 3. look at the content of $this
>   pr($this)
> and you'll see:
> $this->name // name of the controller (string)
> $this->action // name of the action (string)
> $this->params // parameters of the action (array)
> $this->passedArgs // named parameters of the action (array)
>
> On 21 août, 12:22, cronet <[EMAIL PROTECTED]> wrote:
>
> > Thank you for your reply.
> > 1. Ok. 1 is clear now.
>
> > 2. How do i extend AppController?
>
> > 3. I wanted to get behind the 'action' Parameter for the beforeFilter
> > function, because i only want to use it on specific actions.
> > So I thought I look at the API...
>
> > On 21 Aug., 12:07, djiize <[EMAIL PROTECTED]> wrote:
>
> > > 1. in Cake conventions, function prefixed with __ is private, so
> > > you're correct
>
> > > 2. if you need to access a function from several controllers, don't
> > > put it in a specific one, move it to app_controller.php.
> > > Since all your controllers extend AppController, $this->__validateLogin() 
> > > is OK
>
> > > IMHO a validateLogin() function is more in a Model than in a
> > > Constroller, but depends of what you're doing in it.
>
> > > 3. just override beforeFilter in your controller, and you'll have
> > > access to controller's variables with $this.
> > > Maybe I don't understand well your question here...
>
> > > On 21 août, 11:25, cronet <[EMAIL PROTECTED]> wrote:
>
> > > > Hi There,
>
> > > > I just started using cake, and having heavy troubles getting some
> > > > basic things to work
>
> > > > 1. How do I define a function without a view?
> > > > I read somewhere on the net, that these actions/functions start with a
> > > > double underscore...
> > > > example: function __validateLogin()
> > > > Is this okay?
>
> > > > 2. How to access the function defined in 1 from other Controllers?
> > > > In the same controller i simply use $this->__validateLogin();
> > > > But in other controllers?
>
> > > > 3. How to get infos from the API?
> > > > e.g. i tried to get informations, what parameters could be used in the
> > > > beforeFilter function...
> > > > I simply searched the api for "beforeFilter" and found the first entry
> > > > useful : "Controller::beforeFilter()";
> > > > But on line 1127 of file controller.php only
>
> > > > 01123 /**
> > > > 01124  * Called before the controller action.  Overridden in
> > > > subclasses.
> > > > 01125  *
> > > > 01126  */
> > > > 01127 function beforeFilter() {
> > > > 01128 }
>
> > > > Nothing more... Wher can I find the source to get the params section?
>
> > > > Perhaps someone could help me and describes how to solve this...
>
> > > > Greetings,
> > > > Alexander


--~--~-~--~~~---~--~~
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: Newbie starting questions for 1.2.x!

2007-08-21 Thread djiize

2. create a file app_controller.php in /app and write that (or copy
from /cake/app_controller.php):
__myprivate()
  }
}
?>

3. look at the content of $this
  pr($this)
and you'll see:
$this->name // name of the controller (string)
$this->action // name of the action (string)
$this->params // parameters of the action (array)
$this->passedArgs // named parameters of the action (array)

On 21 août, 12:22, cronet <[EMAIL PROTECTED]> wrote:
> Thank you for your reply.
> 1. Ok. 1 is clear now.
>
> 2. How do i extend AppController?
>
> 3. I wanted to get behind the 'action' Parameter for the beforeFilter
> function, because i only want to use it on specific actions.
> So I thought I look at the API...
>
> On 21 Aug., 12:07, djiize <[EMAIL PROTECTED]> wrote:
>
> > 1. in Cake conventions, function prefixed with __ is private, so
> > you're correct
>
> > 2. if you need to access a function from several controllers, don't
> > put it in a specific one, move it to app_controller.php.
> > Since all your controllers extend AppController, $this->__validateLogin() 
> > is OK
>
> > IMHO a validateLogin() function is more in a Model than in a
> > Constroller, but depends of what you're doing in it.
>
> > 3. just override beforeFilter in your controller, and you'll have
> > access to controller's variables with $this.
> > Maybe I don't understand well your question here...
>
> > On 21 août, 11:25, cronet <[EMAIL PROTECTED]> wrote:
>
> > > Hi There,
>
> > > I just started using cake, and having heavy troubles getting some
> > > basic things to work
>
> > > 1. How do I define a function without a view?
> > > I read somewhere on the net, that these actions/functions start with a
> > > double underscore...
> > > example: function __validateLogin()
> > > Is this okay?
>
> > > 2. How to access the function defined in 1 from other Controllers?
> > > In the same controller i simply use $this->__validateLogin();
> > > But in other controllers?
>
> > > 3. How to get infos from the API?
> > > e.g. i tried to get informations, what parameters could be used in the
> > > beforeFilter function...
> > > I simply searched the api for "beforeFilter" and found the first entry
> > > useful : "Controller::beforeFilter()";
> > > But on line 1127 of file controller.php only
>
> > > 01123 /**
> > > 01124  * Called before the controller action.  Overridden in
> > > subclasses.
> > > 01125  *
> > > 01126  */
> > > 01127 function beforeFilter() {
> > > 01128 }
>
> > > Nothing more... Wher can I find the source to get the params section?
>
> > > Perhaps someone could help me and describes how to solve this...
>
> > > Greetings,
> > > Alexander


--~--~-~--~~~---~--~~
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: A problem with paths

2007-08-21 Thread ifcanduela

Thanks, a lot, after some chats with the hosting people, they deleted
the .htaccess files specified in the blog tutorial and almost
everything is working now.

I have another problem though, and this time it's related to including
javascript files. I use

echo $javascript->link('prototype');

to include Prototype in the templates. I've already tried with some
other methods listed in the API docs. I guess this should add
something like



to the page, but it doesn't. PHP just halts execution of the script
and the page returned to the browser is 7 lines long -- from the
doctype declaration to a css link made with $html->link(). If instead
of the cake code I write the HTML 

Re: MySQL : tinyint(1) : doesn't allow you to enter 0-9 as valid values

2007-08-21 Thread luke BAKING barker

I use smallint (3) for this kind of number as it helps distinguish the
general size of the number. I dont bother over-optimizing these too
much as it causes confusion later I think. (e.g. I just let emails be
varchar 127, names be varchar 63 ) I figure I can always optimize if I
locate a performance issue. Although a "little" bit of thought is
useful initially its better not to dwell and jsut try and ocme up with
a convention.

Luke

On Aug 21, 7:18 am, alan <[EMAIL PROTECTED]> wrote:
> Spent a while trying to figure out why I couldn't save [2] as a value
> of a field that was of type >> tinyint(1)
>
> As it turns out, i just needed to change the field to >> int(1)
>
> I know this might seem a bit off topic but if others are like me -
> they will think it's a problem with cake... go digging through the API
> documentation, and start cursing at the screen...
>
> all for want of some basic MySQL field type understanding.  More of
> that at:
>
> http://dev.mysql.com/doc/refman/4.1/en/numeric-types.html
>
> { note: was using the field for a numeric status or level field.  I
> suspect someone might come across this post looking for information on
> why a status field only ever saves as 1 or 0, never as 2, 3, 4, 5,
> etc.. }


--~--~-~--~~~---~--~~
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: Newbie starting questions for 1.2.x!

2007-08-21 Thread cronet

Thank you for your reply.
1. Ok. 1 is clear now.

2. How do i extend AppController?

3. I wanted to get behind the 'action' Parameter for the beforeFilter
function, because i only want to use it on specific actions.
So I thought I look at the API...


On 21 Aug., 12:07, djiize <[EMAIL PROTECTED]> wrote:
> 1. in Cake conventions, function prefixed with __ is private, so
> you're correct
>
> 2. if you need to access a function from several controllers, don't
> put it in a specific one, move it to app_controller.php.
> Since all your controllers extend AppController, $this->__validateLogin() is 
> OK
>
> IMHO a validateLogin() function is more in a Model than in a
> Constroller, but depends of what you're doing in it.
>
> 3. just override beforeFilter in your controller, and you'll have
> access to controller's variables with $this.
> Maybe I don't understand well your question here...
>
> On 21 août, 11:25, cronet <[EMAIL PROTECTED]> wrote:
>
> > Hi There,
>
> > I just started using cake, and having heavy troubles getting some
> > basic things to work
>
> > 1. How do I define a function without a view?
> > I read somewhere on the net, that these actions/functions start with a
> > double underscore...
> > example: function __validateLogin()
> > Is this okay?
>
> > 2. How to access the function defined in 1 from other Controllers?
> > In the same controller i simply use $this->__validateLogin();
> > But in other controllers?
>
> > 3. How to get infos from the API?
> > e.g. i tried to get informations, what parameters could be used in the
> > beforeFilter function...
> > I simply searched the api for "beforeFilter" and found the first entry
> > useful : "Controller::beforeFilter()";
> > But on line 1127 of file controller.php only
>
> > 01123 /**
> > 01124  * Called before the controller action.  Overridden in
> > subclasses.
> > 01125  *
> > 01126  */
> > 01127 function beforeFilter() {
> > 01128 }
>
> > Nothing more... Wher can I find the source to get the params section?
>
> > Perhaps someone could help me and describes how to solve this...
>
> > Greetings,
> > Alexander


--~--~-~--~~~---~--~~
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: Storing Site Preferences

2007-08-21 Thread Braindead

Thanks for the link. After searching the Bakery I found the tutorial
for the component:
http://bakery.cakephp.org/articles/view/confcomponent-db-based-configuration-tutorial

Brain


--~--~-~--~~~---~--~~
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: Newbie starting questions for 1.2.x!

2007-08-21 Thread djiize

1. in Cake conventions, function prefixed with __ is private, so
you're correct

2. if you need to access a function from several controllers, don't
put it in a specific one, move it to app_controller.php.
Since all your controllers extend AppController, $this-
>__validateLogin() is OK
IMHO a validateLogin() function is more in a Model than in a
Constroller, but depends of what you're doing in it.

3. just override beforeFilter in your controller, and you'll have
access to controller's variables with $this.
Maybe I don't understand well your question here...

On 21 août, 11:25, cronet <[EMAIL PROTECTED]> wrote:
> Hi There,
>
> I just started using cake, and having heavy troubles getting some
> basic things to work
>
> 1. How do I define a function without a view?
> I read somewhere on the net, that these actions/functions start with a
> double underscore...
> example: function __validateLogin()
> Is this okay?
>
> 2. How to access the function defined in 1 from other Controllers?
> In the same controller i simply use $this->__validateLogin();
> But in other controllers?
>
> 3. How to get infos from the API?
> e.g. i tried to get informations, what parameters could be used in the
> beforeFilter function...
> I simply searched the api for "beforeFilter" and found the first entry
> useful : "Controller::beforeFilter()";
> But on line 1127 of file controller.php only
>
> 01123 /**
> 01124  * Called before the controller action.  Overridden in
> subclasses.
> 01125  *
> 01126  */
> 01127 function beforeFilter() {
> 01128 }
>
> Nothing more... Wher can I find the source to get the params section?
>
> Perhaps someone could help me and describes how to solve this...
>
> Greetings,
> Alexander


--~--~-~--~~~---~--~~
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: Storing Site Preferences

2007-08-21 Thread Jon Bennett

 > I'm currently also using a seperate file to store the configuration.
> But I would prefer to store it in my database.
>
> Where is the best place to query the database for the settings? When
> the bootstrap.php is executed, the models are not yet available. Do I
> have to use beforeFilter in every controller to query the database? Or
> is there a better way?

this might help...

http://bakery.cakephp.org/articles/view/confcomponent-db-based-configuration

jb


-- 

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



detect updated fields in model after save

2007-08-21 Thread rtanz

hi i would like to detect which fields have been changed after
completion of my edit function. is there some cake automagic that
helps in doing this? 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
-~--~~~~--~~--~--~---



detect updated fields in model after save

2007-08-21 Thread rtanz

hi i would like to detect which fields have been changed after
completion of my edit function. is there some cake automagic that
helps in doing this? 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
-~--~~~~--~~--~--~---



Newbie starting questions for 1.2.x!

2007-08-21 Thread cronet

Hi There,

I just started using cake, and having heavy troubles getting some
basic things to work

1. How do I define a function without a view?
I read somewhere on the net, that these actions/functions start with a
double underscore...
example: function __validateLogin()
Is this okay?

2. How to access the function defined in 1 from other Controllers?
In the same controller i simply use $this->__validateLogin();
But in other controllers?

3. How to get infos from the API?
e.g. i tried to get informations, what parameters could be used in the
beforeFilter function...
I simply searched the api for "beforeFilter" and found the first entry
useful : "Controller::beforeFilter()";
But on line 1127 of file controller.php only

01123 /**
01124  * Called before the controller action.  Overridden in
subclasses.
01125  *
01126  */
01127 function beforeFilter() {
01128 }

Nothing more... Wher can I find the source to get the params section?

Perhaps someone could help me and describes how to solve this...

Greetings,
Alexander


--~--~-~--~~~---~--~~
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: Storing Site Preferences

2007-08-21 Thread Braindead

I'm currently also using a seperate file to store the configuration.
But I would prefer to store it in my database.

Where is the best place to query the database for the settings? When
the bootstrap.php is executed, the models are not yet available. Do I
have to use beforeFilter in every controller to query the database? Or
is there a better way?

Regards,
Brain



--~--~-~--~~~---~--~~
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 to write my own ajax with cakephp

2007-08-21 Thread Wimg

Thx a lot !

On Aug 21, 11:29 am, Grant Cox <[EMAIL PROTECTED]> wrote:
> CakePHP doesn't change the way you write your Ajax - just use whatever
> JS framework in its normal way.  Cake does have an Ajax helper which
> can simplify the process of writing Prototype compatible ajax queries,
> but it's still just generating some javascript that is run on the
> client, there is no magic.
>
> Here's a snippet of Ajax from our application, using Prototype/
> Scriptaculous.  This is a core function of our ajax code, so it is
> very powerful.
>
> new Ajax.Request(url, options);
>
> On Aug 21, 12:29 pm, Wimg <[EMAIL PROTECTED]> wrote:
>
>
>
> > can anyone give me a little example of ajax with cakephp?- Hide quoted text 
> > -
>
> - Show quoted text -


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



Newbie: Split form accross three views ?

2007-08-21 Thread _olsen

Hello,

is it possible with cake 1.2 to split a form in three views,

example:

http://myurl.com/add
http://myurl.com/add2
http://myurl.com/add3

I want that the last view records the stuff from the other views into
the db,
so I have to use session.

I baked one view and the tried to splitt. but I lost the data from the
two other views..

Please give me a little kick,

:)

Thanks,

olsen


--~--~-~--~~~---~--~~
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: R: othAuth component v0.5.4.5

2007-08-21 Thread joebaker

Did I miss your error message?  or You haven't posted it yet...
I struggled a bit initially with this component, but after a night of
persistent debugging to understand exactly how the code works I was
able to successfully get it working.  I'm not sure I'll be able to
help as I'm somewhat of a newbie myself... But, I'll try ...

On Aug 20, 9:52 am, NOSLOW <[EMAIL PROTECTED]> wrote:
> > If I can get it to work, then I'll write a tutorial for morons like myself.
>
> Baz, I think you have the wrong forum. No one volunteers to write
> documentation themselves...they get volunteered by others :)
>
> Seriously, though, I hope you get it to work as I'm, too, a self-
> proclaimed moron (ok, maybe the title was "volunteered" on me by
> others). Adding auth to my big app is something I'll do at the end
> after I just build it first (damn it!). By that time, othAuth should
> be at like version 12 and when it doesn't work for me, I'll be quite
> convinced it's just me being a moron. Then I'll have you're tutorial
> to look forward to.
>
> NOSLOW


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



MySQL : tinyint(1) : doesn't allow you to enter 0-9 as valid values

2007-08-21 Thread alan

Spent a while trying to figure out why I couldn't save [2] as a value
of a field that was of type >> tinyint(1)

As it turns out, i just needed to change the field to >> int(1)

I know this might seem a bit off topic but if others are like me -
they will think it's a problem with cake... go digging through the API
documentation, and start cursing at the screen...

all for want of some basic MySQL field type understanding.  More of
that at:

http://dev.mysql.com/doc/refman/4.1/en/numeric-types.html

{ note: was using the field for a numeric status or level field.  I
suspect someone might come across this post looking for information on
why a status field only ever saves as 1 or 0, never as 2, 3, 4, 5,
etc.. }


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