Re: Compare 2 date in cake3

2015-09-02 Thread Chetan Varshney
my solution did not work for you?

On Wed, Sep 2, 2015 at 1:43 PM, lorenzoshake <ferri.lore...@gmail.com>
wrote:

>
>
> Il giorno mercoledì 2 settembre 2015 02:24:34 UTC+2, Anthony GRASSIOT ha
> scritto:
>>
>> 'custom',['rule' =>  [$this, 'checkDate']]
>>
>> this doesn't seems to be a correct syntax... Why don't you use one of the
>> proposed solution ?
>>
>> $value->gte raise errors ( is a query method); the strange think is that:
>>
>> ->add('end_date', [
> 'valid'=> ['rule' => 'date'] ,
> 'compare' => [
> 'rule' => function ($value, $context) {
> $date_end = Time::createFromFormat('d/m/Y',$value);
> $date_start =
> Time::createFromFormat('d/m/Y',$context['data']['start_date']);
>
>// return ($date_start < $date_end);
> let's test!
> return false;
> }
> ]
>  ]
>
> );
>
> as  you can see i return always false ( just for testing) but the rule
> doesn't work :(
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

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

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


Re: Compare 2 date in cake3

2015-08-31 Thread Chetan Varshney
You can do like this.

->add('end_date', [
'mustValid'=>[
'rule'=>'checkForEndDate',
'provider'=>'table',
'message'=>__('End date should be greater than start
date')
]
])

and define following function in model table (in same class)

public function checkForEndDate($value, $context) {
   if(!empty($value) && !empty($context['data']['start_date'])) {
// may be you need to play with time object to compare dates
if($value <= $context['data']['start_date']) {
return false;
}
}
return true;
}

On Mon, Aug 31, 2015 at 9:53 PM, lorenzoshake <ferri.lore...@gmail.com>
wrote:

> I've been tried with:
>
> $validator ->add('end_date', [
> 'valid'=> ['rule' => 'date'] ,
> 'compare' =>['rule' => ['comparison', '>' ,'start_date']]
>  ]
> );
>
> but doesn't work;
>
> how to validate start_date and end_date ( end must be greater than
> start_date) ?
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

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

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


Re: User Management plugin

2014-06-12 Thread Chetan Varshney
Hi,

you can find latest version here http://usermgmt.ektanjali.com and full
premium version here http://umpremium.ektanjali.com


On Thu, Jun 12, 2014 at 3:20 PM, Alessandro Pellegrini 
eraunnanoraga...@gmail.com wrote:

 Hi everybody!
 I'm trying to use the Usermgmt plugin (
 https://github.com/chetanvarshney/User-Management-Plugin-for-Cakephp-2.x)
 but when I try to do the Sign up the e-mail is not sent. Is possible that
 the problem is about the proxy? Does anybody knows what can I do? Thanks!

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

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




-- 
Chetan Varshney

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

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


Re: Cakephp findById or find return garbage value with null id

2013-07-11 Thread Chetan Varshney
Hi,

I am not able to reproduce this issue any way. Which version of Cake are
you using?

However you can check id is null before calling findById function.

On Thu, Jul 11, 2013 at 2:40 PM, Abhay Jeet Singh abhayz...@gmail.comwrote:

 Hi,

I am fetching the data in foreach loop by id as attached file
 (secure_find.png). that return the garbage data for id null, although we
 have no record with id null.
i have imported a model to another model then fetching the data. Plz
 suggest.

 Thanks in advance!



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

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






-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

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

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




Re: Validate Question

2013-05-10 Thread Chetan Varshney
Create a variable in model
for e.g. in User model
var $auth;

and set this variable value from controller's beforeFilter function
$this-User-auth = $this-Session-read('Auth');

now you can access user id in User model this way

$userId =0;
if(!empty($this-auth['User']['id'])) {
$userId =$this-auth['User']['id'];
}


On Fri, May 10, 2013 at 4:24 PM, Advantage+ movepix...@gmail.com wrote:

 If the model has no access to Ssession data from correct MVC structure how
 do you validate user_id in the model when saving records?

 ** **

 Auth saves the user_id in the session when logged in but if you cannot get
 that in the model how do you verify the user_id?

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

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






-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

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

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




Re: Is it possible to add any date for saving in beforeSave method in app_controller.php

2013-04-28 Thread Chetan Varshney
You can do save these fields from app controller rather than you can do it
from app_model.

override beforeSave function and modify query for changed_by and modified_by

On Sun, Apr 28, 2013 at 10:56 PM, Zahidur Rahman zahidcuet...@yahoo.comwrote:

 Hi Experts,
 I have almost 23 table in which i have added created_by and modified_by
 field. Is there any way to save these two field from app_controller.php. I
 mean i dont want to add those field in eash method where i am saving. I
 want to do it from app_controller.php. Please let me know it is possible or
 not.

 Thanks
 Zahid

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

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






-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

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

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




Re: Is it possible to add any date for saving in beforeSave method in app_controller.php

2013-04-28 Thread Chetan Varshney
*Please ignore previous reply-*
Now
You *cannot* do save these fields from app controller rather than you can
do it from app_model.

override beforeSave function and modify query for changed_by and modified_by

On Sun, Apr 28, 2013 at 10:56 PM, Zahidur Rahman zahidcuet...@yahoo.comwrote:

 Hi Experts,
 I have almost 23 table in which i have added created_by and modified_by
 field. Is there any way to save these two field from app_controller.php. I
 mean i dont want to add those field in eash method where i am saving. I
 want to do it from app_controller.php. Please let me know it is possible or
 not.

 Thanks
 Zahid

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

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






-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

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

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




Looking for Cakephp Developer In India for full time job.

2013-02-20 Thread chetan varshney
We are looking for Cakephp Developer in India for full time job.

Company: Ektanjali Softwares Pvt Ltd (www.ektanjali.com)
Job Location: Noida, India
Job Description: Sound knowledge of programming and OOPs concepts, Very 
Strong Analytical and logical skills. Good Knowledge of Cakephp/ Mysql/ 
Ajax/ Jquery
Job Timing: Full Time (5 or 6 days in a week)
Salary: As per discussion

Interested Candidates can send their resumes at j...@ektanjali.com


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

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




Re: Deleting associated records

2013-01-12 Thread Chetan Varshney
Silly mistake-

check spelling of dependent in has many.

On Sat, Jan 12, 2013 at 9:58 AM, amit.sukapur...@gmail.com wrote:

 Hello Everyone,

 I need to delete associated records.

 I have tried but can't figure it out.

 Here is my situation,

 Database,

 questions {id(pk), question, answer}

 options {id(pk), question_id, option_value}

 Models,

 Question

 ..

 public $hasMany = array( 'Option' = array('dependant' = true));

 ..

 Option

 ..

 public $belongsTo = array( 'Question' );

 ..

 Controllers,

 QuestionController

 ..

 public function delete($id = null){

 $this-Question-delete($id,true)

 }

 ..

 Still its not working with deletion. Otherwise everything works fine about
 association.

 Please Help Me.

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

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






-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

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

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




Re: getting an error on $html-url

2012-11-09 Thread Chetan Varshney
Use as following.

?php echo $html-url(/group_banners/upload/. $group['Group']['id']
.?PHPSESSID= . session_id(), true) ?

On Sat, Nov 10, 2012 at 5:09 AM, Chris chris...@yahoo.com wrote:

 hi guys,... can someone help me please,... thanks in advance

 I'm getting an error when I include $group['Group']['id'] in $html-url

 ?php echo $html-url('/group_banners/upload/.
 $group['Group']['id']?PHPSESSID=' . session_id(), true) ?

 how can I do this?

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

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






-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

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

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




Re: Routing

2012-11-07 Thread Chetan Varshney
Use as following-

In routes.php

Router::connect('/contact', array('controller' = 'pages', 'action' =
'contact'));

or

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

and generate link as

One way

$this-Html-link( 'Contact', array('controller' = 'contact'));

Other way

a href=?php echo $this-Html-url('/contact'); ?Contact/a



On Wed, Nov 7, 2012 at 10:17 PM, Paul Willis paul.wil...@me.com wrote:

 Hi

 I'm on CakePHP 2.2.x and I've built all my site links in the format...

 $this-Html-link( 'Contact', array('controller' = 'pages', 'action' =
 'contact'));

 …which generates URLs like http://www.example.com/pages/contact and
 everything works. ie: /pages/contact shows my contact page.

 I've then added the line…

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

 …as the last rule in my routes file and so now I can use a URL like
 http://www.example.com/contact (without the /pages bit) and still get my
 contact page. All great so far.

 What I would like to do now is somehow set my links to generate the
 shortened URLs so $this-Html-link( 'Contact', array('controller' =
 'pages', 'action' = 'contact')); generates a URL
 http://www.example.com/contact rather than
 http://www.example.com/pages/contact

 Is this possible? I'm struggling to find a way to do it. If it is can
 someone point me to an example?

 Regards

 PW

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

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





-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

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

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




Re: preg_match Warning on Email

2012-11-02 Thread Chetan Varshney
For email validation you should use-

'email'= array(
'mustNotEmpty'=array(
'rule' = 'notEmpty',
'message'= __('Please enter email'),
'last'=true),
'mustBeEmail'= array(
'rule' = array('email'),
'message' = __('Please enter valid email'),
'last'=true)
),

and for deep checking

'email'= array(
'mustNotEmpty'=array(
'rule' = 'notEmpty',
'message'= __('Please enter email'),
'last'=true),
'mustBeEmail'= array(
'rule' = array('email', true),
'message' = __('Please enter valid email'),
'last'=true)
),



On Fri, Nov 2, 2012 at 7:05 PM, Chris chris...@yahoo.com wrote:

 hi guys,... I'm getting this preg_match Warning on Email issue no matter
 what I do,
 can anyone help me please,

 Warning (2): preg_match() [function.preg-match]: Delimiter must not be
 alphanumeric or backslash [APP/controllers/invitations_controller.php, line
 83]

 and this is what I have in a Model:

 var $validate = array(
   'email' = array(
   'rule' = 'alphaNumeric',
   'required' = true,
   'allowEmpty' = false,
  ),
  );

 thanks in advance,...
 chris

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

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






-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

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

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




Re: preg_match Warning on Email

2012-11-02 Thread Chetan Varshney
Now I assume you are taking input as comma separated multiple emails. If
yes
use code like.

In Model

email = array(
'mustNotEmpty'=array(
'rule' = 'notEmpty',
'message'= 'Please enter to email(s)',
'last'=true),
'mustBeEmail'= array(
'rule' = 'validateEmails',
'message'= '',
'last' = true)),

and put following function in same model

public function validateEmails($check) {
$emails = array_values($check);
$key = array_keys($check);
$emails = explode(',', $emails[0]);
foreach($emails as $email) {
$email = trim($email);
if(!empty($email)) {
$valid = Validation::email($email);
if(!$valid) {
$this-validationErrors[$key[0]][0]= 'You have an error
near '.$email;
break;
}
}
}
return true;
}


nothing to do in controller. only call validation method from controller.

good luck

On Fri, Nov 2, 2012 at 8:05 PM, Chris chris...@yahoo.com wrote:

 thank you for your reply chetan,...
 I'm steel getting an error:
 Warning (2): preg_match() [function.preg-match]: Delimiter must not be
 alphanumeric or backslash [APP/controllers/invitations_controller.php, line
 83]

 this is my invitations model:

 var $validate = array(
  'user_id' = array(
   'rule' = 'notEmpty',
   'message' = 'user must be valid',
  ),
 'email'= array(
 'mustNotEmpty'=array(
 'rule' = 'notEmpty',
 'message'= 'Please enter email',
 'last'=true),
 'mustBeEmail'= array(
 'rule' = array('email'),
 'message' = 'Please enter valid email',
 'last'=true)
 ),

  );

 and this is what I have in a invitations controller:
 $emails = array();

 if(!empty($this-data['Invitation']['emails']))
 {
   $raw_emails = explode(',', $this-data['Invitation']['emails']);
   foreach($raw_emails as $email)
   {
 $email = trim($email);
 if(preg_match('VALID_EMAIL', $email)) // This is where I'm
 getting an error...
   $emails[] = $email;
   }

  debug($email);

 I placed the debug in,... and I'm reading test email in the view,... but
 steel getting an error



 On Friday, November 2, 2012 6:52:42 AM UTC-7, chetan varshney wrote:

 For email validation you should use-

 'email'= array(
 'mustNotEmpty'=array(
 'rule' = 'notEmpty',
 'message'= __('Please enter email'),
 'last'=true),
 'mustBeEmail'= array(
 'rule' = array('email'),
 'message' = __('Please enter valid email'),
 'last'=true)
 ),

 and for deep checking

 'email'= array(
 'mustNotEmpty'=array(
 'rule' = 'notEmpty',
 'message'= __('Please enter email'),
 'last'=true),
 'mustBeEmail'= array(
 'rule' = array('email', true),
 'message' = __('Please enter valid email'),
 'last'=true)
 ),



  On Fri, Nov 2, 2012 at 7:05 PM, Chris chri...@yahoo.com wrote:

 hi guys,... I'm getting this preg_match Warning on Email issue no matter
 what I do,
 can anyone help me please,

 Warning (2): preg_match() [function.preg-match]: Delimiter must not be
 alphanumeric or backslash [APP/controllers/invitations_**controller.php,
 line 83]

 and this is what I have in a Model:

 var $validate = array(
   'email' = array(
   'rule' = 'alphaNumeric',
'required' = true,
   'allowEmpty' = false,
  ),
  );

 thanks in advance,...
  chris

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

 ---
 You received this message because you are subscribed to the Google
 Groups CakePHP group.
 To post to this group, send email to cake...@googlegroups.com.
 To unsubscribe from this group, send email to cake-php+u...@**
 googlegroups.com.

 Visit this group at 
 http://groups.google.com/**group/cake-php?hl=enhttp://groups.google.com/group/cake-php?hl=en
 .






 --
 Chetan Varshney
 Ektanjali Softwares Pvt Ltd

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

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






-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

Re: validate select field in a Model

2012-11-01 Thread Chetan Varshney
The logic you are trying to use it produce html as-

select
option value=0unknown/option
option value=1male/option
option value=2female/option
/select

So you should use in following way-

Configure::write('User.genders', array(''='unknown', '1'='male',
'2'='female'));

rest code is same


On Thu, Nov 1, 2012 at 3:53 PM, Chris chris...@yahoo.com wrote:


 hi guys,... I'm using cake 1.3
 how can I validate select field from Model,?

 what I have in bootstrap:
  Configure::write('User.genders', array('unknown', 'male', 'female'));

 in a view:
  tr
 tdstrong?php echo ucfirst(__('gender', true)) ?/strong
 ?php
  $genders = array(Configure::read('User.genders'));
 echo $this-Form-select('gender', $genders)
  ?
 /td
  /tr

 and in a Model:
   var $validate = array(
  'gender' = array(
   'rule' = 'notEmpty',
   'required' = true,
   'message' = 'Gender must be valid',
  ),
   );

 I'm not getting warning of red box with Gender must be valid

 how can I do this?

 thanks in advance
 chris

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

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






-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

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

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




Re: validate select field in a Model

2012-11-01 Thread Chetan Varshney
use like this

echo $this-Form-input(gender , array('type' = 'select',
'options'=$genders))?

good luck all set

On Thu, Nov 1, 2012 at 10:16 PM, Chris chris...@yahoo.com wrote:

 thanks chetan,... I have tried that too,... no luck,... steel having empty
 spots on top of options,... please  take a look of it,...
 http://www.hamayk.com/signup

 I have remove 'unknown'


 On Thursday, November 1, 2012 5:47:04 AM UTC-7, chetan varshney wrote:

 The logic you are trying to use it produce html as-

 select
 option value=0unknown/option
 option value=1male/option
 option value=2female/option
 /select

 So you should use in following way-

 Configure::write('User.**genders', array(''='unknown', '1'='male',
 '2'='female'));

 rest code is same


 On Thu, Nov 1, 2012 at 3:53 PM, Chris chri...@yahoo.com wrote:


 hi guys,... I'm using cake 1.3
 how can I validate select field from Model,?

 what I have in bootstrap:
  Configure::write('User.**genders', array('unknown', 'male', 'female'));

 in a view:
  tr
 tdstrong?php echo ucfirst(__('gender', true)) ?/strong
 ?php
  $genders = array(Configure::read('User.**genders'));
 echo $this-Form-select('gender', $genders)
  ?
 /td
  /tr

 and in a Model:
   var $validate = array(
  'gender' = array(
   'rule' = 'notEmpty',
   'required' = true,
   'message' = 'Gender must be valid',
  ),
   );

 I'm not getting warning of red box with Gender must be valid

 how can I do this?

 thanks in advance
 chris

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

 ---
 You received this message because you are subscribed to the Google
 Groups CakePHP group.
 To post to this group, send email to cake...@googlegroups.com.
 To unsubscribe from this group, send email to cake-php+u...@**
 googlegroups.com.

 Visit this group at 
 http://groups.google.com/**group/cake-php?hl=enhttp://groups.google.com/group/cake-php?hl=en
 .






 --
 Chetan Varshney
 Ektanjali Softwares Pvt Ltd

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

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






-- 
Chetan Varshney
Director
Ektanjali Softwares Pvt Ltd
Delhi India
Mobile: 91 9891538749 | Email: chetanvarsh...@gmail.com | Skype:
chetan-varshney
EktaSoftwares.Com

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

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




Re: ajax link with unique ID

2012-10-31 Thread Chetan Varshney
Why are you php tag inside php tag??

use it as-

?php echo $ajax-link(ucfirst(__('accept', true)), array('controller' =
'friends', 'action' = 'accept', $friend['FriendRequest']['id']),
array('update' = friend_.$friend['FriendRequest']['id']));?

On Wed, Oct 31, 2012 at 11:11 PM, Chris chris...@yahoo.com wrote:


 hi guys,... I'm having a problem placing unique ID in a ajax link
 'update':

 'update' = 'friend_?php echo $friend['FriendRequest']['id'] ?'

 here is the link:

 ?php echo $ajax-link(ucfirst(__('accept', true)), array('controller' =
 'friends', 'action' = 'accept', $friend['FriendRequest']['id']),
 array('update' = 'friend_?php echo $friend['FriendRequest']['id'] ?')
 );
 ?




 I'm getting an error no matter what I do by placing in echo '(',  ')' ,
 ?php echo ($friend['FriendRequest']['id']) ?
 Parse error: syntax error, unexpected T_STRING, expecting ')' in
 /home/xachkaa/hamayk.com/html/app/views/friends/requests.ctp on line 83

 can anyone help please,...?

 thanks in advance
 chris

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

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






-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

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

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




Re: Sending mail through Gmail with CakeEmail (again)?

2012-10-25 Thread Chetan Varshney
I am using Gmail SMTP on local host and web server as well here is my code.

In email.php inside app/Config

public $gmail = array(
'transport' = 'Smtp',
'host' = 'ssl://smtp.gmail.com',
'port' = 465,
'timeout' = 3,
'username' = 'yourem...@gmail.com',
'password' = 'yourpassword',
'client' = null,
'log' = true
//'charset' = 'utf-8',
//'headerCharset' = 'utf-8',
);


And in any controller for sending emails-

$fromConfig = 'Sender Email';
$fromNameConfig = 'Sender Email';
$emailObj = new CakeEmail();
$emailObj-from(array( $fromConfig = $fromNameConfig));
$emailObj-sender(array( $fromConfig = $fromNameConfig));
$emailObj-subject('Mail Subject');
$body='Mail Body';
// we are using gmail config for sending mails through Gmail Smtp
$emailObj-config('gmail');
$result = $emailObj-send($body);


On Wed, Oct 24, 2012 at 11:12 AM, Vanja Dizdarević 
lex.non.scri...@gmail.com wrote:

 Sorry for not bumping old topics, but has anyone managed to send an email
 with CakeEmail and stmp.gmail.com?

 My settings:
 class EmailConfig {
 public $gmail = array(
  'transport' = 'Smtp',
 'from' = array('u...@domain.com' = 'Name'),
  'host' = 'ssl://smtp.gmail.com',
 'port' = 465,
  'timeout' = 10,
 'username' = 'u...@domain.com',
  'password' = 'youwishyouknew',
 'client' = null,
 'log' = true,
  //'charset' = 'utf-8',
 //'headerCharset' = 'utf-8',
 'emailFormat' = 'html'
  );

 My Controller code:
 function test_email(){
 $mail = new CakeEmail('gmail');
 $mail-addTo('u...@anotherdomain.com', 'User');
 $mail-from('u...@domain.com', 'User');
 $mail-subject('TESTING '.rand(10, 100));
 $mail-template('test', 'default');
 $return = $mail-send();
 debug($return);
 debug($mail);
 die();
 }
 I keep getting Connection timeouts and Socket errors. Basically, the damn
 thing won't even connect, auth is never even touched. (neither dev, nor
 production machine..)

 I am using Google Apps on that domain (same domain as the production, not
 that it should matter...)

 I have checked for mod_openssl on the server.
 I have double checked the auth info.
 I am using Cake 2.2.1

 Is there something else I'm missing? Or should I just search for another
 email library?

 Thanks! Cheers!

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

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






-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

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

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




Re: ajax submit and reset form after submission

2012-10-25 Thread Chetan Varshney
You can call javascript function on complete


?php echo $ajax-submit('Add', array('url'= array('controller'='photo_
comments', 'action'='ajax_add/'. $photo['Photo']['id'] ), 'update' =
'updateDiv', 'complete' = 'javascript:resetThisForm();')); ?

script
function resetThisForm()
{
document.getElementById(FormId).reset();
}
/script

On Thu, Oct 25, 2012 at 1:15 PM, Chris chris...@yahoo.com wrote:

 hi guys,... is there a way to reset form after ajax submission...? or do I
 have to go thru jquery submission?
 here is my form:

 ?php echo $this-Form-create('PhotoComment'); ?
 ?php echo $form-hidden('user_id', array('value' =
 $user_object['id'])) ?
 ?php  echo $this-Form-textarea('content', array('rows' = '3')); ?

 ?php echo $ajax-submit('Add', array('url'=
 array('controller'='photo_comments', 'action'='ajax_add/'.
 $photo['Photo']['id'] ), 'update' = 'updateDiv')); ?

  div class=clr/div

 div id=updateDiv style=margin: 10px 0 10px 0;/div

 thanks in advance
 chris


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

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






-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

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

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




Re: Allow special characters in HtmlHelper

2012-10-22 Thread Chetan Varshney
Use this for example $imgTag = $this-Html-image($image['Image']
['thumb_path'], array( 'alt' = $title )); $options = array('class' =
'thumb', 'name' = trim(Inflector::slug($title)), 'title' = trim($title),
'escape'=false);

echo $this-Html-link($imgTag, $this-Html-url($image['Image']
['small_path'],true), $options);

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

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




Re: User Model migration

2012-09-26 Thread Chetan Varshney
For the email validation just use-

'email'= array(
'mustNotEmpty'=array(
'rule' = 'notEmpty',
'message'= 'Please enter email',
'last'=true),
'mustBeEmail'= array(
'rule' = array('email'),
'message' = 'Please enter valid email',
'last'=true)
)

Chetan
Ektasoftwares http://umpremium.ektasoftwares.com

On Wed, Sep 26, 2012 at 2:32 PM, Chris chris...@yahoo.com wrote:

 ok I got it,... but for the last field email should I have a same
 thing...?

 ?php
 class User extends AppModel {
   var $name = 'User';

   var $validate = array(
 'username' = '/^[a-z0-9\_\-\.]{5,40}$/i',
  'password' = array(
   'rule' = 'notEmpty',
   'message' = 'Please enter a valid user',
  ),
  'firstname' = array(
   'rule' = 'notEmpty',
   'message' = 'Please enter a valid name',
  ),
  'lastname' = array(
   'rule' = 'notEmpty',
   'message' = 'Please enter a valid description',
  ),
  'gender' = array(
   'rule' = 'notEmpty',
   'message' = 'Please enter a valid description',
  ),
  'birthday' = array(
   'rule' = 'notEmpty',
   'message' = 'Please enter a valid description',
  ),
  'location' = array(
   'rule' = 'notEmpty',
   'message' = 'Please enter a valid description',
  ),
  'email' = array(
   'rule' = 'notEmpty',
   'message' = 'Please enter a valid email',
  )
   );



 On Wednesday, September 26, 2012 1:57:12 AM UTC-7, Chris wrote:

 hi guys,... I have a old version of script written in 1.2 pre-Beta and
 want to migrate to 1.3,... and have a User Model:

 ?php
 class User extends AppModel {
   var $name = 'User';

   var $validate = array(
 'username' = '/^[a-z0-9\_\-\.]{5,40}$/i',
 'password' = VALID_NOT_EMPTY,
 'firstname' = VALID_NOT_EMPTY,
 'lastname' = VALID_NOT_EMPTY,
 'gender' = VALID_NOT_EMPTY,
 'birthday' = VALID_NOT_EMPTY,
 'location' = VALID_NOT_EMPTY,
 'email' = VALID_EMAIL
   );
 and having error: undefined constant VALID_NOT_EMPTY

 how can I change for CAKE 1.3 ???

 thanks


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

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






-- 
Chetan Varshney
Director
Ektanjali Softwares Pvt Ltd
Delhi India
Mobile: 91 9891538749 | Email: chetanvarsh...@gmail.com | Skype:
chetan-varshney
EktaSoftwares.Com

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

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




Cakephp User Management Free plugin Version 1.6

2012-09-11 Thread chetan varshney
Hi All,

I have improved Cakephp User Management Free plugin. A new version 1.6 has 
more new features along with some bug fixes.

Please have a look on http://usermgmt.ektasoftwares.com

Please let me know your suggestions to improve it. I am also working on 
Auth adapter Class so that this plugin can be use with other plugins which 
are dependent on cakephp Auth component.  

Best!
Chetan Varshney
http://ektasoftwares.com

-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: how to call one function of one contoller into another controller

2012-08-14 Thread Chetan Varshney
You should put common functions in app controller or in component. Calling
a controller function in other controller is not good practice. However you
can import target controller in controller.

App::import(Controller, Target);
$target = new TargetController;
$target-anyFunction();




On Tue, Aug 14, 2012 at 4:24 PM, sooryender sooryen...@gmail.com wrote:



 On Tuesday, July 17, 2012 11:57:16 AM UTC+5:30, sneha kulkarni wrote:

 how i can call one function of one controller into another controller.plz
 help

  --
 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.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.






-- 
Thanks  Regards

Chetan Varshney
Director of Ekta Softwares
Noida India
Website- EktaSoftwares.Com http://www.ektasoftwares.com
Email- chetanvarsh...@gmail.com
Skype- chetan-varshney
Mob no- +919891538749

-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Social Networking Login with Auth Component.

2012-08-13 Thread Chetan Varshney
Hi Sanjeev,

Please have a look on http://umpremium.ektasoftwares.com for authenticating
users and other features.

On Mon, Aug 13, 2012 at 6:03 PM, Sanjeev Divekar
sanjeevdive...@gmail.comwrote:

 HybridAuth gives more profile data then Opauth. I could't find user's
 email from demo in Opauth.

 On Mon, Aug 13, 2012 at 6:00 PM, Braindead markus.he...@gmail.com wrote:

 I think HybridAuth is better in response data provided.


 The only difference I can see is that HybridAuth does automatically login
 using AuthComponent and Opauth does not. But actually this can be done in a
 few lines of code. Opauth has the advantage that it is a nice plugin that
 fits nicely into any Cake app.

 --
 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.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.






 --
 Warm Regards,
 Sanjeev
 http://sanjeevdivekar.wordpress.com

 --
 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.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.






-- 
Thanks  Regards

Chetan Varshney
Director of Ekta Softwares
Noida India
Website- EktaSoftwares.Com http://www.ektasoftwares.com
Email- chetanvarsh...@gmail.com
Skype- chetan-varshney
Mob no- +919891538749

-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: send mails

2012-08-13 Thread Chetan Varshney
Hi Raj,

Please have a look on http://umpremium.ektasoftwares.com for login with
email and username.

Also you will get lots of features

On Mon, Aug 13, 2012 at 12:08 PM, raj kumar Pustela pustela...@gmail.comwrote:

 hi to all,
   how to login with username or emil in cake php 2.0.3

   if any one known about that pls help me.



 *thanks,*
 *rajkumar*




  --
 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.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.






-- 
Thanks  Regards

Chetan Varshney
Director of Ekta Softwares
Noida India
Website- EktaSoftwares.Com http://www.ektasoftwares.com
Email- chetanvarsh...@gmail.com
Skype- chetan-varshney
Mob no- +919891538749

-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: How to automatically add plugin css / scripts to default layout

2012-08-12 Thread chetan varshney
Hi Bill,

You can include anu plugin CSS in default layout only for plugin's Views

if($this-request-params['plugin']=='usermgmt') {
echo $this-Html-css('/usermgmt/css/umstyle');
}

Chetan Varshney
Cakephp User Mgmt Plugin http://umpremium.ektasoftwares.com/

 On Sunday, August 12, 2012 3:34:05 AM UTC+5:30, bs28723 wrote:

 I have a plugin that has custom CSS and JS files. 
 The plugin does not need its own layout - it will use the apps default 
 layout. 

 I guess I could just brute force it and put the $this-Html-css() and 
 $this-Html-script()  calls into the layouts/default.ctp file. 

 but I was wondering, is there a way to configure the controller or 
 something to call these only when a plugin controller/view is used? 

 Thanks, 
 Bill 

 --
 View this message in context: How to automatically add plugin css / 
 scripts to default 
 layouthttp://cakephp.1045679.n5.nabble.com/How-to-automatically-add-plugin-css-scripts-to-default-layout-tp5710377.html
 Sent from the CakePHP mailing list 
 archivehttp://cakephp.1045679.n5.nabble.com/at Nabble.com.


-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: How do I / Do I use parameters to limit the number of returned records?

2012-07-27 Thread chetan varshney
Hi Kevin

You can do like this

$this-paginate = array('limit' = 10, 
'conditions'=array('Topic.type'='BK'));
$topics= $this-paginate('Topic');

On Saturday, 28 July 2012 01:16:01 UTC+5:30, Kevin Mitchell wrote:

 PS: I guess I should start by learning how to do this with find() rather 
 than paginate().

 I have working ...

 public function index() {
 $this-Topic-recursive = 0;
 $conditions = array(Topic.type = 'Bk');
 debugger::dump($this-Topic-find('all', array('conditions' = 
 $conditions))); die;
 }

 So, my question becomes: how do I pass a value the value 'Bk' to 
 $conditions?

 ... and, how would this be different using paginate() instead of find().

 Thank you!
 Kevin


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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