Re: How do I set model date before save?

2007-10-15 Thread thun

$this->data['TableName']['date'] = date();

date() expects at least 1 parameter,


But this worked great...

$this->data['TableName']['date''] = date("Y-m-d H:i:s");



--~--~-~--~~~---~--~~
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: Issue on IIS

2007-10-15 Thread Gwoo

what version of cake are you using?


--~--~-~--~~~---~--~~
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: Edit form is inserting rather than updating (V 1.2)

2007-10-15 Thread shanlalit

Update your cake to the latest commit from 1.2 branch.


On Oct 16, 9:49 am, Adwin  Wijaya <[EMAIL PROTECTED]> wrote:
> Hi,
> just add an id (your surrogate / primary key) as hidden field if you
> want to do editing. may be the cakephp will check if there is no Id
> then it will do the inserting instead of updating ... :)
>
> -
> adwin
> wysmedia.com
> kompani.net
> --
>
> On Oct 16, 11:08 am, Aroha <[EMAIL PROTECTED]> wrote:
>
> > I am on version 1.2 the alpha build. I am attempting to edit a post.
> > My form is as follows:
>
> >  > echo $form->create('Post', array('action' => 'edit'));
> > echo $form->input('title', array('label' => 'Title', 'size' => '30'));
> > echo $form->input('body', array('label' => 'Post', 'rows' =>
> > '10','cols' => '40'));
> > echo $form->submit('Update');
> > echo $form->end();
> > ?>
>
> > If I dont add "array('action' => 'edit')" in create and I looked at
> > the source the action was add. However, when I submit this form, the
> > SQL that is generated is:
>
> > INSERT INTO `posts` (`title`,`body`,`created`,`modified`) VALUES
> > ('This is the title','This is the body','2007-10-16
> > 12:59:43','2007-10-16 12:59:43')
>
> > Any suggestions, on how to get this form to update rather than insert?
> > Perhaps, I need a hidden id variable somewhere?


--~--~-~--~~~---~--~~
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: Issue on IIS

2007-10-15 Thread DouglasPhillips

On Oct 12, 1:21 pm, patcoll <[EMAIL PROTECTED]> wrote:
> I'm having some problems with simple page dispatching on IIS. After
> circumventing the BASE_URL routing, which doesn't work on this IIS
> (the following gives a 404):
(snip)
> Anyone have similar issues to these before?

Just as a curiosity, how do you have IIS set up?  I just set up an
environment using the FastCGI module (Technical preview from iis.net),
PHP-5.2.3, IIS7/Vista, and Cake).  Pointing the DocumentRoot at cake's
app\webroot directory worked like a charm using the /index.php?
url=controller/view routing.


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



internalerror.html on Dreamhost

2007-10-15 Thread Matt

I just baked up an app in  v1.2 on dreamhosts servers. After I add one
record and then go to the index or edit actions I get:

The requested address internalerror.html was not found on this server.


The add action continues to work. I did find
http://cakebaker.42dh.com/2007/07/18/premature-end-of-script-headers-with-baked-views/
 and
http://groups.google.ca/group/cake-php/browse_thread/thread/6cb40741c99d217f/7363e0c3c7d70b51?hl=en&lnk=st&;

 but still haven't had any luck.

>From what I've read it is a problem with the Zend Optimizer v3.2.2 but
unfortunately this doesn't help me much.

In the dreamhost logs I get "Premature end of script headers:
php5.cgi"

Does any one out there that knows of a fix for use on dreamhosts
servers?

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: Edit form is inserting rather than updating (V 1.2)

2007-10-15 Thread Adwin Wijaya

Hi,
just add an id (your surrogate / primary key) as hidden field if you
want to do editing. may be the cakephp will check if there is no Id
then it will do the inserting instead of updating ... :)

-
adwin
wysmedia.com
kompani.net
--

On Oct 16, 11:08 am, Aroha <[EMAIL PROTECTED]> wrote:
> I am on version 1.2 the alpha build. I am attempting to edit a post.
> My form is as follows:
>
>  echo $form->create('Post', array('action' => 'edit'));
> echo $form->input('title', array('label' => 'Title', 'size' => '30'));
> echo $form->input('body', array('label' => 'Post', 'rows' =>
> '10','cols' => '40'));
> echo $form->submit('Update');
> echo $form->end();
> ?>
>
> If I dont add "array('action' => 'edit')" in create and I looked at
> the source the action was add. However, when I submit this form, the
> SQL that is generated is:
>
> INSERT INTO `posts` (`title`,`body`,`created`,`modified`) VALUES
> ('This is the title','This is the body','2007-10-16
> 12:59:43','2007-10-16 12:59:43')
>
> Any suggestions, on how to get this form to update rather than insert?
> Perhaps, I need a hidden id variable somewhere?


--~--~-~--~~~---~--~~
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 set model date before save?

2007-10-15 Thread Adwin Wijaya

should be placed in the data

$this->data['TableName']['date'] = date();

cmiiw .. :)

not yet tested

adwin
wysmedia.com
kompani.net


On Oct 16, 10:12 am, thun <[EMAIL PROTECTED]> wrote:
> How can I set the current datetime into a model database field right
> before save?
>
> $this->Blah->date = now()?;
> $this->Blah->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: "Missing Action / Controller / View" doesn't see JavascriptHelper?

2007-10-15 Thread George @ Dogma

Actually, sorry I had found out how to do it!

I just added the line:
var $helpers = array("Html", "Form", "Javascript", "Ajax");

to my app_controller.php file and it's working fine.

Sorry for wasting resources!

On Oct 16, 2:25 pm, "George @ Dogma" <[EMAIL PROTECTED]> wrote:
> Hey everyone,
>
> I think I have broken my CakePHP application that I am making... As
> you all very well know, CakePHP throws error messages when it comes
> across a missing action, controller, view, etc.  However, I have done
> something to my default.thtml file and now this does not function.
>
> If I was to go to a URL within my project, eg.www.example.com/fdjgddf
> instead ofwww.example.com/login(fdjgddf isn't an action or a
> controller), I am faced with the following:
>
> Fatal error: Call to a member function on a non-object in /app/views/
> layouts/default.thtml on line 5
>
> Line 5 in my default.thtml file is:
> link('prototype'); ?>
>
> It seems that it's not loading up the JavascriptHelper for some
> reason.  It seems to load HtmlHelper fine.  Mind you, when an actual
> controller / action has been referenced (eg.www.example.com/login),
> everything loads fine, including JavascriptHelper -- this only happens
> when there's a missing controller / action / view.
>
> Is there a way to fix 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
-~--~~~~--~~--~--~---



"Missing Action / Controller / View" doesn't see JavascriptHelper?

2007-10-15 Thread George @ Dogma

Hey everyone,

I think I have broken my CakePHP application that I am making... As
you all very well know, CakePHP throws error messages when it comes
across a missing action, controller, view, etc.  However, I have done
something to my default.thtml file and now this does not function.

If I was to go to a URL within my project, eg. www.example.com/fdjgddf
instead of www.example.com/login (fdjgddf isn't an action or a
controller), I am faced with the following:

Fatal error: Call to a member function on a non-object in /app/views/
layouts/default.thtml on line 5

Line 5 in my default.thtml file is:
link('prototype'); ?>

It seems that it's not loading up the JavascriptHelper for some
reason.  It seems to load HtmlHelper fine.  Mind you, when an actual
controller / action has been referenced (eg. www.example.com/login),
everything loads fine, including JavascriptHelper -- this only happens
when there's a missing controller / action / view.

Is there a way to fix 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
-~--~~~~--~~--~--~---



Edit form is inserting rather than updating (V 1.2)

2007-10-15 Thread Aroha

I am on version 1.2 the alpha build. I am attempting to edit a post.
My form is as follows:

create('Post', array('action' => 'edit'));
echo $form->input('title', array('label' => 'Title', 'size' => '30'));
echo $form->input('body', array('label' => 'Post', 'rows' =>
'10','cols' => '40'));
echo $form->submit('Update');
echo $form->end();
?>

If I dont add "array('action' => 'edit')" in create and I looked at
the source the action was add. However, when I submit this form, the
SQL that is generated is:

INSERT INTO `posts` (`title`,`body`,`created`,`modified`) VALUES
('This is the title','This is the body','2007-10-16
12:59:43','2007-10-16 12:59:43')

Any suggestions, on how to get this form to update rather than insert?
Perhaps, I need a hidden id variable somewhere?


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



paginate base on parameter

2007-10-15 Thread Adwin Wijaya

Hello

i have table like this:

users :
id,
name
email,
etc

orders :
id
user_id
orderdate,
senddate,
etc


orderDetails:
id,
order_id
item_id
qty
price
total
etc,


and items:
id
nameofitem

user has many orders,
each orders has many ordersDetails
orderDetails has many items


I was asked to make pagination so that the user can view their orders.
and the orders will be displayed by date (so the pagination function
should be able to separate by date).

can we do that using pagination() function with cakephp ?

can someone give me example on how to make paginate() methods on the
models.

thank you ...


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



Re: generateList from seperate table, having problems.

2007-10-15 Thread dardosordi

$uses, no $users

Things_Controller extends App_Controller
{
var $uses = array('Users', 'Lessons');

function something()
{
   $this->Users->...
}

}

On Oct 12, 2:55 pm, EVan <[EMAIL PROTECTED]> wrote:
> I've tried just doing that but I get the error: Undefined property:
> LessonsController::$User
> I expected that to result in an error because I'm writing this code in
> the lessons_controller not the users_controller.
>
> Here's the complete function that I'm trying to add to the
> controller...
>
> function add() {
>
> $this->set('authorArray', $this->User->generateList(null, null, null,
> '{n}.User.user_id', '{n}.User.username'));
>
> if (!empty($this->data)) {
>
> if ($this->Lesson->save($this->data)) {
> $this->flash('Your post has been 
> saved.','/lessons/titlebrowse');
> }
> }
>
> }
>
> I don't understand what you meant by adding "$users = array('Lessons',
> 'Users');" and no... I don't have that in my controller anywhere.
>
> ?
>
> On Oct 12, 12:33 pm, Chambrln <[EMAIL PROTECTED]> wrote:
>
> > If you want a list of all authors, not just authors associated to that
> > lesson use:
> > $this->User->generateList(..); (fill in with what you had)
>
> > I'm assuming your controller has $uses = arra('Lessons', 'Users');  or
> > similar...
>
> > On Oct 12, 8:04 am, EVan <[EMAIL PROTECTED]> wrote:
>
> > > My application has two tables: Lessons, Users.  Users hasMany Lessons
> > > and Lessons belongsTo Users.
>
> > > I'm trying to make a selectTag menu but I'm having problems getting
> > > the generateList function to work... here's the code I'm using within
> > > the lessons_controller.
>
> > > $this->set('authorArray', $this->Lesson->User->generateList(null,
> > > null, null, '{n}.User.user_id', '{n}.User.username'));
>
> > > Rather than returning the entire array of usernames, which I want, the
> > > selectTag menu only has one option.
>
> > > I know the code I'm using in the view is functional because I've made
> > > a number of selectTag menus using fields within the Lessons table, but
> > > I'm baffled as to how to extract an entire column from the Users table
> > > in order to generate a list.
>
> > > I would like to have the controller do this without having to change
> > > the model relationships to a hadAndBelongsToMany type.   Any advice?- 
> > > Hide quoted text -
>
> > - Show quoted text -


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



Re: How to paginate HABTM results?????????

2007-10-15 Thread DGPhoebus

Sorry for leaving that part out. the Cake version is 1.2.  Thanks
guys.

On Oct 15, 7:08 pm, rtconner <[EMAIL PROTECTED]> wrote:
> What version of cake?
>
> Nate left this code for 1.2:http://bin.cakephp.org/saved/21687


--~--~-~--~~~---~--~~
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 do I set model date before save?

2007-10-15 Thread thun

How can I set the current datetime into a model database field right
before save?

$this->Blah->date = now()?;
$this->Blah->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: inflections.php memory issue

2007-10-15 Thread dardosordi

Edit the memory limit in the php configuration file ( php.ini ), and
watch out the associations being pulled from database when using
"recursive" in your model.

On Oct 15, 2:58 pm, regent <[EMAIL PROTECTED]> wrote:
> I get the following error when processing a large amount of data:
>
> Fatal error: Allowed memory size of 536870912 bytes exhausted (tried
> to allocate 8192 bytes) in C:\PATH\app\config\inflections.php on line
> 1
>
> How do I avoid this error?  Processing less data is not an option.


--~--~-~--~~~---~--~~
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: Emitting a PNG

2007-10-15 Thread bujanga

Hmm, my view source is


Don't know where your ###s came from. Maybe consider AD's suggestion
to review your image code.

Using CakePHP 1.2.0.5427alpha. No ajax or special routing. Notice that
I am generating jpg vs your png though don't see how that would
matter.

Gary


On 10/15/07, MikeK <[EMAIL PROTECTED]> wrote:
>
> Gary I tried the same code and it just doesn't work for me  -- I'm
> using the alpha 1.2 code.
>
> The action similar to /users/captcha if directly invoked puts the
> image right on the screen no problem.
>
> If invoked from another view the way you have with the html 
> syntax it just gives me a blanked X image whose path is the path to
> the action.
>
> When I view the source of the emitted page I get -  where the #s are what gets rendered
> into the image.
>
> Are you using ajax or doing something with routes I need to enable
> perhaps?
>
>
> >
>

--~--~-~--~~~---~--~~
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 Router,Friendly URL.

2007-10-15 Thread Zoltan

I'm having the same kind of problem. Still haven't found the answer


On Sep 29, 8:12 am, TGG008 <[EMAIL PROTECTED]> wrote:
> Hi,everyone! I've been involed in this problem days...
> in my routes.php I defined :Router::connect('/google/:id/*', 
> array('controller' => 'users',
> 'action' => 'view'));
>
> when browse /google/123[any number]
> it display the page of 'controller' => 'users', 'action' => 'index'
> -
> while using:
> $a=Router::url(array('controller'=>'users', 'action'=>'view',
> 'id'=>100));
> I can get:
> /google/100
>
> ///
> I know using:Router::connectNamed(array('id'));
> andRouter:Router::connect('/google/*', array('controller' => 'users', 'action'
> => 'view'));
>
> this time :
> using:
> $a=Router::url(array('controller'=>'users', 'action'=>'view',
> 'id'=>100));
> I can get:
> /google/id:100
> and when browse the url : /google/id:100
> it's correct.
> /
> So. How Can I get url like/google/100
> and display the right action ..
>
> 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: Emitting a PNG

2007-10-15 Thread MikeK

Gary I tried the same code and it just doesn't work for me  -- I'm
using the alpha 1.2 code.

The action similar to /users/captcha if directly invoked puts the
image right on the screen no problem.

If invoked from another view the way you have with the html 
syntax it just gives me a blanked X image whose path is the path to
the action.

When I view the source of the emitted page I get -  where the #s are what gets rendered
into the image.

Are you using ajax or doing something with routes I need to enable
perhaps?


--~--~-~--~~~---~--~~
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: Dedicated server: which Linux distribution?

2007-10-15 Thread dardosordi

I'm on Debian.

On Oct 13, 9:38 am, Sliv <[EMAIL PROTECTED]> wrote:
> Out of those 3 choices, I would also recommend Debian.  If CentOS is
> an option, I would recommend CentOS.  I recently changed over to
> CentOS on my dev server and have been pleased so far.  I did this
> after scouring various forums on the web and finding that CentOS was a
> pretty popular choice for LAMP setups.
>
> On Oct 10, 11:55 am, cakeFreak <[EMAIL PROTECTED]> wrote:
>
> > I know it is a bit out of the main topic of this forum,
> > but CakeBakers know the job!
>
> > Well I'm gonna get a dedicated server, and I can choose betwee Fedora,
> > Debian and Ubuntu.
>
> > Any suggestion both in terms of performance and mantainability?
>
> > Dan


--~--~-~--~~~---~--~~
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.1 Test Suite

2007-10-15 Thread [EMAIL PROTECTED]

Can anyone point me to a tutorial or give me the basics on the test
suite for 1.1? I haven't been able to find any documentation for it,
and I would really like to run proper tests. 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: Manual loading of sessions using a session id in query string

2007-10-15 Thread shan sinha

Never mind everyone.. I solved this.  The following code snippet works
in my controller logic:

list($cookieName, $cookieValue) = split("=",
$this->params["url"]["cookie"]);

session_destroy();
session_id($cookieValue);
session_name($cookieName);
session_start();

In my java script on the client side, I have a little bit of code that
assigns encodeURIComponent(document.cookie) to a query string variable
named "cookie".

And everything works perfectly.


On Oct 15, 1:02 pm, shan sinha <[EMAIL PROTECTED]> wrote:
> Hi folks-
>
> I am using a component for uploading files that does not
> (unfortunately) pass HTTP headers back up to the server when posting
> files.  As a result, I am unable to retrieve session variables on
> handling the file uploads. Instead, the post of the files is being
> done through a new session.
>
> One workaround is to pass the session ID cookie through the query
> string on the post.  However, when the cake controller/action receives
> this query string, is it possible for me to load the data from the
> session ID sent to me from the query string?
>
> Basically what I want to do is (in pseudo code):
>
> class MyController {
> function myAction() {
>$theRightSession = new Session( $session_id_from_query_string )
> }
>
> }
>
> Any thoughts?
>
> Please email me directly as well as I do not check this group
> regularly.
>
> Thanks-
> Shan


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



HABTM with extra data in join table

2007-10-15 Thread dw

I am having problems accessing data in a join table. I have searched
and read and searched some more, but am still a bit befuddled. At
first I used the 'with' condition on the HABTM association, and it
worked somewhat nicely.

What i had:

class Trainee extends AppModel
{
var $name = 'Trainee';
var $tablePrefix = 'tbl';
var $primaryKey = 'TraineeID';

   var $hasAndBelongsToMany = array(
'Meeting'=>array(
'className'=>'Meeting',
'joinTable'=>'tbltraineesclasses',
'with'=>'Enrollment',
'foreignKey'=>'TraineeID',
'associationForeignKey'=>'ClassID',
'unique'=>true
));
}

class Meeting extends AppModel
{
var $name = 'Meeting';
var $useTable = 'tblclasses';
var $primaryKey = 'ClassID';

var $hasAndBelongsToMany = array(
'Trainee'=>array(
'className'=>'Trainee',
'joinTable'=>'tbltraineesclasses',
'with'=>'Enrollment',
'foreignKey'=>'ClassID',
'associationForeignKey'=>'TraineeID',
'unique'=>true
));
}

class Enrollment extends AppModel
{
var $name = 'Enrollment';
var $useTable = 'tbltraineesclasses';
var $primaryKey = 'ID';

 var $belongsTo = array(
'TStatus' => array(
'className'=>'TStatus',
'foreignKey'=>'TraineeStatus'),
);
}


When viewing a Trainee with things set up this way, I got:

SELECT `Trainee`.stuff
 FROM `tbltrainees` AS `Trainee` WHERE `Trainee`.`TraineeID` = 1234
LIMIT 1
SELECT `Meeting`.stuff, `Enrollment`.stuff
FROM `tblclasses` AS `Meeting` JOIN `tbltraineesclasses` AS
`Enrollment` ON (`Enrollment`.`TraineeID` = '1234' AND
`Enrollment`.`ClassID` = `Meeting`.`ClassID`)

The one issue i could not figure out was that the query was not
joining on the TStatus model (i had the complimenting $hasMany
variable set in the TStatus model as well).

I then played around with this set up by removing the 'with'
condition, as I have read in a couple places that this is no longer
needed in 1.2. After I did this, the Trainee and Meeting tables were
joined via the join table, but none of the data from that table was
returned. In the Trainees controller i tried calling a $this-
>set('enrollments',$this->Trainee->MeetingsTrainees->findAll()) but
that bombed out on the 'MeetingsTrainees' part.

I feel like i've been running in circles a bit, and would appreciate
any insight anyone may have.

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: How to paginate HABTM results?????????

2007-10-15 Thread rtconner

What version of cake?

Nate left this code for 1.2: http://bin.cakephp.org/saved/21687


--~--~-~--~~~---~--~~
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: Error when baking a new project with CakePHP 1.2

2007-10-15 Thread Gwoo

what does phpinfo() show?


--~--~-~--~~~---~--~~
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: diagrams for cakephp: a case for UML?

2007-10-15 Thread Gwoo

UML


--~--~-~--~~~---~--~~
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: scaffold Component : Scaffold::__scaffold

2007-10-15 Thread Gwoo

once you add var $scaffold you should not do anything else.


--~--~-~--~~~---~--~~
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 paginate HABTM results?????????

2007-10-15 Thread Wayne Fay

Read this thread:
Pagination for model with association (cake 1.1)

Wayne

On 10/15/07, DGPhoebus <[EMAIL PROTECTED]> wrote:
>
> Okay I have a Products table, a Categories table and a
> Categories_Products join table.  A HABTM relationship has been
> defined.  So when I hit /categories/view/4  I get the Category
> definition pointed to by $id=4 and all the products assigned to
> category #4.
>
> How do I paginate the products?  Please someone help cause I have hit
> a brick wall on this one
>
> Sincerely stumped Daniel
>
>
> >
>

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



Re: problems with validation

2007-10-15 Thread Wayne Fay

Your original email is not clear. Its one huge clump of text that just
rambles on.

Break it up into short 2-3 sentence paragraphs. And be more clear with
what you have, what is happening, and what you want. Perhaps someone
will respond more positively to that.

Wayne

On 10/15/07, d34db0lts <[EMAIL PROTECTED]> wrote:
>
> i tried fixing my problem by using this article:
>
> http://bakery.cakephp.org/articles/view/rails-like-data-validation
>
> unfortunately, it didn't help, i'm having issues with the helper...can
> anybody shed some light? some hope???
> On Oct 14, 8:09 pm, d34db0lts <[EMAIL PROTECTED]> wrote:
> > Hey guys, i have this little app that i'm having problems with.
> >
> > the index page lists all the records but in that same index page there
> > is a form that uses function add in the controller to process the
> > form, but my problem is that i need a way to display if the user
> > forgot to enter anything in the input field. i've been looking around
> > at it seems like the way it is done is with a tagErrorMsg but like i
> > said, the form is in index.thtml but the form logic is in function
> > add()...so i can't have function add() tell funcion index() to display
> > a message to the user to remind him/her to enter something in the
> > input field.
> >
> > i've looked at requestAction and elements, but i can't come up with an
> > answer...so if anybody can point me in the right direction, i would
> > really appreciate 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: Emitting a PNG

2007-10-15 Thread bujanga

This code does work although I am having trouble getting it to post
properly when using the Security Component. Anyway, the post issue is
low priority for me right now.

In view:

Security Code: (refresh for new code)
input('Temp.captcha', array('size' => '20')) ?>



In users_controller:
function captcha(){
...
/* output captcha image to browser */
header('Content-Type: image/jpeg');
imagejpeg($image);
imagedestroy($image);

}

Gary Dalton


On 10/14/07, MikeK <[EMAIL PROTECTED]> wrote:
>
>
> I am still struggling with this dadgumit -- there is nothing wrong
> with the img generated itself -- I just can't emit it without saving
> it to a file with the Header command if anything else is on the page.
>
>
> >
>

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



Strange CSS Helper issues

2007-10-15 Thread JohnDoig

For some odd reason, my CSS files are not being imported when I make
small modifications to the rules.

For instance, a stylesheet will import successfully and the styles
will be applied to the views.  But then say I want to change a rule
from "height:20px;" to something like "height:25px;"

As a result of the minor change the CSS file will not longer import!
Using Firebug, when I try to view the CSS file opened by the browser
it gives me the message "There are no rules in this stylesheet."  So
Cake obviously finds the file but ignores its contents.

Once I change the "height:25px;" back to "height:20px;" it all works
again!

Does anyone know what is happening here?!

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: Oracle connectivity with CakePHP

2007-10-15 Thread Kristopher

I was wondering if it might be smart to actually define the variables
in some PHP file using:

  PutEnv("ORACLE_SID= ... ");
  PutEnv("ORACLE_HOME= ... ");
  PutEnv("TNS_ADMIN= ... ");
  ...

The problem is being a newbie to CakePHP, I'm not sure is this is a
good idea (to actually try to solve my problem) and the other issue is
that I am uncertain as to which PHP file I should place these
statements in.

Anyone care to comment?

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: problems with validation

2007-10-15 Thread d34db0lts

i tried fixing my problem by using this article:

http://bakery.cakephp.org/articles/view/rails-like-data-validation

unfortunately, it didn't help, i'm having issues with the helper...can
anybody shed some light? some hope???
On Oct 14, 8:09 pm, d34db0lts <[EMAIL PROTECTED]> wrote:
> Hey guys, i have this little app that i'm having problems with.
>
> the index page lists all the records but in that same index page there
> is a form that uses function add in the controller to process the
> form, but my problem is that i need a way to display if the user
> forgot to enter anything in the input field. i've been looking around
> at it seems like the way it is done is with a tagErrorMsg but like i
> said, the form is in index.thtml but the form logic is in function
> add()...so i can't have function add() tell funcion index() to display
> a message to the user to remind him/her to enter something in the
> input field.
>
> i've looked at requestAction and elements, but i can't come up with an
> answer...so if anybody can point me in the right direction, i would
> really appreciate 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: Oracle connectivity with CakePHP

2007-10-15 Thread Kristopher

Using the following code:
-
';
}
?>

I get the following:
-
PATH not set
NLS_LANG not set
NLS_NCHAR not set
ORACLE_HOME not set

However the following variables are set in the system:
  ORACLE_HOME (both in environment variable and in the registry which
points to my 9i installation)
  NLS_LANG
  PATH

I also have the TNS_ADMIN set to point to the location of my 10g
Instant client directory.  In this directory
I have extracted the following files: oci.dll, orannzsbb10.dll, and
oraociei10.dll.  I also copied over the
tnsname.ora file in that directory (as per some web comments...)

Basically I have to have my 9i environment working and would simply
like to have PHP 5.2.4 be able to
connect via OCI to my Oracle 9i database.


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



Re: Oracle connectivity with CakePHP

2007-10-15 Thread Kristopher

Some other background information:

Using the following PHP code:

';
}
?>

I get:

PATH not set
NLS_LANG not set
NLS_NCHAR not set
ORACLE_HOME not set

Which is somewhat strange since I have set the NLS_LANG in my startup
batch file for Apache 2.2.

I also have set the following environment variables in my system:
NLS_LANG = ...
ORACLE_HOME = (points to my 9i installation folder)

And I also have the TNS_ADMIN which points to my 10g Instant client
folder (which contains my oci.dll, orannzsbb10.dll, oraociei10.dll and
tnsnames.ora which I copied).



--~--~-~--~~~---~--~~
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 paginate HABTM results?????????

2007-10-15 Thread DGPhoebus

Okay I have a Products table, a Categories table and a
Categories_Products join table.  A HABTM relationship has been
defined.  So when I hit /categories/view/4  I get the Category
definition pointed to by $id=4 and all the products assigned to
category #4.

How do I paginate the products?  Please someone help cause I have hit
a brick wall on this one

Sincerely stumped Daniel


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



Manual loading of sessions using a session id in query string

2007-10-15 Thread shan sinha

Hi folks-

I am using a component for uploading files that does not
(unfortunately) pass HTTP headers back up to the server when posting
files.  As a result, I am unable to retrieve session variables on
handling the file uploads. Instead, the post of the files is being
done through a new session.

One workaround is to pass the session ID cookie through the query
string on the post.  However, when the cake controller/action receives
this query string, is it possible for me to load the data from the
session ID sent to me from the query string?

Basically what I want to do is (in pseudo code):

class MyController {
function myAction() {
   $theRightSession = new Session( $session_id_from_query_string )
}
}

Any thoughts?

Please email me directly as well as I do not check this group
regularly.

Thanks-
Shan


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



Oracle connectivity with CakePHP

2007-10-15 Thread Kristopher

Hi All,

I have been struggling to get CakePHP to communicate with an Oracle 9i
database.  I have installed the 10g Instant Client and have created a
batch file to run my Apache 2.2 server.  In this batch file I have set
the following environnment variables:

set ORACLE_BASE="D:\oracle"
set ORACLE_HOME="%ORACLE_BASE%\ora92"
set ORA_NLS="%ORACLE_HOME%\ocommon\nls\admin\data"
set ORA_NLS33="%ORACLE_HOME%\ocommon\nls\admin\data"
set NLS_LANG="UTF8"

Now originally I was getting the following Oracle error:

Warning (2): oci_connect() [function.oci-connect]: ORA-12154:
TNS:could not resolve the connect identifier specified [CORE\cake\libs
\model\datasources\dbo\dbo_oracle.php, line 144]

I located somewhere on the web that it says I should use 'database' =>
'//localhost/oradbname'.

When I make the change to the database.php file I get the following
error:

Warning (2): oci_connect() [function.oci-connect]: ORA-12705: Cannot
access NLS data files or invalid environment specified [CORE\cake\libs
\model\datasources\dbo\dbo_oracle.php, line 144]

Now this says it has something to do with my NLS_LANG variable which
is set (see above).  I also set the 9i ORA_NLS33 to point to the right
NLS data location.

So basically it is still not working and I am not sure which error is
further ahead in my connectivity with my oracle database.

Anybody been able to get a 9i database to work with PHP 5.2.4 using
CakePHP 1.2?

Sincerely,


Kristopher


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



Name collisions among PHP OO subsystems

2007-10-15 Thread MikeK

My current Cake 1.2 app is bridged to phpBB. The best way to effect
this and get single site login using phpBB (2.X) ACL model,
authentication etc was to insert phpBBs session startup code and
necessary includes into WEBROOT/index.php at the very top, and to do
the necessary user management in a before filter of app_controller.
This way all my cake rendered pages were automatically authenticated,
sessionized, and ACLed based on the phpBB user model.

All works fine except both phpBB and CakePHP use the same DEBUG
constant for setting up DEBUGging. No problem -- given that Cake is a
much tidier source base and the constant is really used to prime the
debug class I chaned DEBUG to CAKE_DEBUG in a few files and all was
well. I could control Cake debugging levels and phpBB debug levels
independently.

This week I revisited experimenting with phpBB3 (Olympus) as it is
near its final release candidate. The phpBB3 source base is totally
object oriented, so I was not surprised when during my experimental
merge I found a class name collision, specifically for the Cache
class. I think it's actually amazing there weren't more collisions ;)

Anyway the solution once again was to edit about 4 Cake files to
rename the Cache class to CakeCache (the main 2 were cake/
bootsrtap.php and cake/libs/cache.php).

While it could have been much worse, I thought I would bring this to
the attention of the Cake developers. Not on whether it should change
Cake's naming of some internal classes but just to be aware that there
will be many php subsystems cakers are integrating, and these issues
do make life a bit more complex, especially during upgrade cycles.

While there may be a better way to bridge these subsystems and others
like them, I haven't found one that works better than what I have done
here -- to utilize phpBBs auth/ACL model and get single login you MUST
run the following code (in webroot/index.php) before anything else --
thus the cake engine as a tool for rendering dynamic content is loaded
after.

define('IN_PHPBB', true);
$phpbb_root_path = '../../../phpBB3/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

Thanks again to all who make cake possible -- it has made my
productivity significantly better compared to generic OO php
interfaceing to a DB.


--~--~-~--~~~---~--~~
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: ACL Admin plugin AD7six "No User Model"

2007-10-15 Thread seacloud9

I have followed the following instructions:
1) Extract all files into your app folder directory. Such that you
have
/whereCakeIs/app/plugins/acl_admin

I extracted all files in the zip to app/plugins/acl_admin is that
incorrect? Or do the views, models, controllers, need to be placed in
the main app folder?  I have my model/user.php and I have changed the
generic_contorller.php to have   var$userModel='user'; still.
It is not working.  Is their a demo out their I can look at to see how
to set this up??

On Oct 15, 11:56 am, seacloud9 <[EMAIL PROTECTED]> wrote:
> I do have a "user.php" model in my model folder.  I am able to use
> dAuth to authenticate and create users.  It is setup and is working
> fine.  It doesn't seem to be finding the "user" model.  What file do I
> need to set the var in the plugin?
>
> On Oct 15, 10:02 am, AD7six <[EMAIL PROTECTED]> wrote:
>
> > On Oct 15, 3:51 pm, seacloud9 <[EMAIL PROTECTED]> wrote:
>
> > > I am currently recieveing this error:
>
> > > No User Model
> > > You need to tell this plugin what your user model is called to be able
> > > to use this function.
> > > If you don't have users already set up on your system, you need an
> > > authentication solution such as DAuth.
>
> > The error means what it says, by default it expects a "User" model I
> > think and you don't have one. If your user model isn't called "User"
> > explicitly set var $userModel in the plugin app controller to the name
> > of your user model. Note that having a db table named users is not the
> > same as (it's a part of) having a User model.
>
> > The dummy model, iirc, is so that the models folder gets created.
> > serves the same pupose as the empty files in the cake download.
>
> > 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: Warning (512): Method HtmlHelper::formTag does not exist [CORE/cake/libs/view/helper.php, line 148]

2007-10-15 Thread [EMAIL PROTECTED]

Beautiful,
Thank you!

On Oct 15, 11:02 am, "Wayne Fay" <[EMAIL PROTECTED]> wrote:
> Those tags have all been deprecated. This post should 
> help:http://cake.insertdesignhere.com/posts/view/15
>
> Wayne
>
> On 10/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello Wayne,
> > I appreciate your help but I'm still a little confused.
> > I get the warnings below.
>
> > Warning (512): Method HtmlHelper::formTag does not exist
> > Warning (512): Method HtmlHelper::inputTag does not exist
> > Warning (512): Method HtmlHelper::passwordTag does not exist
> > Warning (512): Method HtmlHelper::submitTag does not exist
>
> > What would the "new replacement tags" be for version1.2?
> > Do you know of any code samples for ver 1.2 dealing with forms, I
> > can't seem to find anything I need in the docs.
>
> > Peter
>
> > On Oct 12, 5:12 pm, "Wayne Fay" <[EMAIL PROTECTED]> wrote:
> > > That code was written for Cake v1.1. The formTag method has been
> > > deprecated in v1.2. You'll need to revert to v1.1 or rewrite the code
> > > to use FormHelper directly.
>
> > > Wayne
>
> > > On 10/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > > > Does anyone know why I get this warning. And how do I get around it?
> > > > I'm using cake_1.2.0.5427alpha the code comes from IBM's tutorial at:
> > > >https://www6.software.ibm.com/developerworks/education/os-php-cake1/s...
> > > > Their code:
>
> > > > formTag('/users/register') ?>
> > > > Please fill out the form below to register an account.
> > > > Username:
> > > > inputTag('User/username', array('size' => '40')) ?>
> > > > tagErrorMsg('User/username', 'username is
> > > > required') ?>
>
> > > > Password:
> > > > passwordTag('User/password', array('size' => '40')) ?
>
> > > > tagErrorMsg('User/password', 'password is
> > > > required') ?>
>
> > > > Email Address:
> > > > inputTag('User/email', array('size' =>
> > > > '40','maxlength'=>'255')) ?>
> > > > tagErrorMsg('User/email', 'email is invalid') ?>
>
> > > > First Name:
> > > > inputTag('User/first_name', array('size' => '40')) ?
>
> > > > tagErrorMsg('User/first_name', 'first_name is
> > > > required') ?>
>
> > > > Last Name:
> > > > inputTag('User/last_name', array('size' => '40')) ?>
> > > > tagErrorMsg('User/last_name', 'last_name is
> > > > required') ?>
>
> > > > submitTag('register') ?>
> > > > 


--~--~-~--~~~---~--~~
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: Warning (512): Method HtmlHelper::formTag does not exist [CORE/cake/libs/view/helper.php, line 148]

2007-10-15 Thread Wayne Fay

Those tags have all been deprecated. This post should help:
http://cake.insertdesignhere.com/posts/view/15

Wayne

On 10/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hello Wayne,
> I appreciate your help but I'm still a little confused.
> I get the warnings below.
>
> Warning (512): Method HtmlHelper::formTag does not exist
> Warning (512): Method HtmlHelper::inputTag does not exist
> Warning (512): Method HtmlHelper::passwordTag does not exist
> Warning (512): Method HtmlHelper::submitTag does not exist
>
> What would the "new replacement tags" be for version1.2?
> Do you know of any code samples for ver 1.2 dealing with forms, I
> can't seem to find anything I need in the docs.
>
> Peter
>
>
>
> On Oct 12, 5:12 pm, "Wayne Fay" <[EMAIL PROTECTED]> wrote:
> > That code was written for Cake v1.1. The formTag method has been
> > deprecated in v1.2. You'll need to revert to v1.1 or rewrite the code
> > to use FormHelper directly.
> >
> > Wayne
> >
> > On 10/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Does anyone know why I get this warning. And how do I get around it?
> > > I'm using cake_1.2.0.5427alpha the code comes from IBM's tutorial at:
> > >https://www6.software.ibm.com/developerworks/education/os-php-cake1/s...
> > > Their code:
> >
> > > formTag('/users/register') ?>
> > > Please fill out the form below to register an account.
> > > Username:
> > > inputTag('User/username', array('size' => '40')) ?>
> > > tagErrorMsg('User/username', 'username is
> > > required') ?>
> >
> > > Password:
> > > passwordTag('User/password', array('size' => '40')) ?
> >
> > > tagErrorMsg('User/password', 'password is
> > > required') ?>
> >
> > > Email Address:
> > > inputTag('User/email', array('size' =>
> > > '40','maxlength'=>'255')) ?>
> > > tagErrorMsg('User/email', 'email is invalid') ?>
> >
> > > First Name:
> > > inputTag('User/first_name', array('size' => '40')) ?
> >
> > > tagErrorMsg('User/first_name', 'first_name is
> > > required') ?>
> >
> > > Last Name:
> > > inputTag('User/last_name', array('size' => '40')) ?>
> > > tagErrorMsg('User/last_name', 'last_name is
> > > required') ?>
> >
> > > submitTag('register') ?>
> > > 
>
>
> >
>

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



inflections.php memory issue

2007-10-15 Thread regent

I get the following error when processing a large amount of data:


Fatal error: Allowed memory size of 536870912 bytes exhausted (tried
to allocate 8192 bytes) in C:\PATH\app\config\inflections.php on line
1


How do I avoid this error?  Processing less data is not an option.


--~--~-~--~~~---~--~~
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: Warning (512): Method HtmlHelper::formTag does not exist [CORE/cake/libs/view/helper.php, line 148]

2007-10-15 Thread [EMAIL PROTECTED]

Hello Wayne,
I appreciate your help but I'm still a little confused.
I get the warnings below.

Warning (512): Method HtmlHelper::formTag does not exist
Warning (512): Method HtmlHelper::inputTag does not exist
Warning (512): Method HtmlHelper::passwordTag does not exist
Warning (512): Method HtmlHelper::submitTag does not exist

What would the "new replacement tags" be for version1.2?
Do you know of any code samples for ver 1.2 dealing with forms, I
can't seem to find anything I need in the docs.

Peter



On Oct 12, 5:12 pm, "Wayne Fay" <[EMAIL PROTECTED]> wrote:
> That code was written for Cake v1.1. The formTag method has been
> deprecated in v1.2. You'll need to revert to v1.1 or rewrite the code
> to use FormHelper directly.
>
> Wayne
>
> On 10/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > Does anyone know why I get this warning. And how do I get around it?
> > I'm using cake_1.2.0.5427alpha the code comes from IBM's tutorial at:
> >https://www6.software.ibm.com/developerworks/education/os-php-cake1/s...
> > Their code:
>
> > formTag('/users/register') ?>
> > Please fill out the form below to register an account.
> > Username:
> > inputTag('User/username', array('size' => '40')) ?>
> > tagErrorMsg('User/username', 'username is
> > required') ?>
>
> > Password:
> > passwordTag('User/password', array('size' => '40')) ?
>
> > tagErrorMsg('User/password', 'password is
> > required') ?>
>
> > Email Address:
> > inputTag('User/email', array('size' =>
> > '40','maxlength'=>'255')) ?>
> > tagErrorMsg('User/email', 'email is invalid') ?>
>
> > First Name:
> > inputTag('User/first_name', array('size' => '40')) ?
>
> > tagErrorMsg('User/first_name', 'first_name is
> > required') ?>
>
> > Last Name:
> > inputTag('User/last_name', array('size' => '40')) ?>
> > tagErrorMsg('User/last_name', 'last_name is
> > required') ?>
>
> > submitTag('register') ?>
> > 


--~--~-~--~~~---~--~~
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: Update Cake

2007-10-15 Thread Zoltan

Not banal at all - I had this problem early on when I was getting
started with Cake about 6 months ago.

I think you should be able to change the files outside of your apps
folder (and the config folder in your config dir) and it will probably
work. I'm sure you know the views have changed their extensions
to .ctp and I think things should work alright. Just note, I tried
this several months ago and I'm not using the testing functions.

Perhaps some other bakers can provide tips on anything to watch out
for.

Zoltan
www.yyztech.ca (a Cake site)

On Oct 15, 3:26 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hi
> I'm new in Cake
> I have a banal question
> If I want to pass from the version 1.1.17  to version 1.2 I must
> change only the core core or I must change other thing?
> Many Thanks
> Marco


--~--~-~--~~~---~--~~
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: ACL Admin plugin AD7six "No User Model"

2007-10-15 Thread seacloud9

I do have a "user.php" model in my model folder.  I am able to use
dAuth to authenticate and create users.  It is setup and is working
fine.  It doesn't seem to be finding the "user" model.  What file do I
need to set the var in the plugin?

On Oct 15, 10:02 am, AD7six <[EMAIL PROTECTED]> wrote:
> On Oct 15, 3:51 pm, seacloud9 <[EMAIL PROTECTED]> wrote:
>
> > I am currently recieveing this error:
>
> > No User Model
> > You need to tell this plugin what your user model is called to be able
> > to use this function.
> > If you don't have users already set up on your system, you need an
> > authentication solution such as DAuth.
>
> The error means what it says, by default it expects a "User" model I
> think and you don't have one. If your user model isn't called "User"
> explicitly set var $userModel in the plugin app controller to the name
> of your user model. Note that having a db table named users is not the
> same as (it's a part of) having a User model.
>
> The dummy model, iirc, is so that the models folder gets created.
> serves the same pupose as the empty files in the cake download.
>
> 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
-~--~~~~--~~--~--~---



Ajax request from an external web site to a controller action in a cakephp web site

2007-10-15 Thread Cruentatio

Hi, I need to write a little JS file in which I need to make a call
like this http_request.open('GET', url, true); where URL is a cakephp-
like url (http://my-site.com/controller/action/par1/par2) and return a
view in the web site that start the request and put in a dedicated
DIV.

The JS should be added to any web-site.

Can you help me!?

Thanks!!!
Bye!


--~--~-~--~~~---~--~~
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: Error when use $html->image and __()

2007-10-15 Thread william

Yeah! I had removed Zend optimizer and restart apache, It works.
Thanks.

On Oct 15, 4:10 pm, Claudia <[EMAIL PROTECTED]> wrote:
> Have a look 
> here:http://groups.google.com/group/cake-php/browse_thread/thread/eda86379...
>
> In short: the translation function __ makes use of debug_backtrace
> which sometimes causes Apache to die (especially if you have Zend
> optimizer running).
> Either use __d as translation function or first create the translation
> string and then use the result in the html->image call.
>
> Claudia
>
> On Oct 15, 9:41 am, william <[EMAIL PROTECTED]> wrote:
>
> > Hello all,
> > When I run these code in cake\libs\view\templates\layouts\default.ctp
> > image('cake.power.png',
> > array('alt'=>__("test",true), 'border'=>"0"));?>
>
> > It made apache died.
>
> > Why I get this fatal error? What is going on?
>
> > Thank you for your help and time!
>
> > William


--~--~-~--~~~---~--~~
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: Layout code being overlooked

2007-10-15 Thread ifcanduela

Hey, thanks for the tips!

I found the error: Call to undefined function: stripos(). I had to
replace it with two calls to strpos() and then it worked fine. I
didn't know the case-insensitive version didn't work in PHP 4.

Anyways, problem solved, thanks a lot.


--~--~-~--~~~---~--~~
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: preload a class that extends Object

2007-10-15 Thread bingo

hi

Thanks for the suggestions..
@amit
I specifically don't want to put in AppModel as I think it can also be
useful to controllers as well as views.

@grigri
Thanks for the detailed explanation. One thing about my class is that
it doesn't necessarily has to extend Object. I was just trying to copy
Set class of CakePHP. Given this, can you describe the tradeoff
between putting in vendor vs as a CakePHP library

Regards,
Ritesh
On Oct 15, 8:04 am, "Amit Badkas" <[EMAIL PROTECTED]> wrote:
> On 10/15/07, bingo <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > I have some generic data processing that most of the models need. So I
> > wrote a class that extends Object.   However, I didn't understand to
> > make available throughout my application. This is how my class is
> > define
>
> - Why not in the AppModel  class?
>
> Class ExtendedSetOperations extends Object{
>
>
>
>
>
> > public getCount($data, $path)
> > 
> >}
> > }
>
> > What I am trying to is call this class from my model in the same way
> > as I call Set::extract
>
> > I considered the object of Using vendor library but I don't want to
> > get that route as then I have to load it everything a model needs
> > these functions.
>
> > Regards,
> > Ritesh
>
> --
> Regards,
> Amit
>
> http://amitrb.wordpress.com/http://cheesecake-photoblog.org/http://www.sanisoft.com/blog/author/amitbadkas-
>  Hide quoted text -
>
> - Show quoted text -


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



Re: ACL Admin plugin AD7six "No User Model"

2007-10-15 Thread AD7six



On Oct 15, 3:51 pm, seacloud9 <[EMAIL PROTECTED]> wrote:
> I am currently recieveing this error:
>
> No User Model
> You need to tell this plugin what your user model is called to be able
> to use this function.
> If you don't have users already set up on your system, you need an
> authentication solution such as DAuth.

The error means what it says, by default it expects a "User" model I
think and you don't have one. If your user model isn't called "User"
explicitly set var $userModel in the plugin app controller to the name
of your user model. Note that having a db table named users is not the
same as (it's a part of) having a User model.

The dummy model, iirc, is so that the models folder gets created.
serves the same pupose as the empty files in the cake download.

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: Wow. I must really have missed something.

2007-10-15 Thread ard

Thank you Nate.

My forms evolved from earlier work and I guess as long as they were
working I worried about other things.
Thanks for pointing me to the other post.

ARD


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



ACL Admin plugin AD7six "No User Model"

2007-10-15 Thread seacloud9

I am currently recieveing this error:

No User Model
You need to tell this plugin what your user model is called to be able
to use this function.
If you don't have users already set up on your system, you need an
authentication solution such as DAuth.

I have DAuth installed and working properly. I have a Users table not
a user table this was the way DAuth was setup.  I noticed a blank
"dummy" model in the ACL-Admin plugin folder.  I found no
documentation on how to link these up..  The demo is down on AD7six
and I can't even find a google cahced version.  Any clues..

I could rename the table name and break my DAuth but I do not really
want to do that.  Someone here has probably had the same problem..


Does anyone have the AD7six demo?? Does anyone know how to configure
it to read your user model?? That you currently have and 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
-~--~~~~--~~--~--~---



scaffold Component : Scaffold::__scaffold

2007-10-15 Thread marek. bytnar

I try to use this method in my controller. Probably I have some syntax
error. Can anyone help, please ? :

 'add'));

}
}

?>

then I get errors:

Notice (8): Undefined property:  RealizationsController::
$ScaffoldModel
Notice (8): Trying to get property of non-object [CORE/cake/libs/
controller/scaffold.php, line 404]
Fatal error: ConnectionManager::getDataSource - Non-existent data
source in /opt/lampp/htdocs/cake/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: ajaxHelper - observerField problem in layout when updating field

2007-10-15 Thread senser

no
my "empty.ctp" file is empty - may be I should put smo code there, but
I don't know what ..
some suggestions ???


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



Multiple same fields in one view

2007-10-15 Thread lemon

Hi :)

  I've got question. How I can add fields on the fly and read data
from them? For example: I have simple form with two selects. But
bellow them is a link and when I click it, it should appear another
pair of this two selects. Any ideas ? :)

TIA

Regards
lemon

P.S. Sorry for my lossy English.


--~--~-~--~~~---~--~~
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: No Style with CSS at localhost/cake on local machine

2007-10-15 Thread Jay Gilmore (smashingjay)

XAMPP has allowoverride all installed by default and all you need to
do is add the RewriteBse line to the .htaccess file of the root of
your cake as is below:



   RewriteBase /cake
   RewriteEngine on
   RewriteRule^$ app/webroot/[L]
   RewriteRule(.*) app/webroot/$1 [L]


This is actually written in the manual here:
http://manual.cakephp.org/chapter/installing
See the second last point in Section 5.

On Oct 15, 5:28 am, Comida411 <[EMAIL PROTECTED]> wrote:
> Trying to run cakephp for the first time
>
> 1. Installed xamp.. all good
> 2. installed cake 1.2
> but when runhttp://localhost/cakeI get cake info with no styple
> I am told this is a allowoverride error... so iI set allowoverride to
> all but still not style
> Review of error log shows
>
> [Mon Oct 15 04:05:46 2007] [error] [client 127.0.0.1] File does not
> exist: C:/xampp/htdocs/cake/favicon.ico
> [Mon Oct 15 04:05:46 2007] [error] [client 127.0.0.1] File does not
> exist: C:/xampp/htdocs/cake/css, referer:http://localhost/cake/
> [Mon Oct 15 04:05:46 2007] [error] [client 127.0.0.1] File does not
> exist: C:/xampp/htdocs/cake/img, referer:http://localhost/cake/
>
> I can see that the server cannot find the css, or favicons or img..
> necessary to give my page styple..
> but a search of the cake folder shows that these files are there..
> there are just located a couple of directories lowere then apache is
> looking for them..
>
> What should I do..?
> Thank you
> Comida


--~--~-~--~~~---~--~~
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: preload a class that extends Object

2007-10-15 Thread Amit Badkas
On 10/15/07, bingo <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> I have some generic data processing that most of the models need. So I
> wrote a class that extends Object.   However, I didn't understand to
> make available throughout my application. This is how my class is
> define


- Why not in the AppModel  class?

Class ExtendedSetOperations extends Object{
> public getCount($data, $path)
> 
>}
> }
>
> What I am trying to is call this class from my model in the same way
> as I call Set::extract
>
> I considered the object of Using vendor library but I don't want to
> get that route as then I have to load it everything a model needs
> these functions.
>
> Regards,
> Ritesh
>
>
> >
>


-- 
Regards,
Amit

http://amitrb.wordpress.com/
http://cheesecake-photoblog.org/
http://www.sanisoft.com/blog/author/amitbadkas

--~--~-~--~~~---~--~~
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: ajaxHelper - observerField problem in layout when updating field

2007-10-15 Thread Amit Badkas
I think you just need to set [code]$this->layout = 'ajax';[/code] in your
controller's action. This works fine always

On 10/15/07, senser <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> I work on application based on CakePHP and use ajaxHelper in one of my
> forms for updating field (i've tried text_field, taxtarea_field,
> block  etc but same result) according to select_box change. I want
> to show an address of a selected employer - employers list is in a
> populated select box and when user select an employer I want the
> address to be shown below select_box.
> Here is snippets from the code:
>
> /***Layout of the form*/
>
> print $form->input('CustomerTaxDetail.employers_id',
> array('type'=>'select', 'label'=>'Employer', 'options'=>
> $employersArray, 'showEmpty'=>false, 'size'=>4,
> id'=>'employers','error'=>array('required'=>'Employer is obligatory',
> 'maxlength'=>'Employer code max length is 8 symbols',
> 'number'=>'Employer code must be a number')));
>
> print ' ';
>
> print $ajax->observeField('employers', array('url'=>'/employers/
> update_address', 'update'=>'employer_address',
> 'loading'=>'document.getElementById(\'employer_address
> \').style.display=\'block\'',
> 'loaded'=>'document.getElementById(\'employer_address\').style.display=
> \'block\''));
>
> /End of layout*/
>
> /update_address function in EmployerController where I get the
> employer address**/
>
> function update_address() {
> $this->Employer->recursive=0;
> if(!empty($this->data['CustomerTaxDetail']['employers_id']))
> {
> $employer_id =
> (int)$this->data['CustomerTaxDetail']
> ['employers_id'];
> $this->set('address',$this->Employer->read('
> Employer.address',
> $employer_id));
> }
> }
>
> /End of function*/
>
> /**The View for update_address function*/
>
>  if(!empty($address)) {
> print $address['Employer']['address'];
> }
>
> /Enf of the View***/
>
>
> So the problem is that when I select an emploer from select_list and
> the field below is populated with whole html of the default layout I'm
> using and not only with employer's address. I've tried to make an
> empty layout and use it in function update_address but then  the box
> for the employer_address stays empty.
>
> Finally my question is how to populate employer_address field only
> with the address but not with whole layout/html.
>
> Thanks in advance!
>
>
> >
>


-- 
Regards,
Amit

http://amitrb.wordpress.com/
http://cheesecake-photoblog.org/
http://www.sanisoft.com/blog/author/amitbadkas

--~--~-~--~~~---~--~~
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: preload a class that extends Object

2007-10-15 Thread grigri

Right, first the way you call Set::*** is static invocation, so if you
want your class to work this way make sure you don't use member
variables or $this inside your methods.

To make the class available on every request, put a require_once()
inside your app/config/bootstrap.php file. You could quite easily make
it a vendor class and use vendor() inside bootstrap.php - but that
would seem a bit wierd since that folder is for "third-party code"
while your class clearly has a dependency on cakephp code - the Object
class for one. Not 100% sure about this - it would be nice to have an
app-level "libs" folder but I think the cake devs decided against this
because it would be abused by people not bothering with MVC - all
helpers/components/behaviors/whatever would just be "libs".

Of course, if only your models need the class it would make more sense
to put the require_once() in the app_model.php code, just above the
AppModel class declaration. Still, the whole vendor() vs
require_once() problem remains the same.

Also, since you are essentially extending the cake code, it would be
neat to stick to cake conventions and stay PHP4-compatible (avoid the
"public" declaration) - but hey, that's just nitpicking!

Hope this helps
grigri

On Oct 15, 12:42 pm, bingo <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have some generic data processing that most of the models need. So I
> wrote a class that extends Object.   However, I didn't understand to
> make available throughout my application. This is how my class is
> define
>
> Class ExtendedSetOperations extends Object{
> public getCount($data, $path)
> 
>}
>
> }
>
> What I am trying to is call this class from my model in the same way
> as I call Set::extract
>
> I considered the object of Using vendor library but I don't want to
> get that route as then I have to load it everything a model needs
> these functions.
>
> Regards,
> Ritesh


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



preload a class that extends Object

2007-10-15 Thread bingo

Hi,

I have some generic data processing that most of the models need. So I
wrote a class that extends Object.   However, I didn't understand to
make available throughout my application. This is how my class is
define

Class ExtendedSetOperations extends Object{
public getCount($data, $path)

   }
}

What I am trying to is call this class from my model in the same way
as I call Set::extract

I considered the object of Using vendor library but I don't want to
get that route as then I have to load it everything a model needs
these functions.

Regards,
Ritesh


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



diagrams for cakephp: a case for UML?

2007-10-15 Thread technix83

Hiya folks,
  I've been working in cake for the past 2 months and it's been
quite a fruitful relationship.However as my applications become more
complex and more 3rd party php apps are used within my software , I'm
experiencing problems communicating my design to my line managers for
approval.I've tried charting on paper , first with the dreaded
flowchart and now with simple structure charts , but Im considering
using UML as cake is OOP anyway.but before I take the plunge I'd like
to ;earn from your collective experience on how you'd communicate your
system designs to your bosses in the planning stage?
Any thoughts on the matter, gents?
Cheers!
Louis


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



No Style with CSS at localhost/cake on local machine

2007-10-15 Thread Comida411

Trying to run cakephp for the first time

1. Installed xamp.. all good
2. installed cake 1.2
but when run http://localhost/cake I get cake info with no styple
I am told this is a allowoverride error... so iI set allowoverride to
all but still not style
Review of error log shows

[Mon Oct 15 04:05:46 2007] [error] [client 127.0.0.1] File does not
exist: C:/xampp/htdocs/cake/favicon.ico
[Mon Oct 15 04:05:46 2007] [error] [client 127.0.0.1] File does not
exist: C:/xampp/htdocs/cake/css, referer: http://localhost/cake/
[Mon Oct 15 04:05:46 2007] [error] [client 127.0.0.1] File does not
exist: C:/xampp/htdocs/cake/img, referer: http://localhost/cake/

I can see that the server cannot find the css, or favicons or img..
necessary to give my page styple..
but a search of the cake folder shows that these files are there..
there are just located a couple of directories lowere then apache is
looking for them..

What should I do..?
Thank you
Comida


--~--~-~--~~~---~--~~
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: ajaxHelper - observerField problem in layout when updating field

2007-10-15 Thread schneimi

did you put something like  in your
"empty" layout?

senser schrieb:
> Hi,
>
> I work on application based on CakePHP and use ajaxHelper in one of my
> forms for updating field (i've tried text_field, taxtarea_field,
> block  etc but same result) according to select_box change. I want
> to show an address of a selected employer - employers list is in a
> populated select box and when user select an employer I want the
> address to be shown below select_box.
> Here is snippets from the code:
>
> /***Layout of the form*/
>
> print $form->input('CustomerTaxDetail.employers_id',
> array('type'=>'select', 'label'=>'Employer', 'options'=>
> $employersArray, 'showEmpty'=>false, 'size'=>4,
> id'=>'employers','error'=>array('required'=>'Employer is obligatory',
> 'maxlength'=>'Employer code max length is 8 symbols',
> 'number'=>'Employer code must be a number')));
>
> print ' ';
>
> print $ajax->observeField('employers', array('url'=>'/employers/
> update_address', 'update'=>'employer_address',
> 'loading'=>'document.getElementById(\'employer_address
> \').style.display=\'block\'',
> 'loaded'=>'document.getElementById(\'employer_address\').style.display=
> \'block\''));
>
> /End of layout*/
>
> /update_address function in EmployerController where I get the
> employer address**/
>
>   function update_address() {
>   $this->Employer->recursive=0;
>   if(!empty($this->data['CustomerTaxDetail']['employers_id'])) {
>   $employer_id = (int)$this->data['CustomerTaxDetail']
> ['employers_id'];
>   
> $this->set('address',$this->Employer->read('Employer.address',
> $employer_id));
>   }
>   }
>
> /End of function*/
>
> /**The View for update_address function*/
>
>  if(!empty($address)) {
>   print $address['Employer']['address'];
> }
>
> /Enf of the View***/
>
>
> So the problem is that when I select an emploer from select_list and
> the field below is populated with whole html of the default layout I'm
> using and not only with employer's address. I've tried to make an
> empty layout and use it in function update_address but then  the box
> for the employer_address stays empty.
>
> Finally my question is how to populate employer_address field only
> with the address but not with whole layout/html.
>
> 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: Error when use $html->image and __()

2007-10-15 Thread Claudia

Have a look here:
http://groups.google.com/group/cake-php/browse_thread/thread/eda86379e16f165e/cea227d8a8602c7c

In short: the translation function __ makes use of debug_backtrace
which sometimes causes Apache to die (especially if you have Zend
optimizer running).
Either use __d as translation function or first create the translation
string and then use the result in the html->image call.

Claudia

On Oct 15, 9:41 am, william <[EMAIL PROTECTED]> wrote:
> Hello all,
> When I run these code in cake\libs\view\templates\layouts\default.ctp
> image('cake.power.png',
> array('alt'=>__("test",true), 'border'=>"0"));?>
>
> It made apache died.
>
> Why I get this fatal error? What is going on?
>
> Thank you for your help and time!
>
> William


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



Error when use $html->image and __()

2007-10-15 Thread william

Hello all,
When I run these code in cake\libs\view\templates\layouts\default.ctp
image('cake.power.png',
array('alt'=>__("test",true), 'border'=>"0"));?>

It made apache died.

Why I get this fatal error? What is going on?


Thank you for your help and time!

William


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



ajaxHelper - observerField problem in layout when updating field

2007-10-15 Thread senser

Hi,

I work on application based on CakePHP and use ajaxHelper in one of my
forms for updating field (i've tried text_field, taxtarea_field,
block  etc but same result) according to select_box change. I want
to show an address of a selected employer - employers list is in a
populated select box and when user select an employer I want the
address to be shown below select_box.
Here is snippets from the code:

/***Layout of the form*/

print $form->input('CustomerTaxDetail.employers_id',
array('type'=>'select', 'label'=>'Employer', 'options'=>
$employersArray, 'showEmpty'=>false, 'size'=>4,
id'=>'employers','error'=>array('required'=>'Employer is obligatory',
'maxlength'=>'Employer code max length is 8 symbols',
'number'=>'Employer code must be a number')));

print ' ';

print $ajax->observeField('employers', array('url'=>'/employers/
update_address', 'update'=>'employer_address',
'loading'=>'document.getElementById(\'employer_address
\').style.display=\'block\'',
'loaded'=>'document.getElementById(\'employer_address\').style.display=
\'block\''));

/End of layout*/

/update_address function in EmployerController where I get the
employer address**/

function update_address() {
$this->Employer->recursive=0;
if(!empty($this->data['CustomerTaxDetail']['employers_id'])) {
$employer_id = (int)$this->data['CustomerTaxDetail']
['employers_id'];

$this->set('address',$this->Employer->read('Employer.address',
$employer_id));
}
}

/End of function*/

/**The View for update_address function*/

http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Update Cake

2007-10-15 Thread [EMAIL PROTECTED]

Hi
I'm new in Cake
I have a banal question
If I want to pass from the version 1.1.17  to version 1.2 I must
change only the core core or I must change other thing?
Many Thanks
Marco


--~--~-~--~~~---~--~~
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: Stored Procedure Parameters

2007-10-15 Thread Grant Cox

/cake/libs/model/model.php, in the call__() function is the place to
start looking.  It does pass on any parameters from your function call
to whatever generates the SQL, but I didn't look into it enough to see
what format they should be.

Best bet is probably to ask the guys on IRC, or just construct some
manual SQL and execute that.


On Oct 9, 10:00 pm, Cory Dee <[EMAIL PROTECTED]> wrote:
> Thank you for fully understanding the question. It is very difficult
> to look up the source for a function that does not exist. I wouldn't
> even know where to start.
>
> Cory
>
>


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