Yes, you can use requestAction from within an element.
in your element you can write
$data = $this-requestAction(array('controller' = 'test', 'action' =
'getdataforelementaction' ));
and in your controller
public function getdataforelementaction() {
if (isset($this-params['requested'])) {
I managed to switch to a newsletter layout by creating another
config in app/Config/Email.php :
public $newsletter = array(
'transport' = 'Mail',
'charset' = 'utf-8',
'headerCharset' = 'utf-8',
'layout' = 'default',
I'm just breaking my way into CakePHP 2. I'm trying to attach the
SluggableBehavior from the CakeDC Utils Plugin to a model and am really
struggling to find any decent resource that outlines the steps to do this.
The official documentation on the usage of plugins, and specifically the
usage of
you need to activate plugin
CakePlugin::load('Utils');
--
Lep pozdrav, Tilen Majerle
http://majerle.eu
2012/6/19 Jeremy Burns jeremybu...@classoutfit.com
I'm just breaking my way into CakePHP 2. I'm trying to attach the
SluggableBehavior from the CakeDC Utils Plugin to a model and am really
You would probably be better off having a countPosts() function in your
User model which is...
public function countPosts( $userId ){
$count = $this-Post-find('count', array( 'condition' =
array('user_id' = $userId) ) );
return $count;
}
That way you can add in more conditions later,
Yup - all plugins are loaded in bootstrap...
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 19 Jun 2012, at 10:59:11, Tilen Majerle wrote:
you need to activate plugin
CakePlugin::load('Utils');
--
Lep pozdrav, Tilen Majerle
http://majerle.eu
2012/6/19 Jeremy Burns
On 19/06/12 09:49, Jeremy Burns wrote:
I'm just breaking my way into CakePHP 2. I'm trying to attach the
SluggableBehavior from the CakeDC Utils Plugin to a model and am
really struggling to find any decent resource that outlines the steps
to do this. The official documentation on the usage of
Cake does not support HAVING but you can put it in the group as a string.
Something like the following:
$this-Timesheet-virtualFields = array(
'count_name' = 'COUNT(id)'
);
$this-Timesheet-find(
'all',
array(
'fields' = array(
'Timesheet.user_id',
'Timesheet.date',
'count_name'
),
'group' =
http://stackoverflow.com/questions/11095805/cake-bake-2-1-3-appmodel-not-found
http://stackoverflow.com/questions/11095805/cake-bake-2-1-3-appmodel-not-found
got this error when baking
Fatal error: Class 'AppModel' not found in
C:\xampp\htdocs\cakephp\lib\Cake\Model\CakeSchema.php on line 308
debug($this-Session-read('Auth.User')); and debug($this-Auth-User());
both return:
array(
'User' = array(
'password' = '*',
'email' = 't...@example.com'
)
)
These are the fields that the user uses to log in. The password isn't even
hashed. When I print_r, it displays the actual password. I
You should be hashing the password before saving it.
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 19 Jun 2012, at 19:41:30, Joey Hauschildt wrote:
debug($this-Session-read('Auth.User')); and debug($this-Auth-User());
both return:
array(
'User' = array(
I am. All passwords in the db are hashed. The problem seems to be that
instead of getting info from the users table, it is only filling
debug($this-Session-read('Auth.User'));
and debug($this-Auth-User()) with data from the form. Otherwise the
password would be hashed. It has nowhere else to
http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#identifying-users-and-logging-them-in
In 2.0 $this-Auth-login($this-request-data) will log the user in
with whatever data is posted, whereas in 1.3
$this-Auth-login($this-data) would try to identify the user first and
Thanks,
This is what I ended up doing in my records controller function but I get
the following error:* Column not found: 1054 Unknown column 'count_name' in
'having clause'
*
$this-Timesheet-virtualFields = array(
'count_name' =
Sorry Cake creates the fields as Model__filed so it should be 'group' =
'Timesheet.user_id, Timesheet.date HAVING Timesheet__count_name 1',
On Tuesday, 19 June 2012 23:52:43 UTC+1, elogic wrote:
Thanks,
This is what I ended up doing in my records controller function but I get
the
Thanks, worked perfectly.
On Wed, Jun 20, 2012 at 9:17 AM, dogmatic69 dogmati...@gmail.com wrote:
Sorry Cake creates the fields as Model__filed so it should be 'group' =
'Timesheet.user_id, Timesheet.date HAVING Timesheet__count_name 1',
On Tuesday, 19 June 2012 23:52:43 UTC+1, elogic
Hi All,
I moved a site from one server and upgraded it from 1.3.x to 2.x and now in
the url I am getting something like this:
/units/staffindex?url=units%2Fstaffindex
The url=units%2Fstaffindex part is new to me. Any idea why it is now there
and how do I get rid of it?
Everything works as
17 matches
Mail list logo