URL rewrite for 2 apps on IIS7

2013-07-06 Thread Ming Zhu
I have a question about how to configure url rewriting in Windows IIS7.

Assume my project root folder is MyProject, and beneath there are 2 
applications.  One is in MyProject\app folder, and the other is in 
MyProject\app2 folder.  I am using CakePHP 1.3, and MyProject\cake is the 
cake folder.
For first application in MyProject\app, I add an web site in IIS pointing 
to MyProject, the root folder.  And the file MyProject\web.config contains 
the content as specified by the Cake 1.3 book 
(http://book.cakephp.org/1.3/en/The-Manual/Developing-with-CakePHP/Installation.html#url-rewrites-on-iis7-windows-hosts).
  
And it works just fine.
My question is how to configure for my 2nd application MyProject\app2?  
What I did is create another web site in IIS pointing to MyProject\app2 (I 
guess it can't be MyProject folder as it's the same as my first 
application.)  Then inside MyProject\app2 I create another web.config with 
the same content as the previous web.config except that the write url is 
changed to MyProject\app2\webroot.  But this configuration does not work.  
When I visit app2, it will just show me the IIS7 default home page.

Please note that this is for my development on Windows 7.  The same folder 
structure works well on my CentOS production environment using nginx.

Could I use two apps with the same cake folder on Windows IIS7?  What else 
could I do?  If I need to change the folder structure, what else do I need 
to change for it run as previously on my CentOS production server?

Thanks!
Zhu Ming

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




missing not-null column in SQL

2013-06-10 Thread Ming Zhu
I have been working on ASP.NET for a long time.  I am new to PHP, CakePHP 
and MySQL.  I just started to work on a CakePHP project using CakePHP 
1.3.7.  ASP.NET also has MVC, so this concept is not completely new to me.

The problem I met is in a table that there is a NOT NULL column.  But the 
UI(view) does not have the input field for this column.  When it comes to 
the SaveAll(this->data) call in the corresponding controller's action 
method, the field is missing in this->data.  Thus the SQL statement 
generated does not include this column.  So the saving fails with an error: 
1364: Field 'xyz' doesn't have a default value.

The real frustrating part of the problem is that this error only happens on 
my local laptop.  And it does not happen on the server.  The following is 
the configuration of my local laptop and the server.

   - server: CentOS 6.3, Nginx 1.2.4, MySQL 5.5.28, PHP 5.4.8, CakePHP 1.3.7
   - my laptop: Windows 7, IIS 7.5, MySQL 5.6.11, PHP 5.4.15, CakePHP 1.3.7


I have two questions:

   1. Could I upgrade CakePHP from 1.3.7 to 1.3.16 by replacing only the 
   cake folder?  Is there any easy way to upgrade to 2.3.5?  I see 2.x has 
   better support for debugging.  I am surprised to see this project is still 
   using such an old version.
   2. How could I address the error mentioned above?  Definitely I could 
   add code to check and fill such NOT NULL column with a default value, or 
   just define a default value in MySQL database.  But there are other 
   tables/columns with the same problem.  Why does it NOT happen on the 
   server?  I want to find out the root cause of it before I set out to find a 
   solution.  I suspect it's related with the configuration either in 
   environment (OS, MySQL, PHP etc.) or in my app code.  Is there any best 
   practices to overcome this?  I searched around for a few days, but can't 
   find anything much helpful to my problem.  So it should not be a common 
   problem.  Or maybe just my search technique is really poor.
   
I am new in PHP and CakePHP, so any guidance/direction would be very 
helpful.

Thanks for any help in advance!

Zhu Ming

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How to throw exception defined by DB?

2007-06-28 Thread Ming

Hi,

I have set some rules in my DB, for example, some keys must be unique.

How can I throw exception generated by the DB when inserting invalid
entries?

For example, if 'email' in my DB is set to be UNIQUE and I want to add
a duplicate 'email', in MySQL, I will get something like:

#1062 - Duplicate entry '[EMAIL PROTECTED]' for key 2

How can I get this error and pass it to users (via cake)?

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



Debugging Cake app via DBG or Zend Debugger

2007-05-29 Thread Ming

Hi there,

I wonder if anybody here can do me a favor by sharing his/her
experience in debugging a Cake app by DBG (if you are using PhpED) or
Zend Debugger ( if you are using Zend Studio or PDT).

I have troubles in debugging, esp, breakpoints I set seem not work
properly. I am not sure if it because of mod_rewrite setting or
something else. While trying to debug only the app, I always 'dive'
into the framework's codes

Thanks,


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



Re: Question about variable scope, object and $html

2007-05-23 Thread Ming

I read it, and I did the online tutorial line by line. But I still do
not quite understand. Back to my question, is $this->controller an
object? But $controller is a variable defined in this class.Or maybe
$controller is a variable passed by reference that points to an
object?

For the $html (introduced in the blog tutorial), as I never declare
it. Is it a global variable (global object?)? If yes, where is it
declared?

Many thanks,


On May 23, 2:31 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 5/23/07, Ming <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hey John,
>
> > This script is from an app built on top of cakephp, and to maintain
> > this app is part of my new job. There are 557 files totally in app/
> > models, app/controllers, and app/views, and I want to go through all
> > over them so that I can work on the app.
>
> > Thanks,
>
> I highly suggest you read the CakePHP manual before you even attempt
> to figure this out.  From your comments I take it that you do not have
> a lot of experience with MVC frameworks built in PHP.  If you did, a
> lot of the questions you are asking would be easier to answer.
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


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



Re: Question about variable scope, object and $html

2007-05-23 Thread Ming

Yes, this app has many bugs. So far I have found nearly 100 bugs. I am
using both Zend studio and phpedit to debug it. I have quite a few
java and perl experience, but do not have too much php experience.

Thanks,


On May 23, 2:34 pm, "John David Anderson (_psychic_)"
<[EMAIL PROTECTED]> wrote:
> On May 23, 2007, at 3:27 PM, Ming wrote:
>
>
>
> > Hey John,
>
> > This script is from an app built on top of cakephp, and to maintain
> > this app is part of my new job. There are 557 files totally in app/
> > models, app/controllers, and app/views, and I want to go through all
> > over them so that I can work on the app.
>
> Part of the magic of using a framework is *not* knowing what
> everything does. Not many of us walk through Cake's source, not
> because we don't care, but because we really don't need to.
>
> Are you tracking down a bug or something?
>
> -- John


--~--~-~--~~~---~--~~
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: Question about variable scope, object and $html

2007-05-23 Thread Ming

Hey John,

This script is from an app built on top of cakephp, and to maintain
this app is part of my new job. There are 557 files totally in app/
models, app/controllers, and app/views, and I want to go through all
over them so that I can work on the app.

Thanks,


On May 23, 2:10 pm, "John David Anderson (_psychic_)"
<[EMAIL PROTECTED]> wrote:
> It might help us if we knew what you were trying to do, or why you
> needed to know this...
>
> -- John
>
> On May 23, 2007, at 2:45 PM, Ming wrote:
>
>
>
> > Hi,
>
> > I am new to Cake and I have a question.
>
> > For the file below (email.php), I do not understand where does the
> > "render" in
> > $this->controller->render($this->thtml) come from.
>
> > $controller ($this->controller) is a variable whose domain is limited
> > to this class. But it seems $this->controller is an object and it has
> > a render function
>
> > I searched the entire project and there are 3 render functions:
>
> > The 1st  is in app/controllers/components/output.php,
> > the 2nd is in cake/libs/view/view.php
> > the 3rd is in cake/libs/controller/controller.php
>
> > For this class (EmailComponent), which render function does it really
> > call? Why?
>
> > The confusing part for me, why $this->controller is an object instead
> > of a variable? I am using two different PHP IDE, after entering $this-
> >> controller->, there is no code hint (if entering $this->, code hints
> > will popup controller, for example).
>
> > Additionally, I got to know the $html helper from cake's online
> > tutorial. But where is $html declared? I cannot find it.
>
> > Thanks,
>
> > 
>
> > App/controllers/components/email.php
> >  > /*
> >  * EmailComponent for CakePHP
> >  *
> >  * @author  gwoo <[EMAIL PROTECTED]>
> >  * @version 0.10.5.1797
> >  * @licenseOPPL
> >  *
> >  */
> > class EmailComponent extends Object
> > {
> > var $thtml;
> > var $headers = null;
> > var $to = null;
> > var $from = null;
> > var $subject = null;
> > var $cc = null;
> > var $bcc = null;
> > var $controller;
>
> > function message()
> > {
> >//Output buffer starts here
> > ob_start();
> > $this->controller->render($this->thtml);
>
> > //Get buffer content and clean buffer
> > $mail = ob_get_clean();
> > return $mail;
> > }
>
> > function send()
> > {
>
> > $headers  = $this->headers
> >."Content-Transfer-Encoding: quoted-printable\n"
> >."From: $this->from\n"
> >."Return-Path: $this->from\n"
> >."CC:$this->cc\n"
> >."BCC:$this->bcc\n";
>
> >$success = mail($this->to, $this->subject, $this->message(),
> > $headers);
> >return $success;
> > }
>
> > }
>
> > ?>


--~--~-~--~~~---~--~~
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: Question about variable scope, object and $html

2007-05-23 Thread Ming

By the way, I tried to get help from capk's online API. But cake's API
interface is pretty different with those of Java, Pear, or CPAN.
Sounds need some time to get familiar with it.

On May 23, 1:45 pm, Ming <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am new to Cake and I have a question.
>
> For the file below (email.php), I do not understand where does the
> "render" in
> $this->controller->render($this->thtml) come from.
>
> $controller ($this->controller) is a variable whose domain is limited
> to this class. But it seems $this->controller is an object and it has
> a render function
>
> I searched the entire project and there are 3 render functions:
>
> The 1st  is in app/controllers/components/output.php,
> the 2nd is in cake/libs/view/view.php
> the 3rd is in cake/libs/controller/controller.php
>
> For this class (EmailComponent), which render function does it really
> call? Why?
>
> The confusing part for me, why $this->controller is an object instead
> of a variable? I am using two different PHP IDE, after entering 
> $this->controller->, there is no code hint (if entering $this->, code hints
>
> will popup controller, for example).
>
> Additionally, I got to know the $html helper from cake's online
> tutorial. But where is $html declared? I cannot find it.
>
> Thanks,
>
> 
>
> App/controllers/components/email.php
>  /*
>  * EmailComponent for CakePHP
>  *
>  * @author  gwoo <[EMAIL PROTECTED]>
>  * @version 0.10.5.1797
>  * @license OPPL
>  *
>  */
> class EmailComponent extends Object
> {
> var $thtml;
> var $headers = null;
> var $to = null;
> var $from = null;
> var $subject = null;
> var $cc = null;
> var $bcc = null;
> var $controller;
>
> function message()
> {
> //Output buffer starts here
> ob_start();
> $this->controller->render($this->thtml);
>
> //Get buffer content and clean buffer
> $mail = ob_get_clean();
> return $mail;
> }
>
> function send()
> {
>
> $headers  = $this->headers
> ."Content-Transfer-Encoding: quoted-printable\n"
> ."From: $this->from\n"
> ."Return-Path: $this->from\n"
> ."CC:$this->cc\n"
> ."BCC:$this->bcc\n";
>
> $success = mail($this->to, $this->subject, $this->message(),
> $headers);
> return $success;
> }
>
> }
>
> ?>


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



Question about variable scope, object and $html

2007-05-23 Thread Ming

Hi,

I am new to Cake and I have a question.

For the file below (email.php), I do not understand where does the
"render" in
$this->controller->render($this->thtml) come from.

$controller ($this->controller) is a variable whose domain is limited
to this class. But it seems $this->controller is an object and it has
a render function

I searched the entire project and there are 3 render functions:

The 1st  is in app/controllers/components/output.php,
the 2nd is in cake/libs/view/view.php
the 3rd is in cake/libs/controller/controller.php

For this class (EmailComponent), which render function does it really
call? Why?

The confusing part for me, why $this->controller is an object instead
of a variable? I am using two different PHP IDE, after entering $this-
>controller->, there is no code hint (if entering $this->, code hints
will popup controller, for example).

Additionally, I got to know the $html helper from cake's online
tutorial. But where is $html declared? I cannot find it.

Thanks,



App/controllers/components/email.php

 * @version 0.10.5.1797
 * @license OPPL
 *
 */
class EmailComponent extends Object
{
var $thtml;
var $headers = null;
var $to = null;
var $from = null;
var $subject = null;
var $cc = null;
var $bcc = null;
var $controller;


function message()
{
//Output buffer starts here
ob_start();
$this->controller->render($this->thtml);

//Get buffer content and clean buffer
$mail = ob_get_clean();
return $mail;
}

function send()
{

$headers  = $this->headers
."Content-Transfer-Encoding: quoted-printable\n"
."From: $this->from\n"
."Return-Path: $this->from\n"
."CC:$this->cc\n"
."BCC:$this->bcc\n";

$success = mail($this->to, $this->subject, $this->message(),
$headers);
return $success;
}

}

?>


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



Web automation, within or outside cake?

2007-05-22 Thread Ming

Hi there,

I am working to rewrite my perl codes by using php. About half of my
codes involve web automation (using LWP in Perl extensively).
Basically, my codes first submit some forms, follow some URLs based on
some regular expression patterns, analyze web pages to get some
contents, get some feeds, store feeds locally, parse feeds, and
finally store them in local db automaticall. After that, most
operations are db operations.

It seems cakephp assumes operations invlove database, though a quick
search shows it is okay to bypass models that corresponding to some
tables/relations.

So my question is, for the web automation part of my code, shall I
rewrite them by using cake framework? How can I do that?

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



Quesion about a variable in a model

2007-05-22 Thread Ming

Hi folks,

Could you please help me understand codes below? It is in a model
named Course. My question is: what does $data mean and where does
it come from?

Many thanks,

function prepData($data=null){
  if (empty($data['data']['Course']['record_status'])) {
$data['data']['Course']['record_status'] =
$data['form']
['record_status'];
}

if( !empty($data['form']['self_enroll']))
$data['data']['Course']['self_enroll'] = "on";
else
$data['data']['Course']['self_enroll'] =
"off";

for( $i=1; $i<=$data['data']['Course']['count']; $i++ )
{
$data['data']['Course']['instructor_id'.$i] =
isset($data['form']
['instructor_id'.$i])? $data['form']['instructor_id'.$i] : '';
}

return $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 scalable is this framework

2007-05-22 Thread Ming

maybe useful for you,

http://paul-m-jones.com/blog/?p=236

On May 20, 10:03 pm, surendra <[EMAIL PROTECTED]> wrote:
> I am thinking of making a site like myspace,facebook(social
> networking) site. Is it all  right  to choose  this framework. Is it
> scalable for  such large scalable  site?. Am I making  a correct
> decision?


--~--~-~--~~~---~--~~
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: Question about model

2007-05-22 Thread Ming

what's the hell?

i clicked "send" and I got "an error happened" , and clicked "send"
again, and I got "error happened" again.

if you dislike it, ignore it. you are not obligated to answer it, you
are not entitled to sniff off me, either.

whom do you think you are?



On May 22, 4:06 pm, "Mariano Iglesias" <[EMAIL PROTECTED]>
wrote:
> One time is enough, you posted several messages (and they were different, so
> it wasn't google groups posting it more than once) with the same question.
>
> Besides, just because you ask politely: "Can somebody explain me this code?"
> doesn't mean that it is a friendly question.
>
> Grumpy should show that Vampire link right about now.
>
> -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 Ming
> Enviado el: Martes, 22 de Mayo de 2007 07:57 p.m.
> Para: Cake PHP
> Asunto: Re: Question about model
>
> Hey man, I am seriously asking questions. Do you think your thread is
> a friendly one for a starter?


--~--~-~--~~~---~--~~
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: Question about model

2007-05-22 Thread Ming

Hey man, I am seriously asking questions. Do you think your thread is
a friendly one for a starter?

On May 22, 3:49 pm, "Mariano Iglesias" <[EMAIL PROTECTED]>
wrote:
> STOP IT STOP IT STOP IT STOP IT STOP IT
> STOP IT STOP IT STOP IT STOP IT STOP IT
>
> I will answer if you can answer me this:
>
> My car doesn't start, what's happening?
>
> -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 Ming
> Enviado el: Martes, 22 de Mayo de 2007 07:29 p.m.
> Para: Cake PHP
> Asunto: Re: Question about model
>
> May I ask where does $data come from, what does it mean?


--~--~-~--~~~---~--~~
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: Question about model

2007-05-22 Thread Ming

May I ask where does $data come from, what does it mean?

Thanks

On May 22, 3:22 pm, Ming <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> Could you please help me understand codes below? It is in a model
> named Course
>
> Many thanks,
>
> function prepData($data=null){
>   if (empty($data['data']['Course']['record_status'])) {
> $data['data']['Course']['record_status'] = $data['form']
> ['record_status'];
> }
>
> if( !empty($data['form']['self_enroll']))
> $data['data']['Course']['self_enroll'] = "on";
> else
> $data['data']['Course']['self_enroll'] = "off";
>
> for( $i=1; $i<=$data['data']['Course']['count']; $i++ ){
> $data['data']['Course']['instructor_id'.$i] = 
> isset($data['form']
> ['instructor_id'.$i])? $data['form']['instructor_id'.$i] : '';
> }
>
> return $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: Question about model

2007-05-22 Thread Ming

Where does $data come from?

On May 22, 3:22 pm, Ming <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> Could you please help me understand codes below? It is in a model
> named Course
>
> Many thanks,
>
> function prepData($data=null){
>   if (empty($data['data']['Course']['record_status'])) {
> $data['data']['Course']['record_status'] = $data['form']
> ['record_status'];
> }
>
> if( !empty($data['form']['self_enroll']))
> $data['data']['Course']['self_enroll'] = "on";
> else
> $data['data']['Course']['self_enroll'] = "off";
>
> for( $i=1; $i<=$data['data']['Course']['count']; $i++ ){
> $data['data']['Course']['instructor_id'.$i] = 
> isset($data['form']
> ['instructor_id'.$i])? $data['form']['instructor_id'.$i] : '';
> }
>
> return $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: Question about model

2007-05-22 Thread Ming

Many duplicates,

Google group did not work properly


--~--~-~--~~~---~--~~
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: Question about model

2007-05-22 Thread Ming

Where does $data come from?

On May 22, 3:22 pm, Ming <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> Could you please help me understand codes below? It is in a model
> named Course
>
> Many thanks,
>
> function prepData($data=null){
>   if (empty($data['data']['Course']['record_status'])) {
> $data['data']['Course']['record_status'] = $data['form']
> ['record_status'];
> }
>
> if( !empty($data['form']['self_enroll']))
> $data['data']['Course']['self_enroll'] = "on";
> else
> $data['data']['Course']['self_enroll'] = "off";
>
> for( $i=1; $i<=$data['data']['Course']['count']; $i++ ){
> $data['data']['Course']['instructor_id'.$i] = 
> isset($data['form']
> ['instructor_id'.$i])? $data['form']['instructor_id'.$i] : '';
> }
>
> return $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
-~--~~~~--~~--~--~---



Question about model

2007-05-22 Thread Ming

Hi folks,

Could you please help me understand codes below? It is in a model
named Course

Many thanks,


function prepData($data=null){
  if (empty($data['data']['Course']['record_status'])) {
$data['data']['Course']['record_status'] = $data['form']
['record_status'];
}


if( !empty($data['form']['self_enroll']))
$data['data']['Course']['self_enroll'] = "on";
else
$data['data']['Course']['self_enroll'] = "off";

for( $i=1; $i<=$data['data']['Course']['count']; $i++ ){
$data['data']['Course']['instructor_id'.$i] = 
isset($data['form']
['instructor_id'.$i])? $data['form']['instructor_id'.$i] : '';
}

return $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: Show a Page without a Model in cakePHP

2007-05-16 Thread Ming

It is exactly my question (newbie to cake, too :) )

My application involves lots of communication with a remote server via
xml, just occasional local db operations.

On May 16, 8:20 pm, MarsDev <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I am a newbie to cakePHP and the model-view-controller pattern. But
> according to the books, it seems that every page cakePHP generated has
> to be associated with a controller, a view and a model. Since the
> cakePHP URL pattern is such that "/controller/action/params", it's
> natural to have each page associated with a controller, the action and
> its view. While it works quite well for most cases, I am having a
> difficult time trying to figure out how should I code in order to show
> something like a homepage, which only shows a aggregated view of the
> stuff that are generated from other controllers. That said, home page
> doesn't have any specific model associations. I.E.
>
> http://www.example.com/home/index
>
> I know that index can be omitted. I have HomeController and the index
> action defined, so is the view for index action.  But then if I type
> in that URL in my sandbox, It asks me for the home model ??!! I don't
> really have one. All I have are all concrete models like "Customer",
> "Orders" among others. Is there work-arounds?
>
> Also what's the best way to pull all the contents that are generated
> from other controller/actions and aggregate them into one page?
>
> Anyone can help me better understand the cakePHP or MVC pattern in
> general will be highly appreciated!
>
> Thanks!
>
> -Ye


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



A quick question model

2007-05-14 Thread Ming

Hi,

I am a newbie to cake. I just read cake's manual and have a quick
question:

class User extends AppModel
{
// Its always good practice to include this variable.
var $name = 'User';

what does this $name mean? is it mandatory? Can I name it something
else? If I do not have this variable, how shall I make a reference to
this mode in future?

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



Beginner's question, about model

2007-05-10 Thread Ming

Hi there,

I am new to cake and I have several questions. :)

>From the blog tutorial:
1)

. Does ['Post'] here refer to the $name var?

2) In the controller, I have $this->set('posts',$this->Post-
>findAll());

Where does this 'posts' come from? Does the Post in $this->Post refer
to the data model named Post or the var $name with name Post?

3)

In view, I have 

The question is the same, does the Post here refer to the data model
named Post or the var $name with name Post?

Thanks a lot

Ming


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