Events don't work when lazy load model class

2014-11-21 Thread gonzela2006
Hi, I created an event 'Model.User.created' and attached the listener to my model as you can see below and it is working well App::uses('AppModel', 'Model'); App::uses('CakeEvent', 'Event'); class User extends AppModel { public function afterSave($created, $options = array()) { $eve

Migrate Passwords

2014-10-30 Thread gonzela2006
Hi, How can I migrate my users passwords from SimplePasswordHasher to BlowfishPasswordHasher *without interrupt my users to change their passwords*? Thanks -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message bec

Re: Load model in bootstrap

2014-02-02 Thread gonzela2006
es) > You would have to use App::uses('Option', 'Model'). > Even if in this case it would not really make a difference. > > But stick to the first one as it is the recommended approach. > > > Am Sonntag, 2. Februar 2014 23:53:11 UTC+1 schrieb gonze

Load model in bootstrap

2014-02-02 Thread gonzela2006
Hello, I want to load model in bootstrap.php so I made it with two techniques as the following: App::uses('ClassRegistry', 'Utility'); ClassRegistry::init('Option')->load(); and App::import('Model', 'Option'); $option = new Option(); $option->load(); Both of them worked for me but I don't kno

Router redirect pass all parameters to another domian

2014-01-20 Thread gonzela2006
Hello, I want to use *Router::redirect* to redirect to another domain and pass all parameters to this domain Example: Redirect this url http://domain-*one*.com/posts/view/1 to http://domain-*two*.com/posts/view/1 I tried the following Router::redirect( '/*', 'http://domain-*two*.com/', array('p

Re: Routing problem with "/*" url

2014-01-03 Thread gonzela2006
::connect( > "/members/:controller/:action/*", > array('prefix' => members, members => true) > ); > Router::connect('/*', array('controller' => 'posts', 'action' => 'view')); > > Then try to access

Re: Routing problem with "/*" url

2014-01-03 Thread gonzela2006
Hi Stephen, s members a prefix, or do you have a users method with login parameter, or > do you have that as a custom route? Yes, members is a prefix but the problem also exists with urls without prefix like /pages/display/about I found a post on Mark Story's blog that is talking about my prob

Routing problem with "/*" url

2014-01-03 Thread gonzela2006
Hi, I want my posts url to be like this: example.com/post-slug so I added the routing rule on routes.php like this Router::connect('/*', array('controller' => 'posts', 'action' => 'view')); It works well but other links give 404 error like this one Error: The requested address '/members/users/l

Re: Help in simple query!

2013-05-31 Thread gonzela2006
@Dakota I'm already setting the relation as below class Student extends AppModel { var $name = 'Student'; var $hasMany = array('StudentAttendance'); AND class StudentAttendance extends AppModel { var $name = 'StudentAttendance'; var $belongsTo = 'Student'; On Thursday, May 30, 2013 8:2

Re: Help in simple query!

2013-05-31 Thread gonzela2006
@Dr. Drijk @resting Model names must be singular. -- 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 receivi

Re: Help in simple query!

2013-05-29 Thread gonzela2006
Hello, I used the following code in "StudentAttendances" controller: $students = $this ->StudentAttendance->Student-> find('all', array( 'conditions' => array( 'NOT' => array('StudentAttendance.date' => array($year.'-'.$month.'-'.$day)) ), 'fields' => array('Student.id', 'Student.name'), 'order'

Help in simple query!

2013-05-28 Thread gonzela2006
Hello, As you can see on the below image I want to display students that didn't attendance on date 2013-03-01 so the result should be as the following: *id name* 2 Marta Simon 4 Rex Maxwel

Re: Can't validate URL

2013-01-24 Thread gonzela2006
Hello euromark, Thanks for your reply I'm trying to make my own short link service for my blog and I wish to make it using CakePHP I think I can't validate this URL because it is too long *Note*: I have tried to encode this URL before validate it and still getting false URL. Please advise --

Re: Can't validate URL

2013-01-24 Thread gonzela2006
, 24. Januar 2013 17:16:49 UTC+1 schrieb gonzela2006: >> >> Hello, >> >> can't validate the below url using 'rule' => 'url' on my model >> >> >> https://www.google.com/search?sugexp=les;&gs_rn=1&gs_ri=serp&tok=ryp3YY

Can't validate URL

2013-01-24 Thread gonzela2006
Hello, can't validate the below url using 'rule' => 'url' on my model https://www.google.com/search?sugexp=les;&gs_rn=1&gs_ri=serp&tok=ryp3YY4UdU39xLhgeQ6ElQ&pq=cakephp cakephp cakephp cakephp cakephp cakephp cakephp cakephp cakephp cakephp cakephp cakephp cakephp cakephp cakephp cakephp cake

Re: Routing help

2013-01-17 Thread gonzela2006
I got it :) Could you please help me to make this routing http://domain.com/members/posts/view/username/posttitle to be http://username.domain.com/posttitle On Thursday, January 17, 2013 11:05:49 PM UTC+2, ibejohn818 wrote: > > if(preg_match('/*FILTER*/',$_SERVER['HTTP_HOST'])) { > > Router::conn

Re: Routing help

2013-01-17 Thread gonzela2006
Hello ibejohn818, How can I make conditional statement in routes.php file? On Thursday, January 17, 2013 10:43:17 PM UTC+2, ibejohn818 wrote: > > You would be best served by triggering your route using a conditional > statement in your routes file then using a custom route class to verify the

Re: Routing help

2013-01-17 Thread gonzela2006
I have tried the following Router::connect('/*', array('controller' => 'posts', 'action' => 'view', 'members'=>1)); and the result is http://domain.com/username/post-alias and it works but the all other links give me 404 not found -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us

Re: Routing help

2013-01-17 Thread gonzela2006
Hello Mathew, Thanks for your reply. Regarding to my question,I have wrote wrong controller the right one must be *posts *not *users*. Really I need to make it as a subdomian and I have found an article on Bakery http://bakery.cakephp.org/articles/Mum_Chamber/2008/02/04/subdomaining-with-cake I'

Re: Routing help

2013-01-17 Thread gonzela2006
Any help please -- 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 fr

Re: Routing help

2013-01-16 Thread gonzela2006
Hello, I have already created the wildcard subdomain *.domian.com. I just need to know how to make the routing process. 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 th

Routing help

2013-01-16 Thread gonzela2006
Hello, I need your help to make this routing http://domain.com/members/users/view/username/posttitle to be http://username.domain.com/posttitle Where domain.com -> My domain members -> Routing prefix users -> Controller view -> Action username -> Member username(First variable for view() action) p

Re: Conditional validation rule1 OR rule2

2013-01-13 Thread gonzela2006
Thanks cricket & AD7six. I have used the following code to validate variable if it url or email. public $validate = array( 'variable' => array( 'url' => array( 'rule' => array('urlOrEmail'), 'message' => 'Please supply a valid URL/email ad

Re: Conditional validation rule1 OR rule2

2013-01-12 Thread gonzela2006
Hello, Any help please -- 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 unsubs

Re: Conditional validation rule1 OR rule2

2013-01-12 Thread gonzela2006
return $this->validator()->url($field[[$key]); > > default: > return false; > } > } > > Check the API for other params you can pass to these two methods.

Conditional validation rule1 OR rule2

2013-01-11 Thread gonzela2006
;url' => array( 'rule' => array('url', true), 'message' => 'Please supply a valid URL address.' ) 'email' => array( 'rule'=> array('email', true), 'message' => 'Plea

Re: Autocomplete example for cakephp 2.2

2012-07-25 Thread gonzela2006
Hi Greg, I want an example for cakephp 2.1.x or 2.2.x. Thanks On Wednesday, July 25, 2012 6:16:06 PM UTC+2, Greg wrote: > > I use a jQuery autocomplete control > and write a method in the desired controller which returns JSON and must > be requested as XHR ($this->request->is('ajax');) > > pretty

Re: Search form like google

2012-06-13 Thread gonzela2006
Hi, Thanks Dr. Tarique and I'll try the above tutorial and feedback you with the result :) On Tuesday, June 12, 2012 9:30:22 AM UTC+3, Dr. Tarique Sani wrote: > > A bit dated but should get you started > http://blogfreakz.com/cakephp/cakephp-jquery-autocomplete-tutorial/ -- Our newest site

Search form like google

2012-06-11 Thread gonzela2006
Hi, I'm a* newbie* on CakePHP 2 and I'm looking for a way to have a search box with ajax auto complete just like google does as you can see on the below image <https://lh5.googleusercontent.com/-r2LP5SW66x0/T9aQnbdZ9YI/AXY/mADzCvXpkGk/s1600/search+form.png> Thanks, gonz