Re: Child model fields

2007-12-31 Thread soytuny

> $this->create();

I think, and I've had a bit to drink, should be $this->Game->Score-
>create();

DaveM wrote:
> Hi all,
>
> I am trying to build a page that uses a parent model (Game) and child
> models (Score).  Game has the following fields:  id, game_number, and
> date.  Score has the following fields:  player_id, player_finish,
> player_points, and game_id.  In my scenario, there should always be 10
> Score(s) per Game.  I'd like to have the player_id, player_finish, and
> player_points rendered on the page when the "Add New Game" link is
> clicked.  I've defined my Score fields as follows:
>
> 
> 1
> input('Score/player_id', array('size' => '4'))?
> >
> input('Score/player_points', array('size' =>
> '4','value' => $valueOne))?>
> hidden('Score/player_finish', array('value' =>
> '1')); ?>
> 
> 
> 2
> input('Score/player_id', array('size' => '4'))?
> >
> input('Score/player_points', array('size' =>
> '4','value' => $valueTwo))?>
> hidden('Score/player_finish', array('value' =>
> '2')); ?>
> 
>
> I don't think this is correct.  In the save, the Game array ($this-
> >data['Game']) does not contain ANY of the score domains.  The last
> Score model defined on my view is being saved.  The manual says:
>
> These same basic techniques will work if you're saving multiple child
> models, just place those save() calls in a loop (and remember to clear
> the model information using Model::create()).
>
> I tried this code thinking it would save two Score models, but it
> simply inserts one record and then updates the same record:
>
> $gameID = $this->Game->getLastInsertId();
> $this->data['Score']['game_id'] = $gameID;
> $this->Game->Score->save($this->data);
>
> $this->create();
>
> $gameID = $this->Game->getLastInsertId();
> $this->data['Score']['game_id'] = $gameID;
> $this->Game->Score->save($this->data);
>
> I'm stuck.  Any thoughts would be awesome.
--~--~-~--~~~---~--~~
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: Cake with MySQL 5, PHP5 and PHP suexec?

2007-12-31 Thread Gwoo

This is related to the cli version not being compiled with mysql
support. There are a few other posts on this group. Have a search and
see what you can come up with. Normally, people encounter this problem
with Bake.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



include a login form in the header - viewed on all pages

2007-12-31 Thread matches

Hello all,

I want to include my login controller in my header so that it is
accessible on all pages. I have followed the IBM tutorial to get my
login controller working. If I take the code straight out of the views/
users/login.thtml file then I get an error on every page except for
the login view. Which I expected but I still can't figure out how to
get this to work.

Hope I am being clear enough. 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
-~--~~~~--~~--~--~---



Child model fields

2007-12-31 Thread DaveM

Hi all,

I am trying to build a page that uses a parent model (Game) and child
models (Score).  Game has the following fields:  id, game_number, and
date.  Score has the following fields:  player_id, player_finish,
player_points, and game_id.  In my scenario, there should always be 10
Score(s) per Game.  I'd like to have the player_id, player_finish, and
player_points rendered on the page when the "Add New Game" link is
clicked.  I've defined my Score fields as follows:


1
input('Score/player_id', array('size' => '4'))?
>
input('Score/player_points', array('size' =>
'4','value' => $valueOne))?>
hidden('Score/player_finish', array('value' =>
'1')); ?>


2
input('Score/player_id', array('size' => '4'))?
>
input('Score/player_points', array('size' =>
'4','value' => $valueTwo))?>
hidden('Score/player_finish', array('value' =>
'2')); ?>


I don't think this is correct.  In the save, the Game array ($this-
>data['Game']) does not contain ANY of the score domains.  The last
Score model defined on my view is being saved.  The manual says:

These same basic techniques will work if you're saving multiple child
models, just place those save() calls in a loop (and remember to clear
the model information using Model::create()).

I tried this code thinking it would save two Score models, but it
simply inserts one record and then updates the same record:

$gameID = $this->Game->getLastInsertId();
$this->data['Score']['game_id'] = $gameID;
$this->Game->Score->save($this->data);

$this->create();

$gameID = $this->Game->getLastInsertId();
$this->data['Score']['game_id'] = $gameID;
$this->Game->Score->save($this->data);

I'm stuck.  Any thoughts would be awesome.

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



include a login form in the header - viewed on all pages

2007-12-31 Thread matches

Hello all,

I want to include my login controller in my header so that it is
accessible on all pages. I have followed the IBM tutorial to get my
login controller working. If I take the code straight out of the views/
users/login.thtml file then I get an error on every page except for
the login view. Which I expected but I still can't figure out how to
get this to work.

Hope I am being clear enough. 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
-~--~~~~--~~--~--~---



How to limit the fields while using paginate?

2007-12-31 Thread Harsh

Model A which has a two belongTo relationships with Model B.
When I use paginate on Model A, Cake generates a huge query which
joins and queries all the fields in Model A and Model B.
All I want is a couple fields from each Model (table).
I have looked around for a way to limit the fields, but haven't had
any success yet.
This seems like a common problem.  Has anyone run into this and
successfully solved this problem?
Any help would be appreciated!
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: Fairly simple beforeSave() question

2007-12-31 Thread Pablo Viojo
The cleanUpFields is the responsible of the date appearing as -- when you
are not setting a date. Normally it will construct something like 2007-12-31
(if today selected). I think you're using cake 1.1, so see [1], line 865,
for the source code of then Controller::cleanUpFields source code.

Regards,

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

[1] http://api.cakephp.org/controller_8php-source.html#l00859

--~--~-~--~~~---~--~~
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: $this->User->save() skips validation?

2007-12-31 Thread Flan

Hello,

If had a similar problem using 1.2.It turns out $data['User']
['password'] is hashed when it comes to the USer controller and so has
40 or so characters independent of how many characters there are in
the unhashed version so it is always verified.

Adrian

On Dec 31, 1:40 am, webjay <[EMAIL PROTECTED]> wrote:
> I get a password from a form and saves it in the database. No problem
> there.
> My problem is that I want validation to happen. I.e to check that the
> username is 6 or more chars.
>
> _snippet from model_
> var $validate = array(
> 'email' => VALID_EMAIL,
> 'username' => array(
> 'rule' => array(
> 'custom', '/^[0-9a-z\.\-\_\+]+$/i'
> ),
> 'message' => 'Invalid username syntax'
> ),
> 'password' => array(VALID_NOT_EMPTY, array('rule' =>
> array('minLength', 6))),
> 'passwd' => array(VALID_NOT_EMPTY, array('rule' =>
> array('minLength', 6)))
> );
>
> _snippet from controller_
> $password = $sanitize->escape($this->data['User']['password']);
> $this->User->id = $this->Session->read('userid');
> $this->User->password = $password;
> $this->User->save();
>
> /Jacob
--~--~-~--~~~---~--~~
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: Fatal error: ConnectionManager::getDataSource - Non-existent data source

2007-12-31 Thread Eng.Ahmed El.Hussaini

Sorry guys my mistake, yes I've an error in my controller and that
error is the source of my problem.

$users = User::findAll(); //wrong

$users = $this->User->findAll(); //correct

apparently I was writing symfony code in cakephp.
thanks anyway

On Dec 31, 6:13 pm, nate <[EMAIL PROTECTED]> wrote:
> There's an issue with your syntax.  Try:
>
> $users = $this->User->findAll();
>
> On Dec 31, 9:13 am, "Eng.Ahmed El.Hussaini"
>
> <[EMAIL PROTECTED]> wrote:
> > Conside the following:
>
> > Controller
> > ===
> > class UserController extends AppController {
> >function index() {
> >   $users = User::findAll();
> >}
>
> > }
>
> > Model
> > =
>
> > class User extends AppModel {
> >var $name = 'User';
>
> > }
>
> > when requesting the following urlhttp://localhost/cake/user
>
> > I get the below error.
>
> > Notice: Undefined property: UsersController::$useDbConfig in C:
> > \Program Files\Apache Software Foundation\Apache2.2\htdocs\savvy\cake
> > \libs\model\model_php5.php on line 1145
>
> > Fatal error: ConnectionManager::getDataSource - Non-existent data
> > source in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs
> > \savvy\cake\libs\model\connection_manager.php on line 110

--~--~-~--~~~---~--~~
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: Require SSL for entire site?

2007-12-31 Thread Robby Anderson


In 1.2 at least (and quickly checking the 1.1 API, it is indeed a 1.2
only feature), you can use the Security component's requireSecure()
method to list controller methods that must be using SSL, and then use
the blackHoleCallback property to set a method to call if the
requireSecure() fails.

function beforeFilter() {

  // We could list specific methods instead by
  // passing an array of the desired method names
  $this->Security->requireSecure();

  // If requireSecure() fails, call $this->_blackHole()
  $this->Security->blackHoleCallback = '_blackHole';
}


I'm still trying to find a way to make the various link() and url()
functions all explicitly https (with the full path) to correspond with
using the requireSecure() method.

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



Cake with MySQL 5, PHP5 and PHP suexec?

2007-12-31 Thread Jill Elaine

Hello All,
I have cakePHP 1.1.18.5850 on a shared Unix server, with MySQL5,
PHP5.2.4, and PHP running as CGI (PHP suexec), as opposed to it
running under Apache.

I installed cake, created a database, configured it to connect to the
database, and my cake 'home' page says it works properly:
CakePHP Rapid Development
Your database configuration file is present.
Cake is able to connect to the database.

I read the manual and did the blog tutorial: 
http://manual.cakephp.org/appendix/blog_tutorial
All works okay there: I am able to view, add, edit and delete blog
entries.

Now I want to use ACLs: I read the directions here, 
http://manual.cakephp.org/chapter/acl,
and other places on the net about how to use cake's acl.php at the
command line. But unfortunately, I cannot get it to work. I receive
this error:
Warning: mysql_connect(): Can't connect to local MySQL server through
socket '/var/lib/mysql/mysql.sock'

I am puzzled that I can connect to the database via cake web displays,
but not at the command line?

Does anyone have any suggestions? Has anyone any experience with
cakePHP and phpsuexec? I am wondering if it will work at all?

Thank you for your help,
Jill Elaine

--~--~-~--~~~---~--~~
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: Require SSL for entire site?

2007-12-31 Thread Christian Winther

HTTPS 
Will contain the text "on" if the connection is using SSL/TLS, or "off" 
otherwise. (This variable can be safely used regardless of whether or not 
mod_ssl is loaded).

-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Chris 
Hartjes
Sent: 31. december 2007 17:49
To: cake-php@googlegroups.com
Subject: Re: Require SSL for entire site?


On Dec 31, 2007 11:39 AM, Bryan Encina <[EMAIL PROTECTED]> wrote:
>
> Is there anything within the cakephp framework to insure viewers are
> using https vs normal http?  What would be the best way of
> implementing this?  Would modifying the app_controller class with a
> check for $_SERVER['HTTPS'] and then redirecting based on that be the
> best solution?
>

Well, if you did want to do that sort of thing you could put it in a
beforeFilter() method in app_controller, but can you really trust the
contents of $_SERVER['HTTPS'] to be correct?  If I understand
correctly, that info can be spoofed along with lots of other $_SERVER
values.

Also, can't you limit access to stuff via the web server itself?  I
may be ignorant about setting up https in Apache, but it seems to
make sense that you could say 'https uses code sitting over here while
http uses stuff over there'.

-- 
Chris Hartjes

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

@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: Require SSL for entire site?

2007-12-31 Thread Christian Winther

Hello,
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

check the "RewriteCond Directive" 

SERVER_PORT (port 80 = non ssl, port 443 = ssl)
SERVER_PROTOCOL (http = non ssl, https = ssl)

Or just the

HTTPS variable too :]

/Jippi

-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Chris 
Hartjes
Sent: 31. december 2007 17:49
To: cake-php@googlegroups.com
Subject: Re: Require SSL for entire site?


On Dec 31, 2007 11:39 AM, Bryan Encina <[EMAIL PROTECTED]> wrote:
>
> Is there anything within the cakephp framework to insure viewers are
> using https vs normal http?  What would be the best way of
> implementing this?  Would modifying the app_controller class with a
> check for $_SERVER['HTTPS'] and then redirecting based on that be the
> best solution?
>

Well, if you did want to do that sort of thing you could put it in a
beforeFilter() method in app_controller, but can you really trust the
contents of $_SERVER['HTTPS'] to be correct?  If I understand
correctly, that info can be spoofed along with lots of other $_SERVER
values.

Also, can't you limit access to stuff via the web server itself?  I
may be ignorant about setting up https in Apache, but it seems to
make sense that you could say 'https uses code sitting over here while
http uses stuff over there'.

-- 
Chris Hartjes

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

@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: Require SSL for entire site?

2007-12-31 Thread Chris Hartjes

On Dec 31, 2007 11:39 AM, Bryan Encina <[EMAIL PROTECTED]> wrote:
>
> Is there anything within the cakephp framework to insure viewers are
> using https vs normal http?  What would be the best way of
> implementing this?  Would modifying the app_controller class with a
> check for $_SERVER['HTTPS'] and then redirecting based on that be the
> best solution?
>

Well, if you did want to do that sort of thing you could put it in a
beforeFilter() method in app_controller, but can you really trust the
contents of $_SERVER['HTTPS'] to be correct?  If I understand
correctly, that info can be spoofed along with lots of other $_SERVER
values.

Also, can't you limit access to stuff via the web server itself?  I
may be ignorant about setting up https in Apache, but it seems to
make sense that you could say 'https uses code sitting over here while
http uses stuff over there'.

-- 
Chris Hartjes

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

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



Require SSL for entire site?

2007-12-31 Thread Bryan Encina

Is there anything within the cakephp framework to insure viewers are
using https vs normal http?  What would be the best way of
implementing this?  Would modifying the app_controller class with a
check for $_SERVER['HTTPS'] and then redirecting based on that be the
best solution?

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: Fairly simple beforeSave() question

2007-12-31 Thread Jamie

Here is the part of the form that deals with the obtained_date.  Yes,
it is confusing as to why it would pass any value at all when the user
doesn't specify a date in the form.  However, with the use of the
beforeSave() function, I have been able to unset the value.


labelTag('Skater/obtained_date', 'Obtained Date');?
>
dateTimeOptionTag('Skater/obtained_date', 'MDY' ,
'NONE', $html->tagValue('Skater/obtained_date'), array());?>
tagErrorMsg('Skater/obtained_date', 'Please select
the Obtained Date.');?>




On Dec 31, 10:43 am, Robby Anderson <[EMAIL PROTECTED]> wrote:
> What does your form look like? Chances are the form isn't passing a
> null value to the controller - its got some other value ('--')
> instead.

--~--~-~--~~~---~--~~
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: Fairly simple beforeSave() question

2007-12-31 Thread Baz
What version of CakePHP are you using?

What does the edit.ctp/edit.thml look like?


On Dec 31, 2007 9:43 AM, Robby Anderson <[EMAIL PROTECTED]> wrote:

>
>
> What does your form look like? Chances are the form isn't passing a
> null value to the controller - its got some other value ('--')
> instead.
>
>
> >
>

--~--~-~--~~~---~--~~
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: Fatal error: ConnectionManager::getDataSource - Non-existent data source

2007-12-31 Thread nate

There's an issue with your syntax.  Try:

$users = $this->User->findAll();


On Dec 31, 9:13 am, "Eng.Ahmed El.Hussaini"
<[EMAIL PROTECTED]> wrote:
> Conside the following:
>
> Controller
> ===
> class UserController extends AppController {
>    function index() {
>       $users = User::findAll();
>    }
>
> }
>
> Model
> =
>
> class User extends AppModel {
>    var $name = 'User';
>
> }
>
> when requesting the following urlhttp://localhost/cake/user
>
> I get the below error.
>
> Notice: Undefined property: UsersController::$useDbConfig in C:
> \Program Files\Apache Software Foundation\Apache2.2\htdocs\savvy\cake
> \libs\model\model_php5.php on line 1145
>
> Fatal error: ConnectionManager::getDataSource - Non-existent data
> source in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs
> \savvy\cake\libs\model\connection_manager.php on line 110
--~--~-~--~~~---~--~~
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: Fairly simple beforeSave() question

2007-12-31 Thread Robby Anderson


What does your form look like? Chances are the form isn't passing a
null value to the controller - its got some other value ('--')
instead.


--~--~-~--~~~---~--~~
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: Cake 1.1.X Model table name problem

2007-12-31 Thread AD7six



On Dec 31, 1:52 pm, Maken <[EMAIL PROTECTED]> wrote:
> i m a novice in cakephp
> i make a model with the name of lead
>
> class Lead extends AppModel
> {
> var $name = 'Lead';
> var $useTable = 'leads';/// changing to "abc" table works fine
>
> }
>
> and maken the controller like thaht
>
> class LeadsController extends AppController
> {
> var $name = 'Leads';
>
> var $uses = array("Lead");
> var $helpers = array('html','javascript');
>
> function index() {
>
> }
>
> }
>
> add made a view file index.thtml to output some dummy info
>
> when i run the file the flowing erreor accor
>
> Notice: Undefined variable: javascript in pathtoinstalliaction  \app
> \views\layouts\default.thtml on line 9

If you use the javascript helper in your layout, you need to ensure
it's always available. by putting it in your app controller helpers
array ( or wrapping it's use in if (isset($javascript)) { ... } )

Then you'll see a cake-error message. Probably table doesn't exist.

hth,

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



Re: Fatal error: ConnectionManager::getDataSource - Non-existent data source

2007-12-31 Thread AD7six



On Dec 31, 3:13 pm, "Eng.Ahmed El.Hussaini"
<[EMAIL PROTECTED]> wrote:
> Conside the following:
>
> Controller
> ===
> class UserController extends AppController {
>function index() {
>   $users = User::findAll();
>}
>
> }
>

The above code isn't how cake works. try the blog tutorial for your
first steps.

hth,

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



Fatal error: ConnectionManager::getDataSource - Non-existent data source

2007-12-31 Thread Eng.Ahmed El.Hussaini

Conside the following:

Controller
===
class UserController extends AppController {
   function index() {
  $users = User::findAll();
   }
}

Model
=

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

when requesting the following url
http://localhost/cake/user

I get the below error.

Notice: Undefined property: UsersController::$useDbConfig in C:
\Program Files\Apache Software Foundation\Apache2.2\htdocs\savvy\cake
\libs\model\model_php5.php on line 1145

Fatal error: ConnectionManager::getDataSource - Non-existent data
source in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs
\savvy\cake\libs\model\connection_manager.php on line 110

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



Cake 1.1.X Model table name problem

2007-12-31 Thread Maken

i m a novice in cakephp
i make a model with the name of lead

class Lead extends AppModel
{
var $name = 'Lead';
var $useTable = 'leads';/// changing to "abc" table works fine
}

and maken the controller like thaht


class LeadsController extends AppController
{
var $name = 'Leads';

var $uses = array("Lead");
var $helpers = array('html','javascript');


function index() {

}
}

add made a view file index.thtml to output some dummy info

when i run the file the flowing erreor accor

Notice: Undefined variable: javascript in pathtoinstalliaction  \app
\views\layouts\default.thtml on line 9

Fatal error: Call to a member function link() on a non-object in
pathtoinstalliaction \app\views\layouts\default.thtml on line 9

i put the some other table name in $useTable var  and it works fine

but when i put leads in table name is gives me about error


is this error is due to TABLE structure (which i think so)
or something else

what should i do ??/

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



How to use equalTo() validation?

2007-12-31 Thread aranworld

I was under the impression that the equalTo() validation was going to
be used to verify that two submitted form fields were equal to each
other.

But looking at this ticket:

https://trac.cakephp.org/ticket/3594

It appears as if this is NOT what the equalTo() rule is all about.  It
is instead just a way to verify that a submitted form field is equalTo
a hard-coded value (whatever string value that is placed in the
$validate array).

Anyone have any idea what a sample use case would be for a rule that
just verifies that a submitted value is equal to a fixed value?

Or is there a way to use this function to verify that two fields are
equal to each other?

--~--~-~--~~~---~--~~
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 my httpd.conf

2007-12-31 Thread matches

That did it. Thanks!

On Dec 30, 9:46 pm, "jenson" <[EMAIL PROTECTED]> wrote:
> Yes ,
>You have to restart Xampp serives
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.

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