Saturday, May 4, 2013

Re: Session in Behavior

sold for the most part by adding this to the model. still needs some
tweaking.

Thanks all..

public function __construct($id = false, $table = null, $ds = null)
{
App::import('Component', 'SessionComponent');
$session = new SessionComponent();
$user_id = $session->read('Userinfo.id');
$path = '{ROOT}webroot{DS}img{DS}images{DS}' . $user_id . '{DS}images';
// change actsAs's different value according to your need
$this->actsAs['Upload.Upload']['photo']['path'] = $path;
parent::__construct($id, $table, $ds);
}



--
View this message in context: http://cakephp.1045679.n5.nabble.com/Session-in-Behavior-tp5714402p5714773.html
Sent from the CakePHP mailing list archive at Nabble.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+unsubscribe@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.

No comments: