Re: problem select menu with optgroups

2010-07-29 Thread hoss7
i use :

function usercat() {
$usercats = $this-Subcat-Cat-find('all');

$options = array();
 foreach($usercats as $k = $v)
  {
$cat_name = $v['Cat']['title'];

$options[$cat_name] = array();

foreach($v['Subcat'] as $sub_cat)
{
$options[$cat_name][$sub_cat['id']] =
$sub_cat['title'];
}

}

$this-set(compact($options));
}

but i have error:

Undefined variable: options

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: problem select menu with optgroups

2010-07-29 Thread hoss7
i have cakephp 1.3.2 i cant use this:
$this-set(compact($options));
i fix my Undefined variable: options error with this:
$this-set(compact('options'));

but thank you

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Email Component

2010-07-29 Thread Louie Miranda
Try this..

class AccountsController extends AppController
{
var $name = Accounts;
var $components = array('Email');

function email() {
$this-Email-from= 'Somebody someb...@example.com';
$this-Email-to  = 'Louie Miranda louiemira...@example.com';
$this-Email-subject = 'Test / Developer Code PHP CAKEPHP';
$this-Email-send('Hello message body from LOUIE MIRANDA
CAKEPHP!');
}

}

It's actually very simple. Just add the email component and create a
function.

--
Louie Miranda
 - Email: lmira...@gmail.com
 - Web: http://www.louiemiranda.com



On Thu, Jul 29, 2010 at 10:41 AM, huoxito huox...@gmail.com wrote:

 Am I the only one who finds the Email Component doc,
 http://book.cakephp.org/view/1286/Sending-a-basic-message, really
 weird?

 I mean i'll have to try out a lot of things here to understand how it
 works...

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Model like both ACO and ARO in ACL

2010-07-29 Thread marco.rizze...@gmail.com
Hi  is it possible use a model in Acl both ARO and ACO?
Thanks
Marco

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Where is the problem in my validations

2010-07-29 Thread CakeMan
Hi,

Is there any problem with this Validation array in my model :

var $validate=array
 (
  'email'= array
  (

'rule'='NonEmpty',

'message'='Please provide valid Email.'
),
   'password'= array
   (
 'rule' 
='NonEmpty',
 
'message'='Please provide Password.'
 )
);



it is giving me error as below :-
Warning (2): preg_match() [function.preg-match]: Delimiter must not be
alphanumeric or backslash [CORE\cake\libs\model\model.php, line 2571]

I am using Cake1.3

Please help

Thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Where is the problem in my validations

2010-07-29 Thread Tilen Majerle
yes, u have itit is not NonEmpty but is notEmpty xD
--
LP,
Tilen Majerle http://majerle.eu


2010/7/29 CakeMan narula.vi...@gmail.com

 Hi,

 Is there any problem with this Validation array in my model :

 var $validate=array
 (
  'email'= array
  (

  'rule'='NonEmpty',

  'message'='Please provide valid Email.'
),
   'password'= array
   (

 'rule' ='NonEmpty',

 'message'='Please provide Password.'
 )
);



 it is giving me error as below :-
 Warning (2): preg_match() [function.preg-match]: Delimiter must not be
 alphanumeric or backslash [CORE\cake\libs\model\model.php, line 2571]

 I am using Cake1.3

 Please help

 Thanks

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: problem select menu with optgroups

2010-07-29 Thread hoss7
@circket you fix my problem,i have litle problem i need like this:

?php echo $form-input('field', array('options' = array(1,2,3,4,5),
'empty' = '(choose one)')); ?

use 'empty' = '(choose one)' in echo $form-select('category_id',
$options); what i am must to do?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: PHP 5.2 no longer supported (Implications for cake 2.0) ??

2010-07-29 Thread keymaster
 I think it would be nice to see cake 2.0 follow Li3 and Symfony's
 direction and push the boundaries a bit by moving to 5.3 only.

Anyway you cut it, regardless of whether cake 2.0 is 5.3 only, or
5.2+, there is still an incredibly urgent need for an interim release
to get the antiquated php4 limitations out, and get with php5.

If that doesn’t happen soon, I fear no one will consider this
framework seriously for new adoption.

So,

Phase 1  - must contain basic things like:

- interfaces, abstract classes
- exceptions (throw/catch)
- static vars and functions
- visibility keywords
- argument hinting
- autoloading
- interceptors

Other things I think are do or die for phase 1:
-   Lazy loading of all cake elements (models, helpers, components)
-   Migration to PHPUnit
-   Include DebugKit as part of the cake core

Some people go crazy over the models returning data as objects instead
of arrays, but that doesn’t move me so much.

Phase 2 - incorporation of 5.3

- namespaces,
- late static binding,
- lambda functions,
- closures,
- iterators

.. as well as other functionality enhancements.

It would be very difficult to upgrade a cake 1.3 site directly to
phase-2, but is certainly doable to phase-1.

The above two phased approach, I believe, is basically the current
cake roadmap. The only remark I would make, is the current roadmap
should clearly indicate an intent to adopt 5.3 features eventually,
and to frame the cake 2.0 release as an intermediate phase 1, on the
road towards that.

But we really, desperately need to get with the rest of the world, and
asap put something out that has basic php5.2 functionality.

Trust the cake developers, they are pretty sensible people :-))

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: problem select menu with optgroups

2010-07-29 Thread hoss7
can you convert $form-select to $form-input in view?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Model like both ACO and ARO in ACL

2010-07-29 Thread marco.rizze...@gmail.com
Can someone some suggestion for me?
Thanks

On 29 Lug, 09:41, marco.rizze...@gmail.com
marco.rizze...@gmail.com wrote:
 Hi  is it possible use a model in Acl both ARO and ACO?
 Thanks
 Marco

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Controller not working on live site

2010-07-29 Thread meekamoo
Hey guys,

Have a weird problem here - site works fine on local server but as
soon as I upload it to the live site I have this very strange problem.

I have a properties controller (guessed it, a property site). When I
view /properties/index on local site it correctly displays all the
properties.

On the live site I get a Ooops 500 Controller not found, Please
create /controllers/500.shtml_controller.php

I have no idea why it is doing this!

Can anyone point me int he right direction as to where I should be
looking to source this error? The rest of the site works 100%.

I have no routes that would conflict with this (only the / = homepage
(not properties controller), /pages = content and /admin routes are
set)

Not sure why it's doing this?!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Controller not working on live site

2010-07-29 Thread meekamoo
Forgot to mention that I have looked in:

app_controller.php
app_model.php
core.php
bootstrap.php
routes.php

And I cant't find anything there that would cause this?

On Jul 29, 1:58 pm, meekamoo bryanpadd...@gmail.com wrote:
 Hey guys,

 Have a weird problem here - site works fine on local server but as
 soon as I upload it to the live site I have this very strange problem.

 I have a properties controller (guessed it, a property site). When I
 view /properties/index on local site it correctly displays all the
 properties.

 On the live site I get a Ooops 500 Controller not found, Please
 create /controllers/500.shtml_controller.php

 I have no idea why it is doing this!

 Can anyone point me int he right direction as to where I should be
 looking to source this error? The rest of the site works 100%.

 I have no routes that would conflict with this (only the / = homepage
 (not properties controller), /pages = content and /admin routes are
 set)

 Not sure why it's doing this?!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


save data problem

2010-07-29 Thread hoss7
i have this array:

Array
(
[Usercat] = Array
(
[subcat_id] = Array
(
[0] = 3
[1] = 1
)

[user_id] = 7
)

)

if i have subcat array i cant use this for save all data for one user:

$this-Usercat-create();
if ($this-Usercat-save($this-data)) {
$this-Session-setFlash(__('اyes, true));
$this-redirect(array('action' = 'index'));
} else {
$this-Session-setFlash(__('no', true));
}

and i want save all data for one user,what i am must to do?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Model like both ACO and ARO in ACL

2010-07-29 Thread AD7six


On Jul 29, 1:16 pm, marco.rizze...@gmail.com
marco.rizze...@gmail.com wrote:
 Can someone some suggestion for me?

Yes.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Best place to put constants?

2010-07-29 Thread Hugo M
Thanks! Yeah I thought that bootstrap could be for that, thanks!

2010/7/27 Dr. Loboto drlob...@gmail.com:
 bootstrap.php is for this purpose. Other files may be needed too if
 you need to setup a lot of data.
 Better do not touch core.php with custom variable set as it may change
 with Cake update and yours code there may make this update harder.

 On Jul 28, 1:15 am, Hugo M ham1...@gmail.com wrote:
 Hi all! What is the best place to put configuration variables (like
 Configure::write('bla', 'bla2'))? I'm doing that in core.php

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

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


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Email Component

2010-07-29 Thread huoxito
Yes i got that, but what i found strange is that the cakebook says we
have to create 'html' and 'text' in both views and elements
directory

besides why would i use both 'text' and 'html' if one of them is
enough to customize my emails...

and when we set the template using the Email Component it seems to
refer to the files in the views/elements/email directory and no the
ones in views/email directory




On 29 jul, 04:13, Louie Miranda lmira...@gmail.com wrote:
 Try this..

 class AccountsController extends AppController
 {
     var $name = Accounts;
     var $components = array('Email');

     function email() {
         $this-Email-from    = 'Somebody someb...@example.com';
         $this-Email-to      = 'Louie Miranda louiemira...@example.com';
         $this-Email-subject = 'Test / Developer Code PHP CAKEPHP';
         $this-Email-send('Hello message body from LOUIE MIRANDA
 CAKEPHP!');
     }

 }

 It's actually very simple. Just add the email component and create a
 function.

 --
 Louie Miranda
  - Email: lmira...@gmail.com
  - Web:http://www.louiemiranda.com



 On Thu, Jul 29, 2010 at 10:41 AM, huoxito huox...@gmail.com wrote:
  Am I the only one who finds the Email Component doc,
 http://book.cakephp.org/view/1286/Sending-a-basic-message, really
  weird?

  I mean i'll have to try out a lot of things here to understand how it
  works...

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
  with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.c­omFor
   more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


time helpers question

2010-07-29 Thread amititi
Hello, I'm learning cake using the Beginning CakePHP: From Novice to
Professional and i got to a point where it gives me an exercise and i
can't figure it out. It look like these :

use the nice() function to make the
$post['Post']['date'] value more readable. Hint: you’ll need to pass
the variable to the function for it to
work properly.

Can you share a thought? help me understand the mechanism/logic of
this ?? thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


using cakephp Bake

2010-07-29 Thread rusik
Hello, when i am using bake(from cmd in windows7,xampp),when i am
finishing db configuration, i see the error:
---
The following database configuration will be created:
---
Name: default
Driver:   mysql
Persistent:   false
Host: localhost
User: root
Pass:
Database: guestbook
---
Look okay? (y/n)
[y]  y
Do you wish to add another database configuration?
[n]  n

Fatal error: Class 'DATABASE_CONFIG' not found in C:\xampp\htdocs
\guestbook\cake
\console\libs\tasks\db_config.php on line 260

How to correct it?
Thanks for attention:)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


add logged user infos in the setFlash message after login

2010-07-29 Thread Melody Nelson
hi (and sorry for my english),

I'm using cake 1.3

I don't find how I can add infos of the logged user in the setFlash
message after the login

I found how to do it in views but I want to do it in the controller to
use it a growl message

function login() {
$txt = bla bla bla ;
//$user = $this-Session-read('Auth.User.first_name');
//$user = $this-Auth-user('first_name');
$user = $_SESSION['Auth']['User']['first_name'];
$this-Session-setFlash($txt.$user, 'growl',
array('type'='important'));
}

thanks for your help

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Amazon FPS integration

2010-07-29 Thread FandaR
Hello, isnt there some cakephp component for Amazon payment gateway?
I need to use Amazon reccuring payments on cakephp site.

Any help will be appreciated
Thank You

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


cakePHP and XAMPP portable

2010-07-29 Thread Haretuerk
Hi folks,

i have problems running cakePHP on an XAMPP portable installation on
an USB-Stick.
Despite the setting in the database.php are correct it is not possible
to connect to the MySQL database.

Error message: Cake is NOT able to connect to the database.

But the database is definitly running properly .

Any ideas?

Thanks,

regard Haretuerk

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: save data problem

2010-07-29 Thread bogdanv
You can override method save in the model.

On Jul 29, 3:48 pm, hoss7 hoss...@gmail.com wrote:
 i have this array:

 Array
 (
     [Usercat] = Array
         (
             [subcat_id] = Array
                 (
                     [0] = 3
                     [1] = 1
                 )

             [user_id] = 7
         )

 )

 if i have subcat array i cant use this for save all data for one user:

 $this-Usercat-create();
                         if ($this-Usercat-save($this-data)) {
                                 $this-Session-setFlash(__('اyes, true));
                                 $this-redirect(array('action' = 'index'));
                         } else {
                                 $this-Session-setFlash(__('no', true));
                         }

 and i want save all data for one user,what i am must to do?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Can't find post

2010-07-29 Thread Alexandru Amititeloae
Hello, i've starded a post a few days ago and i can't seem to find it. It
was something related to time helpers nice() function, and i was looking
forward to other users responses cand u help me ?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Email Component

2010-07-29 Thread AD7six


On Jul 29, 3:25 pm, huoxito huox...@gmail.com wrote:
 Yes i got that, but what i found strange is that the cakebook says we
 have to create 'html' and 'text' in both views and elements
 directory

Where does it say that ( I think you're misreading something ).


 besides why would i use both 'text' and 'html' if one of them is
 enough to customize my emails...

If you plan on sending out text-only emails that's a fair argument. if
you're thinking of sending out html-only emails well ...


 and when we set the template using the Email Component it seems to
 refer to the files in the views/elements/email directory

Exactly like it says on the tin (in the book) :)

 and no the
 ones in views/email directory

where did you read it would look in views/email?

rgds,

AD

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: cakePHP and XAMPP portable

2010-07-29 Thread Tilen Majerle
is mysql server running?
--
LP,
Tilen Majerle http://majerle.eu


2010/7/29 Haretuerk haretu...@googlemail.com

 Hi folks,

 i have problems running cakePHP on an XAMPP portable installation on
 an USB-Stick.
 Despite the setting in the database.php are correct it is not possible
 to connect to the MySQL database.

 Error message: Cake is NOT able to connect to the database.

 But the database is definitly running properly .

 Any ideas?

 Thanks,

 regard Haretuerk

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: save data problem

2010-07-29 Thread hoss7
@bogdanv can you show me,i am new in cakephp,if you want more
information just aks?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: time helpers question

2010-07-29 Thread Mike Karthauser

On Wed, July 28, 2010 5:48 pm, amititi wrote:
 Hello, I'm learning cake using the Beginning CakePHP: From Novice to
 Professional and i got to a point where it gives me an exercise and i
 can't figure it out. It look like these :

 use the nice() function to make the
 $post['Post']['date'] value more readable. Hint: you’ll need to pass
 the variable to the function for it to
 work properly.


er.

echo $this-Time-nice($post['Post']['date'])

 Can you share a thought? help me understand the mechanism/logic of
 this ?? thanks


-- 
Mike Karthauser
Managing Director - Brightstorm Ltd

Email: mi...@brightstorm.co.uk
Web: http://www.brightstorm.co.uk
Tel:  07939 252144 (mobile)
Fax: 0870 1320560

Address: 1 Brewery Court, North Street, Bristol, BS3 1JS

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Model like both ACO and ARO in ACL

2010-07-29 Thread Xander
I didn't find any predefined way to set the model as both Aco  Aro,
so I made it Aco only and I added some code to afterSave() (when
$created is true) and beforeDelete() callbacks wich creates and
deletes aro nodes.

On 29 Lip, 13:16, marco.rizze...@gmail.com
marco.rizze...@gmail.com wrote:
 Can someone some suggestion for me?
 Thanks

 On 29 Lug, 09:41, marco.rizze...@gmail.com



 marco.rizze...@gmail.com wrote:
  Hi  is it possible use a model in Acl both ARO and ACO?
  Thanks
  Marco

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Model like both ACO and ARO in ACL

2010-07-29 Thread marco.rizze...@gmail.com
Can you tell me how the model has to be configurated?

On 29 Lug, 15:04, AD7six andydawso...@gmail.com wrote:
 On Jul 29, 1:16 pm, marco.rizze...@gmail.com

 marco.rizze...@gmail.com wrote:
  Can someone some suggestion for me?

 Yes.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Controller not working on live site

2010-07-29 Thread Dr. Loboto
Something on this URL issues error 500, Apache tries to show
appropriate error page, but there is no 500.shtml in your webroot, so
Cake catch this request and looks for 500.shtml controller.

Check Apache error log.

On Jul 29, 7:01 pm, meekamoo bryanpadd...@gmail.com wrote:
 Forgot to mention that I have looked in:

 app_controller.php
 app_model.php
 core.php
 bootstrap.php
 routes.php

 And I cant't find anything there that would cause this?

 On Jul 29, 1:58 pm, meekamoo bryanpadd...@gmail.com wrote:



  Hey guys,

  Have a weird problem here - site works fine on local server but as
  soon as I upload it to the live site I have this very strange problem.

  I have a properties controller (guessed it, a property site). When I
  view /properties/index on local site it correctly displays all the
  properties.

  On the live site I get a Ooops 500 Controller not found, Please
  create /controllers/500.shtml_controller.php

  I have no idea why it is doing this!

  Can anyone point me int he right direction as to where I should be
  looking to source this error? The rest of the site works 100%.

  I have no routes that would conflict with this (only the / = homepage
  (not properties controller), /pages = content and /admin routes are
  set)

  Not sure why it's doing this?!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Controller not working on live site

2010-07-29 Thread meekamoo
Yeah had a look at apache error logs - nothing there at all. No
errors.

I have found the problem line (I have NO idea how this can be broken)

$data = $this-paginate('Property');

If I do this:

pr($this-paginate);
$data = $this-paginate('Property');

Then it just prints out the paginate array without any layout.

// pr($this-paginate);
$data = $this-paginate('Property');

If I comment out that pr() line then I get the full 500 error with
layout.

I'm running php-5.2.13 and mysql-5.1. Site runs fine on my dev server
at home with php-5.1.13 and mysql-5.0

Site has exact same configuration as home server, site runs in the
root folder on its own domain. I tried uploading the cake/ folder
again but no avail. I've even re-uploaded the entire site from dev-
live again. Still nothing.

Pulling my hair out!

On Jul 29, 4:33 pm, Dr. Loboto drlob...@gmail.com wrote:
 Something on this URL issues error 500, Apache tries to show
 appropriate error page, but there is no 500.shtml in your webroot, so
 Cake catch this request and looks for 500.shtml controller.

 Check Apache error log.

 On Jul 29, 7:01 pm, meekamoo bryanpadd...@gmail.com wrote:



  Forgot to mention that I have looked in:

  app_controller.php
  app_model.php
  core.php
  bootstrap.php
  routes.php

  And I cant't find anything there that would cause this?

  On Jul 29, 1:58 pm, meekamoo bryanpadd...@gmail.com wrote:

   Hey guys,

   Have a weird problem here - site works fine on local server but as
   soon as I upload it to the live site I have this very strange problem.

   I have a properties controller (guessed it, a property site). When I
   view /properties/index on local site it correctly displays all the
   properties.

   On the live site I get a Ooops 500 Controller not found, Please
   create /controllers/500.shtml_controller.php

   I have no idea why it is doing this!

   Can anyone point me int he right direction as to where I should be
   looking to source this error? The rest of the site works 100%.

   I have no routes that would conflict with this (only the / = homepage
   (not properties controller), /pages = content and /admin routes are
   set)

   Not sure why it's doing this?!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: problem select menu with optgroups

2010-07-29 Thread cricket
On Thu, Jul 29, 2010 at 3:01 AM, hoss7 hoss...@gmail.com wrote:
 i have cakephp 1.3.2 i cant use this:
 $this-set(compact($options));
 i fix my Undefined variable: options error with this:
 $this-set(compact('options'));

 but thank you

Sorry about that. I missed the $ in there. My bad.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: problem select menu with optgroups

2010-07-29 Thread cricket
On Thu, Jul 29, 2010 at 6:14 AM, hoss7 hoss...@gmail.com wrote:
 @circket you fix my problem,i have litle problem i need like this:

 ?php echo $form-input('field', array('options' = array(1,2,3,4,5),
 'empty' = '(choose one)')); ?

 use 'empty' = '(choose one)' in echo $form-select('category_id',
 $options); what i am must to do?


$this-Form-select('Model.field', $options, 'choose one'));

http://api.cakephp.org/class/form-helper#method-FormHelperselect

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: problem select menu with optgroups

2010-07-29 Thread cricket
On Thu, Jul 29, 2010 at 6:45 AM, hoss7 hoss...@gmail.com wrote:
 can you convert $form-select to $form-input in view?

In some cases, yes, FormHelper will create a select list with the
input() method. It depends on what you pass to it. I prefer to use
select() as it's more intuitive.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Controller not working on live site

2010-07-29 Thread cricket
On Thu, Jul 29, 2010 at 10:59 AM, meekamoo bryanpadd...@gmail.com wrote:
 Yeah had a look at apache error logs - nothing there at all. No
 errors.

 I have found the problem line (I have NO idea how this can be broken)

    $data = $this-paginate('Property');

 If I do this:

    pr($this-paginate);
    $data = $this-paginate('Property');

 Then it just prints out the paginate array without any layout.

    // pr($this-paginate);
    $data = $this-paginate('Property');

 If I comment out that pr() line then I get the full 500 error with
 layout.

 I'm running php-5.2.13 and mysql-5.1. Site runs fine on my dev server
 at home with php-5.1.13 and mysql-5.0

 Site has exact same configuration as home server, site runs in the
 root folder on its own domain. I tried uploading the cake/ folder
 again but no avail. I've even re-uploaded the entire site from dev-
live again. Still nothing.

What does your paginate array look like? Any joins or anything like
that? I'm wondering if it's due to the MySQL version. I remember (but
no specifics) that I have run into issues between those two. Although,
I don't believe that was a Cake site.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Where is the problem in my validations

2010-07-29 Thread CakeMan
Well, Validations are working perfectly (giving error message) except
that error in 2571 line with this NonEmpty ??? Strange ??

On Jul 29, 1:12 pm, Tilen Majerle tilen.maje...@gmail.com wrote:
 yes, u have itit is not NonEmpty but is notEmpty xD
 --
 LP,
 Tilen Majerlehttp://majerle.eu

 2010/7/29 CakeMan narula.vi...@gmail.com

  Hi,

  Is there any problem with this Validation array in my model :

  var $validate=array
                                  (
                                   'email'= array
                                                                   (

   'rule'='NonEmpty',

   'message'='Please provide valid Email.'
                                                                         ),
                                    'password'= array
                                                                    (

  'rule' ='NonEmpty',

  'message'='Please provide Password.'
                                                                          )
                                         );

  it is giving me error as below :-
  Warning (2): preg_match() [function.preg-match]: Delimiter must not be
  alphanumeric or backslash [CORE\cake\libs\model\model.php, line 2571]

  I am using Cake1.3

  Please help

  Thanks

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
  with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Where is the problem in my validations

2010-07-29 Thread euromark
you might wanna re-read Tilen Majerle's answer...


On 29 Jul., 18:25, CakeMan narula.vi...@gmail.com wrote:
 Well, Validations are working perfectly (giving error message) except
 that error in 2571 line with this NonEmpty ??? Strange ??

 On Jul 29, 1:12 pm, Tilen Majerle tilen.maje...@gmail.com wrote:



  yes, u have itit is not NonEmpty but is notEmpty xD
  --
  LP,
  Tilen Majerlehttp://majerle.eu

  2010/7/29 CakeMan narula.vi...@gmail.com

   Hi,

   Is there any problem with this Validation array in my model :

   var $validate=array
                                   (
                                    'email'= array
                                                                    (

    'rule'='NonEmpty',

    'message'='Please provide valid Email.'
                                                                          ),
                                     'password'= array
                                                                     (

   'rule' ='NonEmpty',

   'message'='Please provide Password.'
                                                                           )
                                          );

   it is giving me error as below :-
   Warning (2): preg_match() [function.preg-match]: Delimiter must not be
   alphanumeric or backslash [CORE\cake\libs\model\model.php, line 2571]

   I am using Cake1.3

   Please help

   Thanks

   Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others
   with their CakePHP related questions.

   You received this message because you are subscribed to the Google Groups
   CakePHP group.
   To post to this group, send email to cake-php@googlegroups.com
   To unsubscribe from this group, send email to
   cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.c
omFor more options, visit this group at
  http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: save data problem

2010-07-29 Thread bogdanv
in the Usercat model create method save like in the  cake/libs/model/
model.php

function save($data = null, $validate = true, $fieldList = array()) {
  put your code here
  then

  return parrent:: save($data, $validate, $fieldList) ;
  or
  put parrent:: save(..) into a cycle depending what you want to do.
}


Or maybe can use beforeSave() callbacks ... I don't know what you are
going to do ...

On Jul 29, 5:24 pm, hoss7 hoss...@gmail.com wrote:
 @bogdanv can you show me,i am new in cakephp,if you want more
 information just aks?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: save data problem

2010-07-29 Thread bogdanv
Sorry parrent  = parent :)

On Jul 29, 7:58 pm, bogdanv vivianbog...@gmail.com wrote:
 in the Usercat model create method save like in the  cake/libs/model/
 model.php

 function save($data = null, $validate = true, $fieldList = array()) {
   put your code here
   then

   return parrent:: save($data, $validate, $fieldList) ;
   or
   put parrent:: save(..) into a cycle depending what you want to do.

 }

 Or maybe can use beforeSave() callbacks ... I don't know what you are
 going to do ...

 On Jul 29, 5:24 pm, hoss7 hoss...@gmail.com wrote:

  @bogdanv can you show me,i am new in cakephp,if you want more
  information just aks?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Amazon FPS integration

2010-07-29 Thread Nabil Alsharif
Not unless google has something good It shouldn't be to hard to
make your own.

On Wed, Jul 28, 2010 at 5:41 PM, FandaR fandarem...@gmail.com wrote:
 Hello, isnt there some cakephp component for Amazon payment gateway?
 I need to use Amazon reccuring payments on cakephp site.

 Any help will be appreciated
 Thank You

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

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


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: save data problem

2010-07-29 Thread hoss7
i have this array and user can choice many subcat:


Array
(
[Usercat] = Array
(
[subcat_id] = Array
(
[0] = 3
[1] = 1
)

[user_id] = 7
)

)

you say i can use this:

function save($data = null, $validate = true, $fieldList = array()) {
  put your code here  =what code?
  then

  return parrent:: save($data, $validate, $fieldList) ; = where?
  or
  put parrent:: save(..) into a cycle depending what you want to do.

}

but can you explain more about save function,i think you need more
information about my problem

i have 2 table: 1.subcats 2.usercats this is sql:

CREATE TABLE IF NOT EXISTS `subcats` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `cat_id` int(11) NOT NULL,
  `title` varchar(255) COLLATE utf8_persian_ci NOT NULL,
  `status` int(2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci
AUTO_INCREMENT=4 ;

--
-- Dumping data for table `subcats`
--

INSERT INTO `subcats` (`id`, `cat_id`, `title`, `status`) VALUES
(1, 2, 'sub2-1', 0),
(2, 2, 'sub2-2', 0),
(3, 1, 'sub1-1', 0);

-- 

--
-- Table structure for table `usercats`
--

CREATE TABLE IF NOT EXISTS `usercats` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `subcat_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci
AUTO_INCREMENT=11 ;

--
-- Dumping data for table `usercats`
--

INSERT INTO `usercats` (`id`, `user_id`, `subcat_id`) VALUES
(3, 1, 1),
(4, 6, 2),
(10, 7, 1);

and my model:
subcat:
var $hasMany = array(
'Usercat' = array(
'className' = 'Usercat',
'foreignKey' = 'subcat_id',
'dependent' = false,
'conditions' = '',
'fields' = '',
'order' = '',
'limit' = '',
'offset' = '',
'exclusive' = '',
'finderQuery' = '',
'counterQuery' = ''
)
);

and usercat:

var $belongsTo = array(
'Subcat' = array(
'className' = 'Subcat',
'foreignKey' = 'subcat_id',
'conditions' = '',
'fields' = '',
'order' = ''
)
);

and in my UsercatsController:

function add() {
if (!empty($this-data)) {
$this-Usercat-create();
if ($this-Usercat-save($this-data)) {
$this-Session-setFlash(__('yes', true));
$this-redirect(array('action' = 'index'));
} else {
$this-Session-setFlash(__('no', true));
}
}else {
$this-Session-setFlash(__('no', true));
$this-redirect(array('controller' = 
'Subcats','action' =
'usercat'));

}
}
and in usercat view:

i have multiple select for user can choice many values

i want save all values in `usercats` with one user id, i can only save
one value but i want save all value,i think i must create some
function like you say,but i am new in cakephp,please help me step by
step

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: problem select menu with optgroups

2010-07-29 Thread hoss7
thank you,you are my hero, can i ask you one question about my problem
to save data?
if you want help me please see this link:
http://groups.google.com/group/cake-php/t/6749e1ba04af243a

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: PHP 5.2 no longer supported (Implications for cake 2.0) ??

2010-07-29 Thread Zaky Katalan-Ezra
I couldn't agree more.
I would transfer namespaces to phase one.
namespaces are key consept when developing frameworks and libraries.
These feature you mentioned in phase one are trivial in real OOP languages
like Python, Java and C#, the lake of them make OOP developer think PHP is
not a real production language.
I am glad I got rid of this thought after working with cake for the last six
month.


On Thu, Jul 29, 2010 at 1:39 PM, keymaster ad...@optionosophy.com wrote:

  I think it would be nice to see cake 2.0 follow Li3 and Symfony's
  direction and push the boundaries a bit by moving to 5.3 only.

 Anyway you cut it, regardless of whether cake 2.0 is 5.3 only, or
 5.2+, there is still an incredibly urgent need for an interim release
 to get the antiquated php4 limitations out, and get with php5.

 If that doesn’t happen soon, I fear no one will consider this
 framework seriously for new adoption.

 So,

 Phase 1  - must contain basic things like:

 - interfaces, abstract classes
 - exceptions (throw/catch)
 - static vars and functions
 - visibility keywords
 - argument hinting
 - autoloading
 - interceptors

 Other things I think are do or die for phase 1:
 -   Lazy loading of all cake elements (models, helpers, components)
 -   Migration to PHPUnit
 -   Include DebugKit as part of the cake core

 Some people go crazy over the models returning data as objects instead
 of arrays, but that doesn’t move me so much.

 Phase 2 - incorporation of 5.3

 - namespaces,
 - late static binding,
 - lambda functions,
 - closures,
 - iterators



Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


cakephp cron job tutorial

2010-07-29 Thread hoss7
i need cakephp cron job tutorial?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Editing .xls files

2010-07-29 Thread srumjant
Thanks,

It was really helpful tip.
I found on bakery helper for that too and modified it for my needs.
http://bakery.cakephp.org/articles/view/simple-excel-spreadsheet-helper

I left modifed version is in comments.

On Jul 28, 11:56 am, Tonu Tusk lvot...@googlemail.com wrote:
 Hi there, this might be overkill for your needs, but I have used the
 following lib in some of my projects.

 http://phpexcel.codeplex.com/

 It may be the case that when you write the document it is in a
 different internal excel format (even though it can still retain the
 xls filename) but it is worth a look to see if it
 will fit your needs.

 On Jul 27, 7:28 pm, srumjant sr.and.b...@gmail.com wrote:

  Hello,

  I have a .xls file and I would like to know if there is a way to
  change data in it somehow using some php library or even better some
  kind helper for cakephp.
  I have checked this helper 
  -http://ykyuen.wordpress.com/2009/10/04/cakephp-export-data-to-a-xls-f...
  But it would be really hard to build up xls file with same layout
  using that code.

  All kind of help would be helpful.

  -
  srumjant

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Getting Digest Authentication to Work

2010-07-29 Thread Michael
I am having difficulty getting digest authentication to work.  The
code works if I use basic, but when I switch to digest, the
credentials don't authenticate (i.e. the browser username/password
popup keeps displaying).  I have tried to md5 hash the password and
leave it plain text and neither works.

Here's the code that works (basic authentication):

function beforeFilter() {
if ( $this-RequestHandler-isXml() ) {
$this-Auth-allow('index');
$this-Security-loginOptions = array(
'type' = 'basic',
'realm' = 'WebService'
);
$this-Security-loginUsers = array('user' = 'secret');

$this-Security-requireLogin('index');
} else {
parent::beforeFilter();
}
}

And here's the code that doesn't (digest authentication):

function beforeFilter() {
if ( $this-RequestHandler-isXml() ) {
$this-Auth-allow('index');
$this-Security-loginOptions = array(
'type' = 'digest',
'realm' = 'WebService'
);
$this-Security-loginUsers = array('user' = 'secret');
/*  $this-Security-loginUsers = array('user' = 
md5('secret')); */

$this-Security-requireLogin('index');
} else {
parent::beforeFilter();
}
}


What am I still missing?

Note, I'm using CakePHP 1.2.5.  Web server is Apache 1.3.41.  PHP is
5.2.9.

thanks in advance,
Michael

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: save data problem

2010-07-29 Thread bogdanv
I hope this help you

public function save($data = null, $validate = true, $fieldList =
array()) {
$return = false;
if (isset($data['Usercat']['subcat_id'])  
is_array($data['Usercat']
['subcat_id'])) {
foreach ($data['Usercat']['subcat_id'] as $subcat) {
$saveData = array(
'user_id' = 
$data['Usercat']['user_id'],
'subcat_id' = $subcat,
);
$this-create();
$return = parent::save($saveData); // here can 
add some tests ...
}
}
return $return;
}

On Jul 29, 8:27 pm, hoss7 hoss...@gmail.com wrote:
 i have this array and user can choice many subcat:

 Array
 (
     [Usercat] = Array
         (
             [subcat_id] = Array
                 (
                     [0] = 3
                     [1] = 1
                 )

             [user_id] = 7
         )

 )

 you say i can use this:

 function save($data = null, $validate = true, $fieldList = array()) {
   put your code here  =what code?
   then

   return parrent:: save($data, $validate, $fieldList) ; = where?
   or
   put parrent:: save(..) into a cycle depending what you want to do.

 }

 but can you explain more about save function,i think you need more
 information about my problem

 i have 2 table: 1.subcats 2.usercats this is sql:

 CREATE TABLE IF NOT EXISTS `subcats` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
   `cat_id` int(11) NOT NULL,
   `title` varchar(255) COLLATE utf8_persian_ci NOT NULL,
   `status` int(2) NOT NULL,
   PRIMARY KEY (`id`)
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci
 AUTO_INCREMENT=4 ;

 --
 -- Dumping data for table `subcats`
 --

 INSERT INTO `subcats` (`id`, `cat_id`, `title`, `status`) VALUES
 (1, 2, 'sub2-1', 0),
 (2, 2, 'sub2-2', 0),
 (3, 1, 'sub1-1', 0);

 -- 

 --
 -- Table structure for table `usercats`
 --

 CREATE TABLE IF NOT EXISTS `usercats` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `user_id` int(11) NOT NULL,
   `subcat_id` int(11) NOT NULL,
   PRIMARY KEY (`id`)
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci
 AUTO_INCREMENT=11 ;

 --
 -- Dumping data for table `usercats`
 --

 INSERT INTO `usercats` (`id`, `user_id`, `subcat_id`) VALUES
 (3, 1, 1),
 (4, 6, 2),
 (10, 7, 1);

 and my model:
 subcat:
 var $hasMany = array(
                 'Usercat' = array(
                         'className' = 'Usercat',
                         'foreignKey' = 'subcat_id',
                         'dependent' = false,
                         'conditions' = '',
                         'fields' = '',
                         'order' = '',
                         'limit' = '',
                         'offset' = '',
                         'exclusive' = '',
                         'finderQuery' = '',
                         'counterQuery' = ''
                 )
         );

 and usercat:

 var $belongsTo = array(
                         'Subcat' = array(
                         'className' = 'Subcat',
                         'foreignKey' = 'subcat_id',
                         'conditions' = '',
                         'fields' = '',
                         'order' = ''
                 )
         );

 and in my UsercatsController:

 function add() {
                 if (!empty($this-data)) {
                         $this-Usercat-create();
                         if ($this-Usercat-save($this-data)) {
                                 $this-Session-setFlash(__('yes', true));
                                 $this-redirect(array('action' = 'index'));
                         } else {
                                 $this-Session-setFlash(__('no', true));
                         }
                 }else {
                         $this-Session-setFlash(__('no', true));
                         $this-redirect(array('controller' = 
 'Subcats','action' =
 'usercat'));

                 }
         }
 and in usercat view:

 i have multiple select for user can choice many values

 i want save all values in `usercats` with one user id, i can only save
 one value but i want save all value,i think i must create some
 function like you say,but i am new in cakephp,please help me step by
 step

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Model like both ACO and ARO in ACL

2010-07-29 Thread AD7six


On Jul 29, 4:32 pm, marco.rizze...@gmail.com
marco.rizze...@gmail.com wrote:
 Can you tell me how the model has to be configurated?

well, I misread your question. I don't think the core behavior will
allow act as both however you can just follow xander's lead.

hth,

AD

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Validation errors not shown in a form

2010-07-29 Thread Roland Pish
Hi.

Suddenly a form stopped showing the error messages with the div
class=error-message beside input fields with validation.
When a validation error occurs. If I debug($this-Themodel-
validationErrors) it shows me the errors but there is no div
class=error-message anymore.

What could be wrong?

I don't remember changing anything in cake's core.

Any clue on this?

Regards

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: adding additional jquery functionality on cake 1.3

2010-07-29 Thread Jon Chin
Thanks a bunch!  I read through the code snippet but haven't tried it yet.
 But I think this gives me a lot closer than anything else I've found on the
web.  I was hoping that there would be a way to utilize the Js helper rather
than output to $scripts_for_layout.  Thanks, though--this gives me a good
start!

On Fri, Jul 23, 2010 at 10:54 AM, cricket zijn.digi...@gmail.com wrote:

 On Fri, Jul 23, 2010 at 3:13 AM, Jon Chin port23u...@gmail.com wrote:
  I followed the tutorial for getting Jquery set up on Cake 1.3, but now
 I'm
  having trouble getting Jquery plugins to work.  I haven't been able to
 find
  any webpages or tutorials for this, so I'm asking here.  I think what I
 need
  to do is somehow get the code for the plugin to get added to the buffer
 and
  in the $(document).ready function.  Maybe extend the jquery_engine?  I'm
 not
  sure how to do it, so can anybody steer me in the right direction?
  Thanks!

 In what sense is it not working? When you view source, do you see
 script tags for the plugin(s)? If so, is the path correct? How are you
 trying to include them? In the layout? View? Show some code; perhaps
 you have an error there.

 As for adding things to $(document).ready() note that jquery can
 handle multiple calls to that. IOW, you can have a ready() block in
 your global.js, your admin.js, in one or more script blocks in the
 head, etc. So, let's say you want to add a WYSIWYG editor to some
 view. You can include the necessary plugin from the view as well as a
 JS block with the plugin's init code inside another call to
 $(document).ready().

 layout:
 echo $html-script('lib/jquery-1.4.1.min');
 echo $html-script('global');
 echo $scripts_for_layout;

 view:
 echo $this-element('wysiwyg', array('selectors' =
 array('#PageContent'), 'upload_path' = '/uploads'));

 element:
 $html-css('jwysiwyg/jquery.wysiwyg', 'stylesheet',
 array('media'='screen,projector', 'inline' = false));
 echo $html-script('lib/jquery.form.min', false);
 echo $html-script('lib/jquery.wysiwyg', false);
 echo $html-script('editor', false);

 $code = '$(function() { ';
 foreach($selectors as $selector)
 {
if (empty($upload_path)) $upload_path = null;
$code .= initEditor('${selector}', '${upload_path}');\n;
 }
 $code .= '});';
 $html-scriptBlock($code, array('inline' = false));

 The scriptBlock method will add a new call to ready() (I'm using a
 slightly different jquery syntax here) into $scripts_for_layout.

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Validation errors not shown in a form

2010-07-29 Thread Norman Paniagua
Can you show your code?
---

Norman Paniagua


2010/7/29 Roland Pish rolandp...@gmail.com

 Hi.

 Suddenly a form stopped showing the error messages with the div
 class=error-message beside input fields with validation.
 When a validation error occurs. If I debug($this-Themodel-
 validationErrors) it shows me the errors but there is no div
 class=error-message anymore.

 What could be wrong?

 I don't remember changing anything in cake's core.

 Any clue on this?

 Regards

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: save data problem

2010-07-29 Thread hoss7
thank you,  this function work for me, you are my hero

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


saveAll does'nt work

2010-07-29 Thread Jeremy
today, I find function saveAll can not work ,when save data into two
relations tables, blew is the data,

Array
(
[User] = Array
(
[username] = tester
[password] = 17acdc1ee8e4ed05e9d27fce4df6d4b5de036910
[email] = tes...@admin.com
[country_id] = 180
[captcha_input] = uhrfca
[reg_ip] = 172.16.5.73
[confirm_code] = 4c526005-2038-4c84-b01f-0ccec0a8061f
)

[UserProfile] = Array
(
[birth] = 2009-02-12
)

), and mysql ENGINE is MyISAM , anyone know the reason ?  help me !!!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: save data problem

2010-07-29 Thread hoss7
if i have other problem can i ask you in other time?
can i send you email?
are you in facebook,can you add me (http://www.facebook.com/hhoss)?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Where is the problem in my validations

2010-07-29 Thread Master Ram...!
in the view :

?php
if(! empty($message)) {

echo div class=\success\.$message./div;
}

if($form-isFieldError('Model_Name.field_name')) {

e($form-error ('Model_Name.field_name',
null,
array(
'class' = 'failure')));
}
?



in the model you can use this.

var $validate = array(

'email' = array(
'rule1' = array(
   'rule' = 'notEmpty',
   'required' = true,
   'allowEmpty' = false,
   'message' = 'Please enter a
value for the Email field',
'last' = true),
'rule2' = array(
'rule' = 'email',
'message' = 'Please enter a
proper Email Id'
),
  'unique' = array(
  'rule' = array('checkUnique',
'email'),
  'message' = 'A user with this email
address already exists, please try again.'
   )),


'password' = array(
'notempty' = array(
  'rule' = 'notEmpty',
   'required' = true,
   'allowEmpty' = false,
   'message' = 'Confirm
Password cannot be empty',
'last' = true
 ),
);


 function checkUnique ($data, $fieldName) {

$valid = false;

if ( isset($fieldName)  $this-hasField($fieldName)) {

$valid = $this-isUnique(array($fieldName = $data));
}

return $valid;
}

good luck..

















On Thu, Jul 29, 2010 at 10:22 PM, euromark dereurom...@googlemail.comwrote:

 you might wanna re-read Tilen Majerle's answer...


 On 29 Jul., 18:25, CakeMan narula.vi...@gmail.com wrote:
  Well, Validations are working perfectly (giving error message) except
  that error in 2571 line with this NonEmpty ??? Strange ??
 
  On Jul 29, 1:12 pm, Tilen Majerle tilen.maje...@gmail.com wrote:
 
 
 
   yes, u have itit is not NonEmpty but is notEmpty xD
   --
   LP,
   Tilen Majerlehttp://majerle.eu
 
   2010/7/29 CakeMan narula.vi...@gmail.com
 
Hi,
 
Is there any problem with this Validation array in my model :
 
var $validate=array
(
 'email'= array
 (
 
 'rule'='NonEmpty',
 
 'message'='Please provide valid Email.'
   
  ),
  'password'= array
  (
 
'rule' ='NonEmpty',
 
'message'='Please provide Password.'
   
   )
   );
 
it is giving me error as below :-
Warning (2): preg_match() [function.preg-match]: Delimiter must not
 be
alphanumeric or backslash [CORE\cake\libs\model\model.php, line 2571]
 
I am using Cake1.3
 
Please help
 
Thanks
 
Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
 others
with their CakePHP related questions.
 
You received this message because you are subscribed to the Google
 Groups
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com
 cake-php%2bunsubscr...@googlegroups.c omFor more options, visit this
 group at
   http://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




-- 
Master Ram.
Founder n Director of rgPlanets Pvt. Ltd.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to 

Re: saveAll does'nt work

2010-07-29 Thread Norman Paniagua
Can you put the model code?
---

Norman Paniagua


2010/7/30 Jeremy shimeilin1...@gmail.com

 today, I find function saveAll can not work ,when save data into two
 relations tables, blew is the data,

 Array
 (
[User] = Array
(
[username] = tester
[password] = 17acdc1ee8e4ed05e9d27fce4df6d4b5de036910
[email] = tes...@admin.com
[country_id] = 180
[captcha_input] = uhrfca
[reg_ip] = 172.16.5.73
[confirm_code] = 4c526005-2038-4c84-b01f-0ccec0a8061f
)

[UserProfile] = Array
(
[birth] = 2009-02-12
)

 ), and mysql ENGINE is MyISAM , anyone know the reason ?  help me !!!

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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