Re: How to edit two tables in the same interface?

2007-02-13 Thread vittore

Lyn, hi

your porblem is that you do not think in sql reality)
you want relation many-to-many
so you have to introduce one more table
and so youll get
1st  table: books (id,  name)
2nd table: questions (id, q_title, q_data)
3rd  table: books_questions (book_id, question,id)

may be 4th table "requestion" , just the same struct. like third

and you have to use have-many-and-belongs-to relation


On Feb 14, 2:46 am, "lynda" <[EMAIL PROTECTED]> wrote:
> Thank you for your reply! Table req_questions is a table to define
> questions, and table books just has the fields questions and
> req_questions to list question_ids in these two fields. Table books
> has other fields like category, articles, sections and segments, I
> didn't include them because I just want to edit questions and
> req_question fields, and delete question_ids in these 2 fields when I
> delete question_id in table questions. I am not allowed to change
> table. At first I was using $hasMany in model Question. For example,
> var $hasMany = array('Book' =>'Book');
> it gave me empty array because it requires these two tables associated
> by a foreign key, question_id is not a foreign key in table books.
> Below are my table look like:
> books
> book_id  questionsreq_questions  title
> 1   11, 23, 33 23, 33This is a
> book
> 2   18, 23, 39 23This is
> another book
>
> questions
> question_id   question_title  question_data
> 11question 11this is a question
> 18question 18 this is another questions
> 23question 23 this is another questions
> 33question 33   another questions
>
> If I set var primaryKey ='question_id' in Model Question, I think cake
> will recognize $question_id is $id.
> I am not allowed to change the table structures, I am hoping someone
> can help me to find a way to connect fields questions and
> req_questions to question_id.
>
> Thanks!
> Lynda
>
> On Feb 13, 2:42 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > Hi Lynda,
>
> > I think the association you need is a hasMany since book can have many
> > questions.  I assume a question is specific to a book, so the question
> > model would have a belongsTo association with book.
>
> > However you have two there pointing to the same table so it's a bit
> > tricky.  What is the purpose of the questions and req_questions?
> > Maybe there's another way to achieve the same result?  Can you simply
> > put a value (1 or 0) in the questions table to denote whether it's a
> > normal quesiton or req_question?
>
> > Also as an aside, the primary key for "books" and "questions" should
> > be "id" in both cases not "book_id" and "question_id"
> > It took me a while to understand this as well. :-) Cake expects the
> > primary key of every table to be "id" and you can then refer to it
> > from other tables as "modelname_id"
>
> > e.g.
> > You could have a table "notes" to add notes about each book.
> > This table would have a field "book_id" which cake automatically links
> > to the "id" field in "books" if you setup a belongsTo association in
> > the "notes" model and a hasMany association in the "books" model.


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

2007-02-13 Thread vidya


Thanks for the help. It is now working.

Thanks
Vidya.



--~--~-~--~~~---~--~~
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 with a $hasMany, $belongsTo association...

2007-02-13 Thread alexxwiz

There is something strange here. I found where problem is.

In file cake/libs/model/datasources/dbo_source.php on line 588:

if (isset($db) && $db != null) {

This condition is _always_ false on my system. When I changed it to

if (isset($db) || $db != null) {

all begin to work fine.

Seems like a error in my php version. I use php 5.2.0.0. Will try to
download more recent and test with it.


On 13 фев, 23:09, "alexxwiz" <[EMAIL PROTECTED]> wrote:
> I'm glad for you, but my problem is still here :(
> Can someone point me where is my mistake?
>
> On 13 фев, 18:00, "shoesole" <[EMAIL PROTECTED]> wrote:
>
> > Wow. I knew it had to be something easy that I was completely
> > overlooking. Thank you so much Eric. I read the manual chapter on
> > models multiple times, but I guess that part just didn't sink in
> > (maybe next time I should read more carefully). Anyway, Thanks. This
> > is my first shot at Cake and I love it so far, but that really had me
> > confounded.
> >
> > > I have same problem.
> > > Two tables:
> > >
> > > CREATE TABLE `maincats` (
> > >   `id` int(10) unsigned NOT NULL auto_increment,
> > >   `title` varchar(255) default NULL,
> > >   `visible` tinyint(4) NOT NULL default '1',
> > >   `created` datetime NOT NULL,
> > >   PRIMARY KEY  (`id`)
> > > ) ENGINE=MyISAM;
> > >
> > > CREATE TABLE `categories` (
> > >   `id` int(10) unsigned NOT NULL auto_increment,
> > >   `title` varchar(255) default NULL,
> > >   `maincat_id` int(11) default NULL,
> > >   `visible` tinyint(4) NOT NULL default '1',
> > >   `created` datetime NOT NULL,
> > >   PRIMARY KEY  (`id`)
> > > ) ENGINE=MyISAM;
> > >
> > > Two models:
> > >
> > > class Maincat extends AppModel {
> > > var $name = 'Maincat';
> > > var $hasMany =
> > > array('Category'=>array('className'=>'Category','foreignKey' =>
> > > 'maincat_id'));
> > >
> > > }
> > >
> > > class Category extends AppModel {
> > > var $name = 'Category';
> > >
> > > }
> > >
> > > print_r($this->Maincat->findAll());
> > >
> > > returns only maincats content and none sub-categories.
> > >
> > > Array
> > > (
> > > [0] => Array
> > > (
> > > [Maincat] => Array
> > > (
> > > [id] => 1
> > > [title] => Some first
> > > [visible] => 1
> > > [created] => 2007-02-13 14:39:28
> > > )
> > >
> > > )
> > >
> > > [1] => Array
> > > (
> > > [Maincat] => Array
> > > (
> > > [id] => 2
> > > [title] => Some second
> > > [visible] => 1
> > > [created] => 2007-02-13 00:00:00
> > > )
> > >
> > > )
> > >
> > > )
> > >
> > > Where is my mistake?


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

2007-02-13 Thread sumanpaul

OceanCMS is almost dead.


On Feb 13, 9:18 pm, "fr3nch13" <[EMAIL PROTECTED]> wrote:
> the only one i know of is OceanCMS and it's still in alpha:
>
> http://cakeforge.org/projects/ocean-cms/
>
> On Feb 13, 10:11 am, "rhet" <[EMAIL PROTECTED]> wrote:
>
> > Does anyone know of any good CMS for cake? I would like the
> > application to be a plugin.


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

2007-02-13 Thread Mariano Iglesias

Field manager on Project should be manager_id, otherwise specify foreignKey
on the relationship.

Also table names should be plural, otherwise specify $useTable to define
your table name.

http://manual.cakephp.org/chapter/models

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de vidya
Enviado el: Miércoles, 14 de Febrero de 2007 03:01 a.m.
Para: Cake PHP
Asunto: problem with join

Association is Manager has many projects and project has one Manager.

But when i use $this->Project->findall(); i won't get any records. Is
there any problem with
models. Can any one help to solve this 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: Regular Expression to find content inside a tag pair

2007-02-13 Thread Felix Geisendörfer
Off the cuff I'd say: /(.*)/iUs.

Most important are the modifiers:

* i: Makes sure upper/lower- case are ignored (some people might use
  )
* U: Makes sure that all quantifiers are ungreedy, meaning that
  they'll try to match the least amount of data only
* s: Is the most important one, because it wil allow for the '.'
  character class to match line breaks which most forms will contain.

Let me know if that works for you or not,
-- Felix
--
http://www.thinkingphp.org
http://www.fg-webdesign.de


Dat Chu wrote:
> There are several things with anuke's pattern:
>
> First, it will not catch forms with attributes (=> my bad for not 
> specifying this)
> Second, since * is greedy if I have 2 forms, it will capture the 
> content between the wrong pairs of tags.
> Example of this: AAABBBCCC
>
> anuke's pattern will match the whole thing instead of just the first pair.
>
> On 2/13/07, * anuke* <[EMAIL PROTECTED] > 
> wrote:
>
>
> $pattern = '/(.*)<\/form>/';
>
> On 14 фев, 02:02, "Dat Chu" <[EMAIL PROTECTED]
> > wrote:
> > I want to find the content inside of a tag pair.
> >
> > Say form tag. What would be the way to achieve this?
> >
> > My solution so far is using a regular expression similar to this
> >
> > /]*>(.*?)/
>
>
>
>
> >

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

2007-02-13 Thread Dr. Tarique Sani

On 2/14/07, vidya <[EMAIL PROTECTED]> wrote:
> class Manager extends AppModel
> {
>
> var $name Manager
>  var $hasMany =  'Project' ;

try var $hasmany = array('Project);

HTH

Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

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



problem with join

2007-02-13 Thread vidya

Hai,

I have one question with join of two tables.

1.Project
{
   id,   primary key
   project_name;
   manager  foreign key
}
2.Manager
{
   id,  primary key
   name
}

Association is Manager has many projects and project has one Manager.

code for model is,

class Manager extends AppModel
{

var $name Manager
 var $hasMany =  'Project' ;
}

class Project extends AppModel
{
var $name ='Project';
var $belongsTo = 'Manager';
}

But when i use $this->Project->findall(); i won't get any records. Is
there any problem with
models. Can any one help to solve this problem.

Thanks,
Vidya


--~--~-~--~~~---~--~~
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: Wrapping Cake in a Joomla component, like Cake + Drupal = Drake

2007-02-13 Thread Dr. Tarique Sani

On 2/14/07, Mariano Iglesias <[EMAIL PROTECTED]> wrote:
> Well and some other features. I still have to prepare some sort of
> documentation but the code is ready and working.
>
> PS: I just submitted a request to create a new project in Cakeforge called
> Jake. When approved I'll upload code there and we can join efforts.

WOW!! this is a second wow for this since morning :)

Ain't Open Source wonderful!

Great work guys - keep at it

Cheers
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
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: Wrapping Cake in a Joomla component, like Cake + Drupal = Drake

2007-02-13 Thread Mariano Iglesias

By module I ment Joomla component ;)

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: Mariano Iglesias [mailto:[EMAIL PROTECTED] 
Enviado el: Miércoles, 14 de Febrero de 2007 02:17 a.m.
Para: 'cake-php@googlegroups.com'
Asunto: RE: Wrapping Cake in a Joomla component, like Cake + Drupal = Drake

Awesome work mate! I changed the code *a lot* (I started with your code as
the base but then I've revamped it all) and now I have a module that:


--~--~-~--~~~---~--~~
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: Wrapping Cake in a Joomla component, like Cake + Drupal = Drake

2007-02-13 Thread Mariano Iglesias

Max,

Awesome work mate! I changed the code *a lot* (I started with your code as
the base but then I've revamped it all) and now I have a module that:

1. It doesn't require *any* modification on CakePHP nor Joomla core code.

2. The CakePHP application can reside on any directory (either outside or
within joomla's path), and doesn't have to use the same DB as Joomla.

3. Your existing CakePHP application (even with normal Cake URLs) will work
without modifications. Paths to resources and links to cake actions are
transformed automatically by the component.

4. Your application can run transparently within Jake or by itself as a
standard CakePHP application. You can even know (in any part of your CakePHP
application) when it is being run by Jake, and if so do whatever you need
(for example use a different layout.)

5. Javascript and CSS libraries, as well all meta tags (even the title and
description tag!) are sent by Jake back to Joomla using the proper
rendering, so they are part of the end html code.

6. The generated HTML code is standard XHTML (as long as you do so on the
cake side as well.) I say this because in your example you had  tags
(sent by cake) inserted within joomla's  tags.

Well and some other features. I still have to prepare some sort of
documentation but the code is ready and working.

PS: I just submitted a request to create a new project in Cakeforge called
Jake. When approved I'll upload code there and we can join efforts.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Max
Enviado el: Martes, 13 de Febrero de 2007 06:41 p.m.
Para: Cake PHP
Asunto: Re: Wrapping Cake in a Joomla component, like Cake + Drupal = Drake

Just posted it: http://www.gigapromoters.com/blog/


--~--~-~--~~~---~--~~
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 did cake get the id of saved data

2007-02-13 Thread Langdon Stevenson

Thanks for the reply Nate, much appreciated.  That has cleared up a 
potential issue for me with a sequential counter that I have built.

Regards,
Langdon


nate wrote:
> @Langdon: I don't believe so.  At the PHP/MySQL interface level, the
> last insert ID is scoped to the current database connection, so as
> long as you are saving/getting the ID synchronously (i.e. not doing
> multiple saves in multiple places in the code) this should not be an
> issue.

--~--~-~--~~~---~--~~
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 avoid duplicating afterFind() logic?

2007-02-13 Thread nate

Not really.  Go ahead and open an Enhancement ticket and I'll see if I
can get to it.

On Feb 13, 10:11 pm, "cdomigan" <[EMAIL PROTECTED]> wrote:
> Brilliant, thank you nate.
>
> Are there plans for a more "cake"ish way to do this in the future? :)
>
> Chris


--~--~-~--~~~---~--~~
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 avoid duplicating afterFind() logic?

2007-02-13 Thread cdomigan

Brilliant, thank you nate.

Are there plans for a more "cake"ish way to do this in the future? :)

Chris


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



updating a sortable list ?

2007-02-13 Thread [EMAIL PROTECTED]

Hello all

I currently have a sortable list based on what I found here it's working fine,
even saving the order on a db table.

controller:

 function admin_ordenar() {

   $this->RequestHandler->setAjax($this);

if (!empty($this->params['form']['list'])) {

$lists = $this->params['form']['list'];

foreach ($lists as $order_id => $data) {
$data['order_id'] = $order_id;
if (!empty($data['id']))
$this->Capitulo->save($data);
}
}

$this->set('caps', $this->Capitulo->findAll(null, null,
'order_id ASC'));
}


function admin_index() {
$this->Capitulo->recursive = 0;
$this->set('item_list', $this->requestAction('/admin/capitulos/
ordenar', array('return'=>true)));
}

for information sake: im ordering chapters and Im using the order_id
to identify the chapter #.

Problem is I added a "delete" button on every list item (chapter),
when clicked the chapter gets deleted, and the div is updated BUT im
not able to re-sort the list (in order to reset the chapter numbering
in case the user deletes any chapter that's not the last one)

controller:

function admin_delete($id = null) {

if(!$id) {
$this->Session->setFlash('Invalid id for Capitulo');
$this->redirect('/capitulos/index');
}

if($this->Capitulo->del($id)) {

$this->set('caps', $this->Capitulo->findAll(null, null, 
'order_id
ASC'));
$this->render('admin_ordenar', 'ajax');

}

}

>From what I'm guessing the sortable list uses a form which it submits,
now how do I submit this form in order to get it re-sorted on the
event that any chapter is deleted?

Thanks in advance


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to edit two tables in the same interface?

2007-02-13 Thread [EMAIL PROTECTED]

Hi Lynda,
If you cannot change the table structure then you may be out of luck.
Cake expects a single integer number for each key, so the questions
and re_questions fields can't be used for the automagic associations
in cake.  You're right that you can specify the primary key name in
the model, but that only solves half the problem.

Judging by your description you probably need a hasAndBelongsToMany
association which definitely requires another table such as
books_questions.


You might be able to produce an SQL query to do something like what
you want if you got the right JOIN syntax
http://dev.mysql.com/doc/refman/5.0/en/join.html
If you could do that, you could use the querys directly with cakes SQL
functions.

Matt


--~--~-~--~~~---~--~~
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 did cake get the id of saved data

2007-02-13 Thread nate

@Langdon: I don't believe so.  At the PHP/MySQL interface level, the
last insert ID is scoped to the current database connection, so as
long as you are saving/getting the ID synchronously (i.e. not doing
multiple saves in multiple places in the code) this should not be an
issue.

On Feb 13, 9:39 pm, Langdon Stevenson <[EMAIL PROTECTED]>
wrote:
> >> Before cake, whenever i save data into a row without specifying the
> >> id(auto incremental primary key). I cant get the id number back from
> >> mysql withouth doing a search. However, using cake's model->save, i
> >> get the model->id magically. Anyone actually knows how cake retrived
> >> the id key?
>
> > But you had the last_insert_id() mysql function for that purpose.
>
> Just out of interest, can anyone tell me how reliable this is?
>
> For instance, if you have a very busy server, could last_insert_id()
> ever return the wrong value?
>
> Regards,
> Langdon


--~--~-~--~~~---~--~~
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 did cake get the id of saved data

2007-02-13 Thread nate

When you call save() on $this->Post, the insert ID is automatically
set in $this->Post->id;

In Cake 1.2, this is handled internally at the database driver level,
and in Cake 1.1 in Model::getLastInsertId().  In both cases, the data
is ultimately fetched from the driver in DboMysql::lastInsertId().

On Feb 13, 9:32 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> On Feb 14, 11:40 am, "admin_AT_loveyourdress.com" <[EMAIL PROTECTED]>
> wrote:
>
> > Before cake, whenever i save data into a row without specifying the
> > id(auto incremental primary key). I cant get the id number back from
> > mysql withouth doing a search. However, using cake's model->save, i
> > get the model->id magically. Anyone actually knows how cake retrived
> > the id key?
>
> It doesn't as far as I know.  Here's an example from the manual where
> the id is retrieved after saving to save associated data
> This uses the $this->Post->getLastInsertId(); function.
>
> /app/controllers/posts_controller.php (partial)
> function add()
> {
> if (!empty($this->data))
> {
> //We can save the Post data:
> //it should be in $this->data['Post']
>
> $this->Post->save($this->data);
>
> //Now, we'll need to save the Comment data
> //But first, we need to know the ID for the
> //Post we just saved...
>
> $post_id = $this->Post->getLastInsertId();
>
> //Now we add this information to the save data
> //and save the comment.
>
> $this->data['Comment']['post_id'] = $post_id;
>
> //Because our Post hasMany Comments, we can access
> //the Comment model through the Post model:
>
> $this->Post->Comment->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: How to avoid duplicating afterFind() logic?

2007-02-13 Thread nate

function afterFind($results) {
   $tmp =& $results;
   if (isset($tmp[$this->name])) {
   $tmp =& $tmp[$this->name];
   }
   for ($i = 0; $i  < count($tmp); $i++) {
  $item =& $tmp[$i]
  if (isset($item[$this->name])) {
  $item =& $item[$this->name];
  }
  // Rest of logic goes here
   }
}

On Feb 13, 9:31 pm, "cdomigan" <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I have a question re Model::afterFind($results).
>
> If $results is from a "model" find it will be of structure $results[$i]
> [Model][Field], but if it is from an "association" find it will be of
> structure $results[$i][Model][$j][Field].
>
> I end up having to duplicate my afterFind logic for each of these
> eventualities. Is there a better way?
>
> Cheers,
>
> Chris


--~--~-~--~~~---~--~~
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: params['pass'] not functioning as listed in manual

2007-02-13 Thread nate

No, additional GET parameters are parsed into $this->params['url'].

On Feb 13, 8:56 pm, "Mark  Percival" <[EMAIL PROTECTED]> wrote:
> I'm pretty new to CakePHP, but what I'm reading in the manual isn't
> matching up to what's happening in my CakePHP install when it comes to
> the param['pass']
>
> Here's an example.
>
> URL: localhost/users/add/?var1=453&var2=test
> $this->param['pass'] = Array()
> Gives me an empty array.
>
> URL: localhost/users/add/453/test
> $this->param['pass'] = Array ( [0] => 453 [1] => test )
>
> According to the manual I should be getting back "var1=453&var2=test"
> as a string in the first example.
>
> Is there something I'm missing?
>
> Thanks,
> Mark


--~--~-~--~~~---~--~~
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: Multi step AJAX forms

2007-02-13 Thread [EMAIL PROTECTED]

OK.  Here's an idea.  In the example I quoted from the manual, the
view code is returned into the $userTable variable.
What you would do with it then is echo/print it into your view.

What variable is the code inside the  expecting
in your project/add.thtml?
If it included something like  It might work.

I'm not that flash with AJAX stuff though. ;-)
Matt

On Feb 14, 10:53 am, "jamieh" <[EMAIL PROTECTED]> wrote:
> OK, I have been playing with this.

> $this->set('tasks', 
> $this->requestAction('/tasks/index')); // the
> view I would like to grab belongs to the Tasks object/controller
> $this->render('tasks', 'ajax');



--~--~-~--~~~---~--~~
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 did cake get the id of saved data

2007-02-13 Thread Langdon Stevenson

>> Before cake, whenever i save data into a row without specifying the
>> id(auto incremental primary key). I cant get the id number back from
>> mysql withouth doing a search. However, using cake's model->save, i
>> get the model->id magically. Anyone actually knows how cake retrived
>> the id key?
> 
> But you had the last_insert_id() mysql function for that purpose.

Just out of interest, can anyone tell me how reliable this is?

For instance, if you have a very busy server, could last_insert_id() 
ever return the wrong value?

Regards,
Langdon

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



params['pass'] not functioning as listed in manual

2007-02-13 Thread Mark Percival

I'm pretty new to CakePHP, but what I'm reading in the manual isn't
matching up to what's happening in my CakePHP install when it comes to
the param['pass']

Here's an example.

URL: localhost/users/add/?var1=453&var2=test
$this->param['pass'] = Array()
Gives me an empty array.

URL: localhost/users/add/453/test
$this->param['pass'] = Array ( [0] => 453 [1] => test )

According to the manual I should be getting back "var1=453&var2=test"
as a string in the first example.

Is there something I'm missing?

Thanks,
Mark


--~--~-~--~~~---~--~~
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 avoid duplicating afterFind() logic?

2007-02-13 Thread cdomigan

Hello all,

I have a question re Model::afterFind($results).

If $results is from a "model" find it will be of structure $results[$i]
[Model][Field], but if it is from an "association" find it will be of
structure $results[$i][Model][$j][Field].

I end up having to duplicate my afterFind logic for each of these
eventualities. Is there a better way?

Cheers,

Chris


--~--~-~--~~~---~--~~
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 did cake get the id of saved data

2007-02-13 Thread [EMAIL PROTECTED]

On Feb 14, 11:40 am, "admin_AT_loveyourdress.com" <[EMAIL PROTECTED]>
wrote:
> Before cake, whenever i save data into a row without specifying the
> id(auto incremental primary key). I cant get the id number back from
> mysql withouth doing a search. However, using cake's model->save, i
> get the model->id magically. Anyone actually knows how cake retrived
> the id key?

It doesn't as far as I know.  Here's an example from the manual where
the id is retrieved after saving to save associated data
This uses the $this->Post->getLastInsertId(); function.


/app/controllers/posts_controller.php (partial)
function add()
{
if (!empty($this->data))
{
//We can save the Post data:
//it should be in $this->data['Post']

$this->Post->save($this->data);

//Now, we'll need to save the Comment data
//But first, we need to know the ID for the
//Post we just saved...

$post_id = $this->Post->getLastInsertId();

//Now we add this information to the save data
//and save the comment.

$this->data['Comment']['post_id'] = $post_id;

//Because our Post hasMany Comments, we can access
//the Comment model through the Post model:

$this->Post->Comment->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: How did cake get the id of saved data

2007-02-13 Thread bernardo

On Feb 13, 9:40 pm, "admin_AT_loveyourdress.com" <[EMAIL PROTECTED]>
wrote:
> Before cake, whenever i save data into a row without specifying the
> id(auto incremental primary key). I cant get the id number back from
> mysql withouth doing a search. However, using cake's model->save, i
> get the model->id magically. Anyone actually knows how cake retrived
> the id key?

But you had the last_insert_id() mysql function for that purpose.


--~--~-~--~~~---~--~~
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: Multi step AJAX forms

2007-02-13 Thread jamieh

OK, I have been playing with this.

My projects controller is this:
##

params['data']))
{
if ($this->Project->save($this->params['data']))
{
$this->set('tasks', 
$this->requestAction('/tasks/index')); // the
view I would like to grab belongs to the Tasks object/controller
$this->render('tasks', 'ajax');
}
else
{
// do nothing
}
}
}

}
?>

But i get the following error:
##

You are seeing this error because the view for
ProjectsController::tasks() could not be found.

Cake is looking for a view of the current object which is Projects.

Any ideas?

On Feb 13, 11:08 pm, "Dat Chu" <[EMAIL PROTECTED]> wrote:
> Renderring a view of a different Controller is the same as rendering a
> view of the same controller. (Using AJAX helper).
>
> [EMAIL PROTECTED], my first thought when I see your approach is: it violates 
> MVC.
> However, upon further look I think it actually make sense since there
> is no use in duplicating view code, UsersController does what it knows
> best: controlling users. Thus, forcing MVC => retrieving user list
> from User model then display it is actually violating encapsulation in
> OOP.
>
> On Feb 13, 4:48 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > I see.  I wonder if requestAction could help you there?
> > The cake manual page seems to infer that it might do what you want.
>
> > Here's an excerpt fromhttp://manual.cakephp.org/chapter/controllers
>
> > If you have an often used element in your application that is not
> > static, you might want to use requestAction() to inject it into your
> > views. Let's say that rather than just passing the data from
> > UsersController::getUserList, we actually wanted to render that
> > action's view (which might consist of a table), inside another
> > controller. This saves us from duplicating view code.
> > class ProgramsController extends AppController
> > {
> > function viewAll()
> > {
> > $this->set('userTable', $this->requestAction('/users/
> > getUserList', array('return')));
>
> > // Now, we can echo out $userTable in this action's view to
> > // see the rendered view that is also available at /users/
> > getUserList.
> > }
>
> > }
>
> > Please note that actions called using requestAction() are rendered
> > using an empty layout - this way you don't have to worry about layouts
> > getting rendered inside of layouts.


--~--~-~--~~~---~--~~
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 did cake get the id of saved data

2007-02-13 Thread admin_AT_loveyourdress.com

Before cake, whenever i save data into a row without specifying the
id(auto incremental primary key). I cant get the id number back from
mysql withouth doing a search. However, using cake's model->save, i
get the model->id magically. Anyone actually knows how cake retrived
the id key?


--~--~-~--~~~---~--~~
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: Regular Expression to find content inside a tag pair

2007-02-13 Thread Dat Chu
There are several things with anuke's pattern:

First, it will not catch forms with attributes (=> my bad for not specifying
this)
Second, since * is greedy if I have 2 forms, it will capture the content
between the wrong pairs of tags.
Example of this: AAABBBCCC

anuke's pattern will match the whole thing instead of just the first pair.

On 2/13/07, anuke <[EMAIL PROTECTED]> wrote:
>
>
> $pattern = '/(.*)<\/form>/';
>
> On 14 фев, 02:02, "Dat Chu" <[EMAIL PROTECTED]> wrote:
> > I want to find the content inside of a tag pair.
> >
> > Say form tag. What would be the way to achieve this?
> >
> > My solution so far is using a regular expression similar to this
> >
> > /]*>(.*?)/
>
>
> >
>

--~--~-~--~~~---~--~~
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 edit two tables in the same interface?

2007-02-13 Thread lynda

Thank you for your reply! Table req_questions is a table to define
questions, and table books just has the fields questions and
req_questions to list question_ids in these two fields. Table books
has other fields like category, articles, sections and segments, I
didn't include them because I just want to edit questions and
req_question fields, and delete question_ids in these 2 fields when I
delete question_id in table questions. I am not allowed to change
table. At first I was using $hasMany in model Question. For example,
var $hasMany = array('Book' =>'Book');
it gave me empty array because it requires these two tables associated
by a foreign key, question_id is not a foreign key in table books.
Below are my table look like:
books
book_id  questionsreq_questions  title
1   11, 23, 33 23, 33This is a
book
2   18, 23, 39 23This is
another book

questions
question_id   question_title  question_data
11question 11this is a question
18question 18 this is another questions
23question 23 this is another questions
33question 33   another questions

If I set var primaryKey ='question_id' in Model Question, I think cake
will recognize $question_id is $id.
I am not allowed to change the table structures, I am hoping someone
can help me to find a way to connect fields questions and
req_questions to question_id.

Thanks!
Lynda

On Feb 13, 2:42 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi Lynda,
>
> I think the association you need is a hasMany since book can have many
> questions.  I assume a question is specific to a book, so the question
> model would have a belongsTo association with book.
>
> However you have two there pointing to the same table so it's a bit
> tricky.  What is the purpose of the questions and req_questions?
> Maybe there's another way to achieve the same result?  Can you simply
> put a value (1 or 0) in the questions table to denote whether it's a
> normal quesiton or req_question?
>
> Also as an aside, the primary key for "books" and "questions" should
> be "id" in both cases not "book_id" and "question_id"
> It took me a while to understand this as well. :-) Cake expects the
> primary key of every table to be "id" and you can then refer to it
> from other tables as "modelname_id"
>
> e.g.
> You could have a table "notes" to add notes about each book.
> This table would have a field "book_id" which cake automatically links
> to the "id" field in "books" if you setup a belongsTo association in
> the "notes" model and a hasMany association in the "books" model.


--~--~-~--~~~---~--~~
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 do I stop the return of unwanted associated data?

2007-02-13 Thread Christopher E. Franklin, Sr.

Ok, using recursive helped a lot but, I can also see where expect()
would be very handy!

Thanks a ton for all of your help!  It is very appreciated!

> Chris


--~--~-~--~~~---~--~~
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: Regular Expression to find content inside a tag pair

2007-02-13 Thread anuke

$pattern = '/(.*)<\/form>/';

On 14 фев, 02:02, "Dat Chu" <[EMAIL PROTECTED]> wrote:
> I want to find the content inside of a tag pair.
>
> Say form tag. What would be the way to achieve this?
>
> My solution so far is using a regular expression similar to this
>
> /]*>(.*?)/


--~--~-~--~~~---~--~~
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: Multi step AJAX forms

2007-02-13 Thread Dat Chu

Renderring a view of a different Controller is the same as rendering a
view of the same controller. (Using AJAX helper).

[EMAIL PROTECTED], my first thought when I see your approach is: it violates 
MVC.
However, upon further look I think it actually make sense since there
is no use in duplicating view code, UsersController does what it knows
best: controlling users. Thus, forcing MVC => retrieving user list
from User model then display it is actually violating encapsulation in
OOP.

On Feb 13, 4:48 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I see.  I wonder if requestAction could help you there?
> The cake manual page seems to infer that it might do what you want.
>
> Here's an excerpt fromhttp://manual.cakephp.org/chapter/controllers
>
> If you have an often used element in your application that is not
> static, you might want to use requestAction() to inject it into your
> views. Let's say that rather than just passing the data from
> UsersController::getUserList, we actually wanted to render that
> action's view (which might consist of a table), inside another
> controller. This saves us from duplicating view code.
> class ProgramsController extends AppController
> {
> function viewAll()
> {
> $this->set('userTable', $this->requestAction('/users/
> getUserList', array('return')));
>
> // Now, we can echo out $userTable in this action's view to
> // see the rendered view that is also available at /users/
> getUserList.
> }
>
> }
>
> Please note that actions called using requestAction() are rendered
> using an empty layout - this way you don't have to worry about layouts
> getting rendered inside of layouts.


--~--~-~--~~~---~--~~
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: loadModel( ) vs $uses

2007-02-13 Thread Grant Cox

Yes, that is correct.

On Feb 14, 1:12 am, "redhex" <[EMAIL PROTECTED]> wrote:
> Hi all, I am looking at reducing the size of my controller.
>
> Can I say that with loadModel, I can limit my $users array to the
> minimum? And for those methods that requires those less frequently
> uses model to load upon the different function request?


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



Regular Expression to find content inside a tag pair

2007-02-13 Thread Dat Chu

I want to find the content inside of a tag pair.

Say form tag. What would be the way to achieve this?

My solution so far is using a regular expression similar to this

/]*>(.*?)/


--~--~-~--~~~---~--~~
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: Multi step AJAX forms

2007-02-13 Thread [EMAIL PROTECTED]

I see.  I wonder if requestAction could help you there?
The cake manual page seems to infer that it might do what you want.

Here's an excerpt from http://manual.cakephp.org/chapter/controllers

If you have an often used element in your application that is not
static, you might want to use requestAction() to inject it into your
views. Let's say that rather than just passing the data from
UsersController::getUserList, we actually wanted to render that
action's view (which might consist of a table), inside another
controller. This saves us from duplicating view code.
class ProgramsController extends AppController
{
function viewAll()
{
$this->set('userTable', $this->requestAction('/users/
getUserList', array('return')));

// Now, we can echo out $userTable in this action's view to
// see the rendered view that is also available at /users/
getUserList.
}
}

Please note that actions called using requestAction() are rendered
using an empty layout - this way you don't have to worry about layouts
getting rendered inside of layouts.


--~--~-~--~~~---~--~~
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 edit two tables in the same interface?

2007-02-13 Thread [EMAIL PROTECTED]

Hi Lynda,

I think the association you need is a hasMany since book can have many
questions.  I assume a question is specific to a book, so the question
model would have a belongsTo association with book.

However you have two there pointing to the same table so it's a bit
tricky.  What is the purpose of the questions and req_questions?
Maybe there's another way to achieve the same result?  Can you simply
put a value (1 or 0) in the questions table to denote whether it's a
normal quesiton or req_question?


Also as an aside, the primary key for "books" and "questions" should
be "id" in both cases not "book_id" and "question_id"
It took me a while to understand this as well. :-) Cake expects the
primary key of every table to be "id" and you can then refer to it
from other tables as "modelname_id"

e.g.
You could have a table "notes" to add notes about each book.
This table would have a field "book_id" which cake automatically links
to the "id" field in "books" if you setup a belongsTo association in
the "notes" model and a hasMany association in the "books" model.


--~--~-~--~~~---~--~~
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: Multi step AJAX forms

2007-02-13 Thread jamieh

Thanks for the reply [EMAIL PROTECTED]

I had actually based my logic on that tutorial.  In the tutorial they
are rendering a view of the same object; the ToDo view.

What I was trying to do was a render a view of another object.

Does this require a different approach?

Thanks,
jamieh...


--~--~-~--~~~---~--~~
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: Associations stored in a table?!

2007-02-13 Thread [EMAIL PROTECTED]

I don't know enough about your data, but I would have thought it would
be easier to just use multiple tables.
e.g. One table for the node information, than a bunch of tables for
various datasets.  You can then bind and unbind the ones you need 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: Newbie Question: Using session information in the model

2007-02-13 Thread [EMAIL PROTECTED]

I'd also be interested in an answer to this.
At the moment I'm using the equivalent of this

$user = $this->Session->read('User');
$user_id = $User['id'];

And then setting the conditions in the findById as "User.id = ".
$user_id in every controller function I have.
I'm sure theres a better way.



--~--~-~--~~~---~--~~
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: Wrapping Cake in a Joomla component, like Cake + Drupal = Drake

2007-02-13 Thread Max

Just posted it: http://www.gigapromoters.com/blog/

On Feb 9, 8:34 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On 2/9/07, Max <[EMAIL PROTECTED]> wrote:
>
>
>
> > I have successfully done this. Will post soon on my blog...
>
> Hurray!! Do post a link when you post to your blog
>
> Cheers
> Tarique
>
> --
> =
> PHP for E-Biz:http://sanisoft.com
> Cheesecake-Photoblog:http://cheesecake-photoblog.org
> =


--~--~-~--~~~---~--~~
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: change debug level inside some of the controllers

2007-02-13 Thread admin_AT_loveyourdress.com

found the answer

function beforeFilter( ) {
$db =& ConnectionManager::getDataSource('default');
$db->fullDebug = false;
}



On Feb 13, 3:11 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I am making a SOAP controller and setting the debug level in core.php
> to 2. It is causing all my soal and wsdl stuff to not parsing since
> the database queries were dumped after my xml/wsdl stuff. I hate to
> keep going back and firth toi change my debug level between 1 and 2.
>
> Is there anyway i can stop the sql dump inside my webservice
> controller? e.g.
>
> class MyServiceController extends WebServicesController {
>
>   function __construct() {
>
>imaginary_function_stop_dumping_sql_queries_temporarry(true);
>
>   }
>
>   function __destructor() {
>
>imaginary_function_stop_dumping_sql_queries_temporarry(false);
>
>   }
>
> }


--~--~-~--~~~---~--~~
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 edit two tables in the same interface?

2007-02-13 Thread lynda

I have 2 tables:1. table books with fields: book_id(primary key, int,
auto increment), book_title, questions (type: text),
req_questions(type: text). 2. table questions with fields:
question_id(primary key, int, auto increment), question_title,
question_data and so on. The fields of questions and req_questions in
the table books are string of questions_id, for example, question
field has value 19, 20, 23, Here 19, 20 and 23 are question_ids.
similarly, field req_question has value "23, 20",  23 and 20 are
question_ids. I need to build an interface to be able to add, delete
and edit questions, edit fields questions and req_question. When I
delet a questionf from table question, it auto delete it from fields
questions and req_questions from table book. How could I do these? I
read hasMany relationship, it seems very difficult to put these two
table together since they have this abnormal relationship. Thank you
for your help.
Best Regards
Lynda


--~--~-~--~~~---~--~~
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: Multi step AJAX forms

2007-02-13 Thread [EMAIL PROTECTED]

Hello,
I found this tutorial to be pretty good.

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




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



change debug level inside some of the controllers

2007-02-13 Thread [EMAIL PROTECTED]

I am making a SOAP controller and setting the debug level in core.php
to 2. It is causing all my soal and wsdl stuff to not parsing since
the database queries were dumped after my xml/wsdl stuff. I hate to
keep going back and firth toi change my debug level between 1 and 2.

Is there anyway i can stop the sql dump inside my webservice
controller? e.g.

class MyServiceController extends WebServicesController {

  function __construct() {

   imaginary_function_stop_dumping_sql_queries_temporarry(true);


  }

  function __destructor() {

   imaginary_function_stop_dumping_sql_queries_temporarry(false);


  }


}


--~--~-~--~~~---~--~~
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 Question: Using session information in the model

2007-02-13 Thread savagekabbage

Hello everyone, I'm trying to get the hang of Cake, but it's rather
difficult due to the sparse documentation out there.

I have this code in my model:

var $belongsTo = array('User' =>
array('className'=> 'User',
  'conditions'   => 'User.id = ???',
  'order'=> '',
  'dependent'=>  true,
  'foreignKey'   => 'users_id'
),'Activity' =>
 array('className' => 'Activity',
   'conditions'=> '',
   'order' => '',
   'limit' => '',
   'foreignKey'=> 'id',
   'dependent' => true,
   'exclusive' => false,
   'finderQuery'   => ''
 )
  );

Where it says "User.id = ???", it should be pulling the user id from
the session variable.  It's stored in $_SESSION['User']['id'].  I
can't seem to be able to get this to work, if you could please post
the proper syntax of this statement I would appreciate it a lot.

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



Multi step AJAX forms

2007-02-13 Thread jamieh

Hi,

I am reasonably new to CakePHP and have been trying to figure out how
to create a multi step AJAX form.

I have a model called "users" and a model called "projects".

>From /users/add/ i would like to update the div containing the "add
user" form with that of /projects/add/.

I have tried this but Cake tells me it cant find the controller for
projects.

Can anyone point me to a tutorial that covers this type of
functionality?

I am currently using:

$this->render('projects/add', 'ajax');

Any help and pointers very much welcome.

Thanks,
Jamieh


--~--~-~--~~~---~--~~
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 with a $hasMany, $belongsTo association...

2007-02-13 Thread alexxwiz

I'm glad for you, but my problem is still here :(
Can someone point me where is my mistake?

On 13 фев, 18:00, "shoesole" <[EMAIL PROTECTED]> wrote:
> Wow. I knew it had to be something easy that I was completely
> overlooking. Thank you so much Eric. I read the manual chapter on
> models multiple times, but I guess that part just didn't sink in
> (maybe next time I should read more carefully). Anyway, Thanks. This
> is my first shot at Cake and I love it so far, but that really had me
> confounded.


--~--~-~--~~~---~--~~
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: beforeSave problem (1.2)

2007-02-13 Thread Mariano Iglesias

Well, today is Tuesday the 13th. Down here, in Argentina, and I think the
rest of Latin America, Tuesdays the 13th is considered to be a day of bad
luck (Americans believe it's Friday the 13th.)

I agree with you woods, let's keep trying to help other bakers. As long as
there's a community behind Cake, then Cake is worth it. Like Larry once
said, Cake is not (and shouldn't be) a one man show. So let's keep it that
way.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de the_woodsman
Enviado el: Martes, 13 de Febrero de 2007 01:56 p.m.
Para: Cake PHP
Asunto: Re: beforeSave problem (1.2)

Indeed Mariano,

If everyone on this board waited until they knew cake back to front
and upside down before posting, no one would post - and in lieu of
more documentation, this board is what keeps Cake alive and growing.


--~--~-~--~~~---~--~~
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: beforeSave problem (1.2)

2007-02-13 Thread Mariano Iglesias

Oh well... Let's just drop it here. This is pointless.

To Amon, whom I wrote originally: sorry for the confusion. So you know, I
had in mind the validates() method when I told you to avoid sending $data.

As it happens, I was on vacations when I read on a post that Larry pointed
out that sending $data to validates() was deprecated, and throughout my
vacations I was remembering myself: need to check the code to avoid doing
that. 

On the trip back, my internal hard drive (that thing others call memory) got
mixed up and replaced the word validates() with save(). That's all there was
to it.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de nate
Enviado el: Martes, 13 de Febrero de 2007 02:17 p.m.
Para: Cake PHP
Asunto: Re: beforeSave problem (1.2)

Perhaps I expected too much of Mariano.


--~--~-~--~~~---~--~~
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: beforeSave problem (1.2)

2007-02-13 Thread nate

Perhaps I came down a little hard, and not that you don't make a good
point, but the facts are that (a) we *have* been having a problem with
this issue lately, and (b) it's always a fine balance, as we saw with
the wiki; that's why we have the Bakery now, so we can ensure the
quality and accuracy of the information we're making available.  No
one wants to turn this into a situation where we're controlling all
information about the project (least of all us, because it's too much
work and we don't have the resources), but at the same time, confused
do we allow newcomers to the project to get before doing something
about it?  I try to stay active on the mailing list, but I can't do
everything myself.

Perhaps I expected too much of Mariano.

On Feb 13, 11:55 am, "the_woodsman" <[EMAIL PROTECTED]> wrote:
> Indeed Mariano,
>
> If everyone on this board waited until they knew cake back to front
> and upside down before posting, no one would post - and in lieu of
> more documentation, this board is what keeps Cake alive and growing.
>
> If there was more/any documentation for Cake 1.2, then these kinds of
> errors would be very unlikely.
>
> Whenever anyone brings up documentation, Cake devs mention that we're
> all free to contribute, and in fact they encourage it, although anyone
> reading Nate's reaction to someone just trying to help a fellow baker
> would clearly be discouraged from helping the documentation effort - I
> know I am. What if I get something wrong!?
> In fact, isn't this exactly what happened with the wiki? Users tried
> to contribute to the documentation, and it was stopped becuase of
> innacuracies/errors.
>
> Mariano, I'd rather you kept trying and got it wrong occasionally than
> stopped!
>
> And Nate, no offence meant - your posts on this board are absolutely
> vital.
>
> On Feb 13, 4:06 pm, "Mariano Iglesias" <[EMAIL PROTECTED]>
> wrote:
>
> > Wow. Got the message.
>
> > I didn't recommend formatting the computer and then seeing what happens. I
> > just got the validates() $data thingy confused with the save(). For the
> > record, nothing gets me more upset that lack of patience.
>
> > -MI
>
> > ---
>
> > Remember, smart coders answer ten questions for every question they ask.
> > So be smart, be cool, and share your knowledge.
>
> > BAKE ON!
>
> > blog:http://www.MarianoIglesias.com.ar
>
> > -Mensaje original-
> > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
> > de nate
> > Enviado el: Martes, 13 de Febrero de 2007 12:16 p.m.
> > Para: Cake PHP
> > Asunto: Re: beforeSave problem (1.2)
>
> > No, bad, wrong, incorrect. categorically false.  Parameter usage has
> > been deprecated for Model::validates() and Model::invalidFields().  If
> > there is something you are or aren't supposed to do, either PhpNut or
> > myself will say so either in the form of documentation, or a friendly
> > warning in the code.
>
> > Also, for the record, nothing gets me more upset than people spreading
> > misinformation.  If you want to help people out, great, just make very
> > *very* sure that you actually know what you're talking about.


--~--~-~--~~~---~--~~
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: beforeSave problem (1.2)

2007-02-13 Thread Mariano Iglesias

I understand how misinformation affects a lot of people, not just the one
you told.

Throughout this past few months I think I've shown that I do not only
respect the work you do, but also try to evangelize on others to do as well.
I've been collaborating on any aspect I can and I intend to do so in the
future.

So if every now and then I get something wrong, there's no need to snap.

There are ways and ways of saying things. I can understand getting upset
when someone has a demanding attitude, but I don't believe that's my case.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de nate
Enviado el: Martes, 13 de Febrero de 2007 01:52 p.m.
Para: Cake PHP
Asunto: Re: beforeSave problem (1.2)

The problem with misinformation is that it's like playing telephone.
You don't just negatively impact the person you told.  You also impact
the people he tells, and so on and so forth.  Before you know it, mass
confusion.  Granted, the fact that the documentation effort has not
been keeping pace with development doesn't help, but giving people bad
information, however unintentional, only serves to aggravate the
situation, and lately we've been dealing with altogether too much
aggravation and bad information.


--~--~-~--~~~---~--~~
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: Fetching Posts without Comments

2007-02-13 Thread Eric C Blount
http://groups.google.com/group/cake-php/browse_frm/thread/67e19e17185f7fef/4eaaf5c69630ee9d?lnk=gst&q=join+type&rnum=2&hl=en#4eaaf5c69630ee9d

So there will be an association key 'type' where you can do the left join.
That post makes it sound like it's not implemented yet.

For now, you could throw that query into $this->Posts->query();

Eric


On 2/13/07, Alexander Wegener <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> and how to to this the object oriented way (with fetchAll()) ??
>
>
>
> many thanks!
>
> Alex
>
>
>
>
>
> On Tue, 13 Feb 2007 14:59:24 +0100, Kaste <[EMAIL PROTECTED]> wrote:
>
> >
>
> >> select posts.id, comments.id, count(comments.id) as commentscount from
>
> >> posts, comments where comments.posts_id = posts.id where commentscount
> =
>
> >> 0
>
> >> group by posts.id;
>
> >>
>
> >
>
> > select p.* from posts p left join comments c on c.post_id=p.id where
> c.id
>
> > is null;
>
> >
>
> >
>
> >> Right?
>
> >
>
> >
>
> >
>

--~--~-~--~~~---~--~~
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: beforeSave problem (1.2)

2007-02-13 Thread the_woodsman

Indeed Mariano,

If everyone on this board waited until they knew cake back to front
and upside down before posting, no one would post - and in lieu of
more documentation, this board is what keeps Cake alive and growing.

If there was more/any documentation for Cake 1.2, then these kinds of
errors would be very unlikely.

Whenever anyone brings up documentation, Cake devs mention that we're
all free to contribute, and in fact they encourage it, although anyone
reading Nate's reaction to someone just trying to help a fellow baker
would clearly be discouraged from helping the documentation effort - I
know I am. What if I get something wrong!?
In fact, isn't this exactly what happened with the wiki? Users tried
to contribute to the documentation, and it was stopped becuase of
innacuracies/errors.

Mariano, I'd rather you kept trying and got it wrong occasionally than
stopped!

And Nate, no offence meant - your posts on this board are absolutely
vital.



On Feb 13, 4:06 pm, "Mariano Iglesias" <[EMAIL PROTECTED]>
wrote:
> Wow. Got the message.
>
> I didn't recommend formatting the computer and then seeing what happens. I
> just got the validates() $data thingy confused with the save(). For the
> record, nothing gets me more upset that lack of patience.
>
> -MI
>
> ---
>
> Remember, smart coders answer ten questions for every question they ask.
> So be smart, be cool, and share your knowledge.
>
> BAKE ON!
>
> blog:http://www.MarianoIglesias.com.ar
>
> -Mensaje original-
> De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
> de nate
> Enviado el: Martes, 13 de Febrero de 2007 12:16 p.m.
> Para: Cake PHP
> Asunto: Re: beforeSave problem (1.2)
>
> No, bad, wrong, incorrect. categorically false.  Parameter usage has
> been deprecated for Model::validates() and Model::invalidFields().  If
> there is something you are or aren't supposed to do, either PhpNut or
> myself will say so either in the form of documentation, or a friendly
> warning in the code.
>
> Also, for the record, nothing gets me more upset than people spreading
> misinformation.  If you want to help people out, great, just make very
> *very* sure that you actually know what you're talking about.


--~--~-~--~~~---~--~~
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: php 5.2.1

2007-02-13 Thread Mariano Iglesias

The best and easiest thing you can do is to remove the open_basedir
restriction. I had to do it on one of my servers running 5.2 (at godaddy).

It is not that the path is incorrect, it is just that is not within reach of
the allowed included paths.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de lukemack
Enviado el: Martes, 13 de Febrero de 2007 01:44 p.m.
Para: Cake PHP
Asunto: Re: php 5.2.1

in fact /usr/share/php/cake/libs/controller/ is not even a valid path.
maybe basics.php needs updating for 5.2.1?


--~--~-~--~~~---~--~~
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: What editor do you use for CakePHP?

2007-02-13 Thread [EMAIL PROTECTED]

On Feb 13, 4:00 pm, "fr3nch13" <[EMAIL PROTECTED]> wrote:
> I use dreamweaver 8 with their site settings for editing, etc. I'm
> stuck on windows cuz i have to test in IE too. blah!
>
> BTW, great resource:http://tredosoft.com/Multiple_IE

you can run IE on linux too, with ies4linux this is actually very very
easy.  and it gives you versions 5,5.5 and 6


--~--~-~--~~~---~--~~
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: beforeSave problem (1.2)

2007-02-13 Thread nate

The problem with misinformation is that it's like playing telephone.
You don't just negatively impact the person you told.  You also impact
the people he tells, and so on and so forth.  Before you know it, mass
confusion.  Granted, the fact that the documentation effort has not
been keeping pace with development doesn't help, but giving people bad
information, however unintentional, only serves to aggravate the
situation, and lately we've been dealing with altogether too much
aggravation and bad information.

On Feb 13, 11:06 am, "Mariano Iglesias" <[EMAIL PROTECTED]>
wrote:
> Wow. Got the message.
>
> I didn't recommend formatting the computer and then seeing what happens. I
> just got the validates() $data thingy confused with the save(). For the
> record, nothing gets me more upset that lack of patience.
>
> -MI
>
> ---
>
> Remember, smart coders answer ten questions for every question they ask.
> So be smart, be cool, and share your knowledge.
>
> BAKE ON!
>
> blog:http://www.MarianoIglesias.com.ar
>
> -Mensaje original-
> De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
> de nate
> Enviado el: Martes, 13 de Febrero de 2007 12:16 p.m.
> Para: Cake PHP
> Asunto: Re: beforeSave problem (1.2)
>
> No, bad, wrong, incorrect. categorically false.  Parameter usage has
> been deprecated for Model::validates() and Model::invalidFields().  If
> there is something you are or aren't supposed to do, either PhpNut or
> myself will say so either in the form of documentation, or a friendly
> warning in the code.
>
> Also, for the record, nothing gets me more upset than people spreading
> misinformation.  If you want to help people out, great, just make very
> *very* sure that you actually know what you're talking about.


--~--~-~--~~~---~--~~
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: php 5.2.1

2007-02-13 Thread lukemack

in fact /usr/share/php/cake/libs/controller/ is not even a valid path.
maybe basics.php needs updating for 5.2.1?

On 13 Feb, 16:27, "lukemack" <[EMAIL PROTECTED]> wrote:
> hi,
>
> since upgrading to php 5.2.1, i've been getting open_basedir errors in
> cake e.g:
>
> Warning: file_exists() [function.file-exists]: open_basedir
> restriction in effect. File(/usr/share/php/cake/libs/controller/
> pages_controller.php) is not within the allowed path(s): (/home/httpd/
> vhosts/xx/subdomains/cake/httpdocs:/tmp:/usr/share/pear) in /home/
> httpd/vhosts/xx/subdomains/cake/httpdocs/cake/basics.php on line
> 1010
>
> i was previously on 5.1.6 and was not getting these errors, though
> open_basedir was in effect and safe-mode was on.
>
> has anyone had similar problems with php 5.2.1?
>
> thanks,
>
> lukemack.


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



php 5.2.1

2007-02-13 Thread lukemack

hi,

since upgrading to php 5.2.1, i've been getting open_basedir errors in
cake e.g:

Warning: file_exists() [function.file-exists]: open_basedir
restriction in effect. File(/usr/share/php/cake/libs/controller/
pages_controller.php) is not within the allowed path(s): (/home/httpd/
vhosts/xx/subdomains/cake/httpdocs:/tmp:/usr/share/pear) in /home/
httpd/vhosts/xx/subdomains/cake/httpdocs/cake/basics.php on line
1010

i was previously on 5.1.6 and was not getting these errors, though
open_basedir was in effect and safe-mode was on.

has anyone had similar problems with php 5.2.1?

thanks,

lukemack.


--~--~-~--~~~---~--~~
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: Sending emails

2007-02-13 Thread jinhr

My codes works for HTML, on cake_1.2.0.4451alpha

//File controllers/requests.php

class RequestsController extends AppController
{
var $name = "Requests";
var $uses = array(...);
var $components = array('Email');

function submit($id)
{
//save request into database.
//then send email alert to manager
$this->Email->to = $this->data['AuthorizingManager']['mail'];
$this->Email->from = $this->data['Requestor']['fullname'] . " <".
$this->data['Requestor']['mail'].">";
$this->Email->replyTo = $this->data['Requestor']['mail'];
$this->Email->charset = 'utf-8';
$this->Email->sendAs = "html";
$this->Email->template = "newRequestSubmit";
$this->Email->subject = "New Request #".$this->data['Request']['id'].
"comes!";
$emailResult = $this->Email->send();

$this->set('request',$this->data);

$this->flash('Request (#'.$id.') is created! Email Alert ='.
$emailResult, '/requests/view/'.$id);
}
}

/
//File views/layouts/email/html/default.ctp
/






This test email comes from DCCC

This E-mail is auto-generated by DCCC




//File views/elements/email/html/newRequestSubmit.ctp

Hello, a new request submitted! 


URL
http://server/requests/view/">http://server/requests/view/


Request #


..



--~--~-~--~~~---~--~~
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: Sending emails

2007-02-13 Thread jinhr

Hi, Andrzej:
My codes work OK for "html", for "text", but NOT for "both". I think
EmailCompotent still has problem (email.php version 4410 under
cake_1.2.0.4451alpha). Here are codes for the  three files:

///
//File controllers/requests.php
//
class RequestsController extends AppController
{
var $name = "Requests";
var $uses = array(...);
var $components = array('Email');

function submit($id)
{
//save request into database.
//then send email alert to manager
$this->Email->to = $this->data['AuthorizingManager']['mail'];
$this->Email->from = $this->data['Requestor']['fullname'] . "
<".
$this->data['Requestor']['mail'].">";
$this->Email->replyTo = $this->data['Requestor']['mail'];
$this->Email->charset = 'utf-8';
$this->Email->sendAs = "html";
$this->Email->template = "newRequestSubmit";
$this->Email->subject = "New Request #".$this->data['Request']
['id'].
"comes!";
$emailResult = $this->Email->send();

$this->set('request',$this->data);

$this->flash('Request (#'.$id.') is created! Email Alert ='.
$emailResult, '/requests/view/'.$id);
}

}

//
//File views/layouts/email/html/default.ctp
//






This test email comes from DCCC

This E-mail is auto-generated by DCCC



///
//File views/elements/email/html/newRequestSubmit.ctp

Hello, a new request submitted! 


URL
http://server/requests/view/">http://server/requests/view/


Request #


..



--~--~-~--~~~---~--~~
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: What editor do you use for CakePHP?

2007-02-13 Thread Darian Anthony Patrick

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Wow, Mylar seems really nice.

I really like Eclipse for Java development.

Mylar and PDT with xdebug support
(http://sb2.info/better-solutions/tools/xdebug-support-for-eclipse-php-ide/),
 are compelling reasons to re-evaluate baking in Eclipse.

Having one IDE for all of my coding would be lovely.  And a free one at
that!

jinhr wrote:
> I use: Eclipse as environment + PDT (http://www.eclipse.org/php/) as
> PHP editor + Subclipse for version control + Mylar & Trac for task
> management.
> 
> The best things for such solution is 1) It is totally free 2) It runs
> on linux or windows. 3)source code version is under control from ONE
> repository.
> 
> 
> > 

- --
Darian Anthony Patrick
Principal, Application Development
Criticode LLC
(215) 240-6566 Office
(866) 789-2992 Facsimile
Web:   http://criticode.com
Email: [EMAIL PROTECTED]
JID:   [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF0eUWKpzEXPWA4IcRAleXAJ44eHK8Fq1Kb7f5T9e0LK/I0pbFiACcCImN
ZHGBE2OQhEz+/TBzH4oqyVI=
=syja
-END PGP SIGNATURE-

--~--~-~--~~~---~--~~
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: What editor do you use for CakePHP?

2007-02-13 Thread Jason Huebel

As a followup, be sure you also get InTypePM, which is a project manager
wrapper around InType. InTypePM is a user-contributed app written in
Delphi. You can find it in this thread:

http://intype.info/forums/discussion/256/1/intype-project-manager-alpha/

The latest version is 1.0.0.35, which can be found on the second page of
the thread.

Jason Huebel wrote:
> For those poor souls who can't use TextMate because you're on Windows,
> you might want to take a look at InType (http://intype.info/). It's
> still in alpha (and will eventually be commercial software), but it
> includes a CakePHP "bundle". Bundles are plugins that include code
> snippets and keyboard shortcuts for a particular language.
> 
> It's a very lightweight and extremely clean (almost to a fault)
> interface. Hope you like it.
> 
> Jason Huebel
> 
> [EMAIL PROTECTED] wrote:
>> G'day all,
>>
>> Matt from Australia here.  In the past I've done all my PHP coding
>> using a text editor such as Wordpad, and then a few years back I've
>> begun using Dreamweaver.
>>
>> Currently I'm using Dreamweaver 8 and I've found it to be quite good
>> when dealing with .php files.  It's not great when editing .thtml
>> files though, since it doesn't recognize them as code, and so doesn't
>> give you all the nice code colouring and auto-closing of tags, etc...
>> At least the automated uploading/downloading is nice.
>>
>> What do you use for Cake cooking?
>>
>>
> 
> > 
> 

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

2007-02-13 Thread fr3nch13

the only one i know of is OceanCMS and it's still in alpha:

http://cakeforge.org/projects/ocean-cms/

On Feb 13, 10:11 am, "rhet" <[EMAIL PROTECTED]> wrote:
> Does anyone know of any good CMS for cake? I would like the
> application to be a plugin.


--~--~-~--~~~---~--~~
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: Probably really dumb question

2007-02-13 Thread Mariano Iglesias

Go to app/config/routes.php and change this line:

Router::connect('/', array('controller' => 'pages', 'action' => 'display',
'home'));

To your selected controller. For example if you want the home page to run on
your Homes controller, and action index, do:

Router::connect('/', array('controller' => 'homes', 'action' => 'index'));

PS: It is recommended (though not mandatory) that controllers are named in
their plural form.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Dominik Schwind
Enviado el: Martes, 13 de Febrero de 2007 12:37 p.m.
Para: Cake PHP
Asunto: Probably really dumb question

I'm just starting with Cake PHP and somehow I can't find any way to
state a controller for the root-page of the app. I tried
DefaultController, HomeController, I read the controller entry in the
manual at least four times by now, but it's still not quite working.


--~--~-~--~~~---~--~~
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: beforeSave problem (1.2)

2007-02-13 Thread Mariano Iglesias

Wow. Got the message. 

I didn't recommend formatting the computer and then seeing what happens. I
just got the validates() $data thingy confused with the save(). For the
record, nothing gets me more upset that lack of patience.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de nate
Enviado el: Martes, 13 de Febrero de 2007 12:16 p.m.
Para: Cake PHP
Asunto: Re: beforeSave problem (1.2)

No, bad, wrong, incorrect. categorically false.  Parameter usage has
been deprecated for Model::validates() and Model::invalidFields().  If
there is something you are or aren't supposed to do, either PhpNut or
myself will say so either in the form of documentation, or a friendly
warning in the code.

Also, for the record, nothing gets me more upset than people spreading
misinformation.  If you want to help people out, great, just make very
*very* sure that you actually know what you're talking about.


--~--~-~--~~~---~--~~
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: What editor do you use for CakePHP?

2007-02-13 Thread Jason Huebel

For those poor souls who can't use TextMate because you're on Windows,
you might want to take a look at InType (http://intype.info/). It's
still in alpha (and will eventually be commercial software), but it
includes a CakePHP "bundle". Bundles are plugins that include code
snippets and keyboard shortcuts for a particular language.

It's a very lightweight and extremely clean (almost to a fault)
interface. Hope you like it.

Jason Huebel

[EMAIL PROTECTED] wrote:
> G'day all,
> 
> Matt from Australia here.  In the past I've done all my PHP coding
> using a text editor such as Wordpad, and then a few years back I've
> begun using Dreamweaver.
> 
> Currently I'm using Dreamweaver 8 and I've found it to be quite good
> when dealing with .php files.  It's not great when editing .thtml
> files though, since it doesn't recognize them as code, and so doesn't
> give you all the nice code colouring and auto-closing of tags, etc...
> At least the automated uploading/downloading is nice.
> 
> What do you use for Cake cooking?
> 
> 
> > 
> 

--~--~-~--~~~---~--~~
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: Sending emails

2007-02-13 Thread jinhr

Hi, Andrzej:
My codes work OK for "html", for "text", but NOT for "both". I think
EmailCompotent still has problem (email.php version 4410 under
cake_1.2.0.4451alpha). Here are codes for the  three files:

///
//File controllers/requests.php
//
class RequestsController extends AppController
{
var $name = "Requests";
var $uses = array(...);
var $components = array('Email');

function submit($id)
{
//save request into database.
//then send email alert to manager
$this->Email->to = $this->data['AuthorizingManager']['mail'];
$this->Email->from = $this->data['Requestor']['fullname'] . " <".
$this->data['Requestor']['mail'].">";
$this->Email->replyTo = $this->data['Requestor']['mail'];
$this->Email->charset = 'utf-8';
$this->Email->sendAs = "html";
$this->Email->template = "newRequestSubmit";
$this->Email->subject = "New Request #".$this->data['Request']['id'].
"comes!";
$emailResult = $this->Email->send();

$this->set('request',$this->data);

$this->flash('Request (#'.$id.') is created! Email Alert ='.
$emailResult, '/requests/view/'.$id);
}
}

/
//File views/layouts/email/html/default.ctp







This test email comes from DCCC

This E-mail is auto-generated by DCCC



///
//File views/elements/email/html/default.ctp

Hello, a new request submitted! 


URL
http://server/requests/view/">http://server/requests/view/


Request #


..






On 2月12日, 下午4时38分, "thequietlab" <[EMAIL PROTECTED]> wrote:
> hi everybody,
>
> I'm kind of new to cakephp and from time to time I drown into some
> problems :)
> Now I stucked with sending emails, I tried the new EmailComponent from
> version 1.2 which is described in a bakery but somehow had problems
> with passing variables to my views, not even saying that my html
> emails didn't appear in my outlook (though I checked the html source
> and the content was there). I didn't spend to much time resolving
> these issues and just tried phpmailer, which I usually use, as
> described in bakery (btw. great resource!:)) but I had some other
> problems with layout/views mixed between those for emails and those
> for my controller action..
>
> My question is : does anybody has a working example of sending emails,
> both html and text, either through EmailComponent or any other vendor
> lib ?
>
> Thanks,
> Andrzej


--~--~-~--~~~---~--~~
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: is there a function exist($var) somewhere that I didn't find?

2007-02-13 Thread fr3nch13

yeah, isset();

if you wanna use your function in your post, you could rewite it like:

function exist($var)
{
   return isset($var);
}

which again would be the equivalent of just using isset() anyways

On Feb 13, 10:42 am, "DaddyCool78" <[EMAIL PROTECTED]> wrote:
> Hello to all the devs in here! I'm happy to have found this project,
> as it is really useful/impressive ^_^
>
> I recently started creating/modifying apps and I was looking for a
> function that would look up for the existence of a x $variable .
>
> Exemple, there is frequently in Views something like :
> if ($error): ..
>
> problem is when the $error is not set (using AJAX form fill, etc.) . I
> was wondering if a function that I don't know the name yet would do
> something like this :
>
> function exist($var)
> {
>   if (isset($var)) {
> return $var;
>   }else{
> return false;
>   }
>
> }
>
> A simple way to check the existence of a variable and avoid the
> messages like 'xxx variable could not be found.'
>
> David


--~--~-~--~~~---~--~~
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: is there a function exist($var) somewhere that I didn't find?

2007-02-13 Thread D.Pape

did you tried isset($variable)?




DaddyCool78 schrieb:
> Hello to all the devs in here! I'm happy to have found this project,
> as it is really useful/impressive ^_^
>
> I recently started creating/modifying apps and I was looking for a
> function that would look up for the existence of a x $variable .
>
> Exemple, there is frequently in Views something like :
> if ($error): ..
>
> problem is when the $error is not set (using AJAX form fill, etc.) . I
> was wondering if a function that I don't know the name yet would do
> something like this :
>
> function exist($var)
> {
>   if (isset($var)) {
> return $var;
>   }else{
> return false;
>   }
> }
>
> A simple way to check the existence of a variable and avoid the
> messages like 'xxx variable could not be found.'
>
> David
>
>
> >
>
>   


--~--~-~--~~~---~--~~
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: What editor do you use for CakePHP?

2007-02-13 Thread fr3nch13

With DW8 and using their sites, all you have to do is hit [control]+
[shift]+u and it will save and upload the file.


On Feb 13, 10:56 am, "joel" <[EMAIL PROTECTED]> wrote:
> Just yesterday I learned that about DockSend with Transmit - awesome!
> And there's even a bundle command for it in TextMate.  I reassigned
> the "DockSend file" command to Control + Shift + S in TextMate, and
> now I basically make an edit to a file and then save it and hit that
> key combo above and it automatically uploads it on the correct server
> and in the correct directory.  This tip will save me lots of minutes
> switching back and forth between apps.  Hope it helps!
>
> On Feb 12, 2:40 pm, "tracyfloyd" <[EMAIL PROTECTED]> wrote:
>
> > +1 for TextMate and Transmit!
> > Drag from the TextMate project right onto the Transmit icon in the
> > dock with DockSend... simple and beautiful.
>
> > On Feb 12, 10:11 am, "nateklaiber" <[EMAIL PROTECTED]> wrote:
>
> > > Textmate for the editor and Transmit for the FTP client (OS X). It's a
> > > great combination, and very flexible with code bundles.


--~--~-~--~~~---~--~~
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: What editor do you use for CakePHP?

2007-02-13 Thread fr3nch13

I use dreamweaver 8 with their site settings for editing, etc. I'm
stuck on windows cuz i have to test in IE too. blah!

BTW, great resource: http://tredosoft.com/Multiple_IE


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



is there a function exist($var) somewhere that I didn't find?

2007-02-13 Thread DaddyCool78

Hello to all the devs in here! I'm happy to have found this project,
as it is really useful/impressive ^_^

I recently started creating/modifying apps and I was looking for a
function that would look up for the existence of a x $variable .

Exemple, there is frequently in Views something like :
if ($error): ..

problem is when the $error is not set (using AJAX form fill, etc.) . I
was wondering if a function that I don't know the name yet would do
something like this :

function exist($var)
{
  if (isset($var)) {
return $var;
  }else{
return false;
  }
}

A simple way to check the existence of a variable and avoid the
messages like 'xxx variable could not be found.'

David


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



Probably really dumb question

2007-02-13 Thread Dominik Schwind

Hi everybody,

I'm just starting with Cake PHP and somehow I can't find any way to
state a controller for the root-page of the app. I tried
DefaultController, HomeController, I read the controller entry in the
manual at least four times by now, but it's still not quite working.

What am I doing wrong?

Thanks,

Dominik


--~--~-~--~~~---~--~~
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: What editor do you use for CakePHP?

2007-02-13 Thread DaddyCool78

Notepad++ also, very lightweight (take 2sec to load) and it's easy to
add your custom functions to retrive them rapidly ^_^


--~--~-~--~~~---~--~~
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: Sending emails

2007-02-13 Thread GreyCells

If you are using $this->Email->send('Simple email content'); then you
need to explicitly set the template to null.

See: https://trac.cakephp.org/ticket/2105

~GreyCells

(Thought I'd sent this earlier, but it didn't show up...?)


On Feb 13, 12:17 pm, "thequietlab" <[EMAIL PROTECTED]> wrote:
> @Felix : thanks, I'll try your snippet and I'll let you know
>
> @Sergei : oh man..using mail() is not really convenient when you want
> to send html + txt version, attachments etc. that's why soft like
> phpmailer or swiftmailer came out.. making our life easier :) Now I
> hope cakephp EmailComponent will make it easier as well..
>
> Thanks guys


--~--~-~--~~~---~--~~
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: What editor do you use for CakePHP?

2007-02-13 Thread jinhr

I use: Eclipse as environment + PDT (http://www.eclipse.org/php/) as
PHP editor + Subclipse for version control + Mylar & Trac for task
management.

The best things for such solution is 1) It is totally free 2) It runs
on linux or windows. 3)source code version is under control from ONE
repository.


--~--~-~--~~~---~--~~
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: Sending emails

2007-02-13 Thread GreyCells

If you are using $this->Email->send('Simple email content'); then you
need to explicitly set the template to null.

See: https://trac.cakephp.org/ticket/2105

~GreyCells

(Thought I'd sent this earlier, but it didn't show up)

On Feb 13, 12:17 pm, "thequietlab" <[EMAIL PROTECTED]> wrote:
> @Felix : thanks, I'll try your snippet and I'll let you know
>
> @Sergei : oh man..using mail() is not really convenient when you want
> to send html + txt version, attachments etc. that's why soft like
> phpmailer or swiftmailer came out.. making our life easier :) Now I
> hope cakephp EmailComponent will make it easier as well..
>
> Thanks guys


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



CakePHP CMS

2007-02-13 Thread rhet

Does anyone know of any good CMS for cake? I would like the
application to be a plugin.


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



loadModel( ) vs $uses

2007-02-13 Thread redhex

Hi all, I am looking at reducing the size of my controller.

Can I say that with loadModel, I can limit my $users array to the
minimum? And for those methods that requires those less frequently
uses model to load upon the different function request?


--~--~-~--~~~---~--~~
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: Fetching Posts without Comments

2007-02-13 Thread Alexander Wegener




and how to to this the object oriented way (with fetchAll()) ??



many thanks!

Alex





On Tue, 13 Feb 2007 14:59:24 +0100, Kaste <[EMAIL PROTECTED]> wrote:

> 

>> select posts.id, comments.id, count(comments.id) as commentscount from

>> posts, comments where comments.posts_id = posts.id where commentscount =

>> 0

>> group by posts.id;

>>

> 

> select p.* from posts p left join comments c on c.post_id=p.id where c.id

> is null;

> 

> 

>> Right?

> 

> 

--~--~-~--~~~---~--~~
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 with a $hasMany, $belongsTo association...

2007-02-13 Thread shoesole

Wow. I knew it had to be something easy that I was completely
overlooking. Thank you so much Eric. I read the manual chapter on
models multiple times, but I guess that part just didn't sink in
(maybe next time I should read more carefully). Anyway, Thanks. This
is my first shot at Cake and I love it so far, but that really had me
confounded.


--~--~-~--~~~---~--~~
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: What editor do you use for CakePHP?

2007-02-13 Thread joel

Just yesterday I learned that about DockSend with Transmit - awesome!
And there's even a bundle command for it in TextMate.  I reassigned
the "DockSend file" command to Control + Shift + S in TextMate, and
now I basically make an edit to a file and then save it and hit that
key combo above and it automatically uploads it on the correct server
and in the correct directory.  This tip will save me lots of minutes
switching back and forth between apps.  Hope it helps!

On Feb 12, 2:40 pm, "tracyfloyd" <[EMAIL PROTECTED]> wrote:
> +1 for TextMate and Transmit!
> Drag from the TextMate project right onto the Transmit icon in the
> dock with DockSend... simple and beautiful.
>
> On Feb 12, 10:11 am, "nateklaiber" <[EMAIL PROTECTED]> wrote:
>
> > Textmate for the editor and Transmit for the FTP client (OS X). It's a
> > great combination, and very flexible with code bundles.
>


--~--~-~--~~~---~--~~
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: What editor do you use for CakePHP?

2007-02-13 Thread Gregg Larson
Thank you for this tip

On 2/12/07, wedge <[EMAIL PROTECTED]> wrote:
>
>
> I'm using Dreamweaver 8 too.
>
> And there's a way to make .thtml files editable like .php files. Found
> the text here, forgot to note the author.
>
> -
>
> Just a couple of tips for developers who prefer to develop their page
> layouts in Dreamweaver or work with graphics people who use
> Dreamweaver. These are for DW 8.
>
> 1. Make thtml files editable in the design view
>
> - Find the Extensions.txt file in Dreamweaver's "Configuration" folder
> and edit the line
>
> PHP,PHP3,PHP4,PHP5,TPL:PHP Files
>
> to read
>
> PHP,PHP3,PHP4,PHP5,TPL,THTML:PHP Files
>
> - Find the MMDocumentTypes.xml file in the "DocumentTypes" (this is in
> the "Configuration" folder) and change the line
>
>  internaltype="Dynamic" winfileextension="php,php3,php4,php5"
> macfileextension="php,php3,php4,php5" file="Default.php"
> writebyteordermark="false">
>
> to read
>
>  internaltype="Dynamic" winfileextension="php,php3,php4,php5,thtml"
> macfileextension="php,php3,php4,php5,thtml" file="Default.php"
> writebyteordermark="false">
>
> 2.  Use the "Design Time Style Sheet" to allow you to view thtml files
> with the appropriate css style applied.
>
> - Open up the thtml file you wish to edit then from the main menu
> select Text > CSS Styles > Design-time . Select the "+" above  the
> "Show only at design time" box and select the cake.default.css file
> from the "webroot/css" folder.
>
> --
>
>
> >
>

--~--~-~--~~~---~--~~
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: beforeSave problem (1.2)

2007-02-13 Thread nate

> As of CakePHP 1.2 save() no longer expects the data. Use create() to specify
> it.

No, bad, wrong, incorrect. categorically false.  Parameter usage has
been deprecated for Model::validates() and Model::invalidFields().  If
there is something you are or aren't supposed to do, either PhpNut or
myself will say so either in the form of documentation, or a friendly
warning in the code.

Also, for the record, nothing gets me more upset than people spreading
misinformation.  If you want to help people out, great, just make very
*very* sure that you actually know what you're talking about.


--~--~-~--~~~---~--~~
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 with a $hasMany, $belongsTo association...

2007-02-13 Thread alexxwiz

Added to Category model:

var $belongsTo = array (
'Maincat' => array (
'className' => 'Maincat',
'foreignKey' => 'maincat_id'
)
);


Trying to set recursive to 1 and 2, but nope.

$this->Maincat->recursive = 1;
print_r($this->Maincat->findAll());

Result is same as before.

Any suggestions?

On 13 фев, 16:42, "Seb" <[EMAIL PROTECTED]> wrote:
> @alexxwiz : try adding this to your Category model;
> var $belongsTo = array ('Maincat');
>
> @shoesole : note how you don't have to use the className value if you
> stick to the naming convention, hence your
> var $belongsTo  = array('Blog' => array('className' => 'Blog') );
> can become
> var $belongsTo  = array('Blog');
>
> Hope that helps!
>
> Cheers,
>
> Seb.
>
> On Feb 13, 11:27 pm, "alexxwiz" <[EMAIL PROTECTED]> wrote:
>
> > I have same problem.
> > Two tables:
>
> > CREATE TABLE `maincats` (
> >   `id` int(10) unsigned NOT NULL auto_increment,
> >   `title` varchar(255) default NULL,
> >   `visible` tinyint(4) NOT NULL default '1',
> >   `created` datetime NOT NULL,
> >   PRIMARY KEY  (`id`)
> > ) ENGINE=MyISAM;
>
> > CREATE TABLE `categories` (
> >   `id` int(10) unsigned NOT NULL auto_increment,
> >   `title` varchar(255) default NULL,
> >   `maincat_id` int(11) default NULL,
> >   `visible` tinyint(4) NOT NULL default '1',
> >   `created` datetime NOT NULL,
> >   PRIMARY KEY  (`id`)
> > ) ENGINE=MyISAM;
>
> > Two models:
>
> > class Maincat extends AppModel {
> > var $name = 'Maincat';
> > var $hasMany =
> > array('Category'=>array('className'=>'Category','foreignKey' =>
> > 'maincat_id'));
>
> > }
>
> > class Category extends AppModel {
> > var $name = 'Category';
>
> > }
>
> > print_r($this->Maincat->findAll());
>
> > returns only maincats content and none sub-categories.
>
> > Array
> > (
> > [0] => Array
> > (
> > [Maincat] => Array
> > (
> > [id] => 1
> > [title] => Some first
> > [visible] => 1
> > [created] => 2007-02-13 14:39:28
> > )
>
> > )
>
> > [1] => Array
> > (
> > [Maincat] => Array
> > (
> > [id] => 2
> > [title] => Some second
> > [visible] => 1
> > [created] => 2007-02-13 00:00:00
> > )
>
> > )
>
> > )
>
> > Where is my mistake?


--~--~-~--~~~---~--~~
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: beforeSave problem (1.2)

2007-02-13 Thread Mariano Iglesias

By "may soon be removed" I didn't mean to say that the save() method would
be removed (duh!), but that the support for sending data to save() may be.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: Mariano Iglesias [mailto:[EMAIL PROTECTED] 
Enviado el: Martes, 13 de Febrero de 2007 11:24 a.m.
Para: 'cake-php@googlegroups.com'
Asunto: RE: beforeSave problem (1.2)

but, unlike create(), it is not considering default values that the table
may have, and may soon be removed, so eventhough you may be inclined to send
data to save(), try to avoid it.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: beforeSave problem (1.2)

2007-02-13 Thread Mariano Iglesias

$this->Model->create() would create an "empty" model, cleaning it of old
values it may have. If you look at cake/libs/model/model.php you'll see that
create is defined as following:

function create($data = array())

So no parameters would be the same as sending it an empty array().

Also on model.php you can see that save() still gets the data:

save($data = null, $validate = true, $fieldList = array())

but, unlike create(), it is not considering default values that the table
may have, and may soon be removed, so eventhough you may be inclined to send
data to save(), try to avoid it.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Ámon Tamás
Enviado el: Martes, 13 de Febrero de 2007 10:59 a.m.
Para: cake-php@googlegroups.com
Asunto: Re: beforeSave problem (1.2)

Is it $this->Classad->create() same? How I see what the bake.php make 
there is no parameters for create().


--~--~-~--~~~---~--~~
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 with a $hasMany, $belongsTo association...

2007-02-13 Thread Seb

@alexxwiz : try adding this to your Category model;
var $belongsTo = array ('Maincat');

@shoesole : note how you don't have to use the className value if you
stick to the naming convention, hence your
var $belongsTo  = array('Blog' => array('className' => 'Blog') );
can become
var $belongsTo  = array('Blog');

Hope that helps!

Cheers,

Seb.

On Feb 13, 11:27 pm, "alexxwiz" <[EMAIL PROTECTED]> wrote:
> I have same problem.
> Two tables:
>
> CREATE TABLE `maincats` (
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `title` varchar(255) default NULL,
>   `visible` tinyint(4) NOT NULL default '1',
>   `created` datetime NOT NULL,
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM;
>
> CREATE TABLE `categories` (
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `title` varchar(255) default NULL,
>   `maincat_id` int(11) default NULL,
>   `visible` tinyint(4) NOT NULL default '1',
>   `created` datetime NOT NULL,
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM;
>
> Two models:
>
> class Maincat extends AppModel {
> var $name = 'Maincat';
> var $hasMany =
> array('Category'=>array('className'=>'Category','foreignKey' =>
> 'maincat_id'));
>
> }
>
> class Category extends AppModel {
> var $name = 'Category';
>
> }
>
> print_r($this->Maincat->findAll());
>
> returns only maincats content and none sub-categories.
>
> Array
> (
> [0] => Array
> (
> [Maincat] => Array
> (
> [id] => 1
> [title] => Some first
> [visible] => 1
> [created] => 2007-02-13 14:39:28
> )
>
> )
>
> [1] => Array
> (
> [Maincat] => Array
> (
> [id] => 2
> [title] => Some second
> [visible] => 1
> [created] => 2007-02-13 00:00:00
> )
>
> )
>
> )
>
> Where is my mistake?


--~--~-~--~~~---~--~~
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 with a $hasMany, $belongsTo association...

2007-02-13 Thread Seb

@alexxwiz.. and make sure you read Eric's post about $recursive!

;)

S.

On Feb 13, 11:27 pm, "alexxwiz" <[EMAIL PROTECTED]> wrote:
> I have same problem.
> Two tables:
>
> CREATE TABLE `maincats` (
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `title` varchar(255) default NULL,
>   `visible` tinyint(4) NOT NULL default '1',
>   `created` datetime NOT NULL,
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM;
>
> CREATE TABLE `categories` (
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `title` varchar(255) default NULL,
>   `maincat_id` int(11) default NULL,
>   `visible` tinyint(4) NOT NULL default '1',
>   `created` datetime NOT NULL,
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM;
>
> Two models:
>
> class Maincat extends AppModel {
> var $name = 'Maincat';
> var $hasMany =
> array('Category'=>array('className'=>'Category','foreignKey' =>
> 'maincat_id'));
>
> }
>
> class Category extends AppModel {
> var $name = 'Category';
>
> }
>
> print_r($this->Maincat->findAll());
>
> returns only maincats content and none sub-categories.
>
> Array
> (
> [0] => Array
> (
> [Maincat] => Array
> (
> [id] => 1
> [title] => Some first
> [visible] => 1
> [created] => 2007-02-13 14:39:28
> )
>
> )
>
> [1] => Array
> (
> [Maincat] => Array
> (
> [id] => 2
> [title] => Some second
> [visible] => 1
> [created] => 2007-02-13 00:00:00
> )
>
> )
>
> )
>
> Where is my mistake?


--~--~-~--~~~---~--~~
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: Fetching Posts without Comments

2007-02-13 Thread Kaste

> select posts.id, comments.id, count(comments.id) as commentscount from
> posts, comments where comments.posts_id = posts.id where commentscount =  
> 0
> group by posts.id;
>

select p.* from posts p left join comments c on c.post_id=p.id where c.id  
is null;


> Right?

--~--~-~--~~~---~--~~
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: beforeSave problem (1.2)

2007-02-13 Thread Ámon Tamás

Mariano Iglesias wrote:
> If you are using CakePHP 1.2 (as you stated) then do not pass $data to the
> save model, instead first construct the model with your data and then call
> save:
> 
> $this->Classad->create($this->data);

Is it $this->Classad->create() same? How I see what the bake.php make 
there is no parameters for create().

-- 
Ámon Tamás
http://linkfelho.amon.hu


--~--~-~--~~~---~--~~
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: installing oceanCMS

2007-02-13 Thread Dr. Tarique Sani

On 2/13/07, keymaster <[EMAIL PROTECTED]> wrote:
>
> If this is really dead project, there may be an issue with the
> reporting on cakeforge.
>

Of late number of things seem to be unkept on Cakeforge.

The forum of Bearclaw was full of spam I last saw.

The download numbers for CakeAMFPHP (1 + in two days for a project
which barely had 40 downloads a day average) seem to be going crazy -
to some extent even CakePHP downloads

Probably some bots/spiders stuck in a loop

Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
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: beforeSave problem (1.2)

2007-02-13 Thread Mariano Iglesias

If you are using CakePHP 1.2 (as you stated) then do not pass $data to the
save model, instead first construct the model with your data and then call
save:

$this->Classad->create($this->data);
$this->Classad->save();

As of CakePHP 1.2 save() no longer expects the data. Use create() to specify
it.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Ámon Tamás
Enviado el: Martes, 13 de Febrero de 2007 06:04 a.m.
Para: Cake PHP
Asunto: beforeSave problem (1.2)

I have a beforeSave() in my Classadd model. In here I adding some extra 
value for the database row, somethind like this:

$this->data['Classadd']['emailazon'] = $this->RandString(24);

but, when I try to get back this data after the
$this->Classadd->save($this->data)

In the $this->Classadd->data is empty. (The insertion is good.) That was 
working in the last stable version. Is this a bug or a new feature?


--~--~-~--~~~---~--~~
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: Sending emails

2007-02-13 Thread thequietlab

@Felix : thanks, I'll try your snippet and I'll let you know

@Sergei : oh man..using mail() is not really convenient when you want
to send html + txt version, attachments etc. that's why soft like
phpmailer or swiftmailer came out.. making our life easier :) Now I
hope cakephp EmailComponent will make it easier as well..

Thanks guys


--~--~-~--~~~---~--~~
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 with a $hasMany, $belongsTo association...

2007-02-13 Thread alexxwiz

I have same problem.
Two tables:

CREATE TABLE `maincats` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `title` varchar(255) default NULL,
  `visible` tinyint(4) NOT NULL default '1',
  `created` datetime NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;

CREATE TABLE `categories` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `title` varchar(255) default NULL,
  `maincat_id` int(11) default NULL,
  `visible` tinyint(4) NOT NULL default '1',
  `created` datetime NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;

Two models:

class Maincat extends AppModel {
var $name = 'Maincat';
var $hasMany =
array('Category'=>array('className'=>'Category','foreignKey' =>
'maincat_id'));
}

class Category extends AppModel {
var $name = 'Category';
}


print_r($this->Maincat->findAll());

returns only maincats content and none sub-categories.

Array
(
[0] => Array
(
[Maincat] => Array
(
[id] => 1
[title] => Some first
[visible] => 1
[created] => 2007-02-13 14:39:28
)

)

[1] => Array
(
[Maincat] => Array
(
[id] => 2
[title] => Some second
[visible] => 1
[created] => 2007-02-13 00:00:00
)

)

)


Where is my mistake?


--~--~-~--~~~---~--~~
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: Using the cookie component in 1.1.x

2007-02-13 Thread lukemack

http://cakebaker.42dh.com/2007/01/20/lets-eat-cake-and-cookies/



On 12 Feb, 10:12, "Fasthold" <[EMAIL PROTECTED]> wrote:
> Is there any document or example about the brand new cookie components?


--~--~-~--~~~---~--~~
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: Associations stored in a table?!

2007-02-13 Thread Hawk|

Hi Mindcharger,

your System sounds like the Problem i have.
How do u create your forms? Hardcoded in cakePhp or dynamicly?

I have an additional component to solve.
- I need dynamic tables and associations. Like i mentioned above
- the next step is to create views/forms dynamicly out of xml
definitions

So u can have a full flexible application, with dynamic tables and
forms.
The easiest way would be, if the user is able to create one XML-File.
Depending on that XML-File the system creates a tables, associations
and forms to gather the data.

I am just gathering informations, if it is possible to solve this kind
of requirements with cakePHP.
Or i have to write the application in Java. :-/

So i think it would be possible to solve that issue with cakePHP.
I allready definded the "descriptor-table" based on the normal hasone/
hasmany/habtm... associations from cake.
Now i need to define a kind of autoform, depending on the xml
definition. So i only need to create one model/controller>/view for
all
tables.

Thx for your input!



On Feb 10, 2:36 pm, "mindcharger" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> This system is a mobile network monitoring tool.
> The system receives data from the different network nodes, processes
> that data (calculates a value using a user-defined formula) and stores
> the data back on a DB.
> Then you have a web-based user interface where you can pick which
> mesaures you want to see and that shows you plots of the measures in a
> given time-period.
>
> Since you want to define different measures to different network nodes
> and networks, you cannot have the measures "hard-coded" on the php
> code or even have a fixed DB table strucutre. So you have to employ
> the technique I described in my post (well, this was actually the form
> I found to deal with the issue, I'm sure there are many other ways,
> and possibly more clever than mine... ;-) ).
>
> This procedure allows you to change the calculating formulas and
> define new measures if you need. At first it was difficult to overcome
> this problem, but the solution is very robust and works nice. In fact,
> we are already making an expanded version of the application which
> will be deployed on a major telecommunications equipmente manufacurer
> branch office next April.
>
> I don't know if I was clear in my exlaination. If threre's anything
> else you want to know feel free to ask.
>
> Cheers!
>
> On Feb 9, 2:15 pm, "Max" <[EMAIL PROTECTED]> wrote:
>
> > Hi Mindchanger,
>
> > I will be interested in knowing more about the main requirements
> > behind this... It looks interesting.
>
> > On Feb 9, 1:50 am, "mindcharger" <[EMAIL PROTECTED]> wrote:
>
> > > Hi Hawk,
>
> > > I'm currently developing a system that shares that "dynamic table
> > > creation" requirement with yours.
> > > As far as I understand the problem, it's more a DB issue than a CAKE
> > > issue.
>
> > > I don't know if it will help you, but I will try to explain how I did
> > > it.
>
> > > 1) I have a table on the DB that "describes" the other tables I
> > > create. To this table I call a "descriptor". Assume it has several
> > > columns, but one of them is called "table_name".
> > > 2) Creating a new table encompasses two steps:
> > >   i) Add a record to the "descriptor" table
> > >  ii) Create the proper table
> > > 3) To access the table you must do 2 DB accesses:
> > >  i) Get all the descriptor records into a HTML select-box or something
> > > (Ex.: "SELECT table_name FROM descriptors;")
> > >  ii) Get the chosen table into a var and then acessing the desired
> > > table
> > > (Ex.:
> > > $table_name = ;
> > > $query = "SELECT * FROM $table_name;";
> > > $data = $this->{MODEL-NAME}->query($query);
> > > )
>
> > > The "$data = $this->{MODEL-NAME}->query($query);" allows you to force
> > > the Model to execute your query.
>
> > > As for the model, I found that when I want to use this "dynamic table
> > > device" I have no use for the associated table, so I define:
>
> > > $useTable=false;
>
> > > ...on the model.
>
> > > I hope it helps you. If the explanation was not clear or if you have
> > > any other doubt feel free to ask me.
>
> > > Good luck!
>
> > > On Feb 8, 9:53 am, "Hawk|" <[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
>
> > > > i wonder if it would be possible to store the associations in a table
> > > > instead of storing them in the models/model.php file. So it would be
> > > > more flexible. I need to create  tables dynamic and associate them on
> > > > the fly with others and i want to do this without touching the model
> > > > file itself.
> > > > Someone allready is using a similar method?
> > > > or someone has an idea how to do this?.
> > > > It would be a great help for me to get some response to this issue.
>
> > > > Thx a lot Hawk.


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

Re: Routes with wildcards - missing controller errors

2007-02-13 Thread mcgordon

Hi Eric,

Thanks for that pointer to the other thread.  Adding "/content" to the
beginning of my route did indeed fix the problem, but to me it feels
like a hack.

My two main routes now look like this:

Router::connect('/content/:lang/:controller/*', null,
array('lang'=>'en|it', 'controller'=>'articles|comments|tags'));

Router::connect('/*', array('controller' => 'pages', 'action' =>
'display'));

which results in my static pages having urls that look like /en/about,
which is what I'm going for, but all the rest of the urls look like /
content/en/controller/action which is not exactly ideal.

The problem with the Router seems to be that if you have more than one
wildcard in a route and the first one is matched, the Router thinks
that it has found the route that it needs to work with and so you get
missing controller or missing view errors when the rest of the route
doesn't match up, even though the url would match one of the
subsequent routes.  What this effectively means is that you can't have
two routes that start with the same wildcard because the first one
will always be used, no matter what.


--~--~-~--~~~---~--~~
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: installing oceanCMS

2007-02-13 Thread keymaster

If this is really dead project, there may be an issue with the
reporting on cakeforge.

It is showing it as one of the most active projects this week


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



  1   2   >