AW: ?CAKEPHP= at end of links

2008-10-28 Thread Liebermann, Anja Carolin

Hi Niraj,

That sounds like the cookies are switched off and the session-id is attached to 
the Url, as they should be, when Cookies are disabled.

Anja

-Ursprüngliche Nachricht-
Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Niraj 
Shah
Gesendet: Dienstag, 28. Oktober 2008 05:20
An: CakePHP
Betreff: ?CAKEPHP= at end of links


Hi everyone. I just redid my website (www.tlgmedia.com) using CakePHP.
I love it, but every now and then any links I've created will add ?
CAKEPHP=random characters to the end of the url. Does anyone know how to 
prevent this from happening? Thanks.



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Deleting Associations in HABTM possible without HABTM-Behaviour???

2008-10-28 Thread Dakapo

Hi Martin,

the patch solved the problem for this moment.

Thank you very much
Dakapo

On 27 Okt., 15:56, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hi Dakapo,

 This is a bug in RC3. Check this ticket for a temporary patch you can
 implement if you need it:https://trac.cakephp.org/ticket/5579

 There is also other threads about this already. Like this 
 one:http://groups.google.com/group/cake-php/browse_thread/thread/5d5f3aea...

 /Martin

 On Oct 27, 3:26 pm, Dakapo [EMAIL PROTECTED] wrote:

  Hello! I'm testing the CakePHP 1.2 RC3. I tried to delete a HABTM-
  Association.
  It only works if I have defined the $hasAndBelongsToMany in one of the
  two models. As soon as I have defined it in both the delete-statement
  is wrong :(

  Until now I used the HABTM AddDelete Behaviour from the bakery for
  this. But isn't it possible in RC3 by Cake itself?

  I have 3 tables:
  customers
  cities
  cities_customers

  If I start the admin_del-function it creates...

  DELETE FROM `cities_customers` WHERE `cities_customers`.`city_id` = 1

  But that should be...
  DELETE FROM `cities_customers` WHERE `cities_customers`.`customer_id`
  = 1

  You can find the code of the models in the 
  cakebin:http://bin.cakephp.org/view/506261235


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: mail component in shell

2008-10-28 Thread JuergenRiemer

still looking for a solution:
How can I use the Email Component from within a shell script _and_
pass on data to the template .ctp file?
 thanks
 Juergen

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how can i set one controller to render actions from another controller in cakephp 1.2

2008-10-28 Thread johnbl4ck

hello, i'm new to cakephp. in my app there's controller named sections
which renders pages and there're multiple controllers for special
actions (e.g. photos, shop, etc).

what i'm trying to do is to create whole pages structure with sections
controller and set some pages to be rendered by other controllers in
backend.

i found out that renderAction will do this task

e.g.

$this-set('pish', $this-requestAction(array('controller' = 'photo',
'action' = 'index'), array('return')));

is it ok to use renderAction or there's better way to do it?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Few errors I found so far.

2008-10-28 Thread [EMAIL PROTECTED]

Thank you Gabriel, I am currently using the Beginning CakePHP book as
my tutorial to Cake and some of the code in the book and the source I
downloaded, does not work.

Hence all the questions, thank you so much once again.

Martin


On Oct 27, 3:53 pm, Gabriel Gilini [EMAIL PROTECTED] wrote:
 Try to set 'model' = 'comments' in the options array.
 Sorry, I meant 'model' = 'Comment'.

 Gabriel Gilini

 www.usosim.com.br
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]

 On Mon, Oct 27, 2008 at 12:50 PM, Gabriel Gilini [EMAIL PROTECTED]wrote:

  On Mon, Oct 27, 2008 at 11:36 AM, [EMAIL PROTECTED] 
  [EMAIL PROTECTED] wrote:

  hi all,

  Hi.

  Just a few errors I found so far, if anyone can help, it would be much
  appreciated.

  1. Having multiple conditions on find:

  post.php Model
  $this-find('all', array('conditions' = array('DATE(Post.date)' = '
  '.$date, 'Date(Post.date)' = ' '.$end_date)));

  SQL generated:
  SELECT `Post`.`id`, `Post`.`name`, `Post`.`date`, `Post`.`content`,
  `Post`.`user_id`, `User`.`id`, `User`.`name`, `User`.`email`,
  `User`.`firstname`, `User`.`lastname` FROM `posts` AS `Post` LEFT JOIN
  `users` AS `User` ON (`Post`.`user_id` = `User`.`id`) WHERE
  DATE(`Post`.`date`) = ' 2008-01-01 00:00:00' AND Date(`Post`.`date`)
  = ' 2008-12-31 23:59:59'

  Results:
  None, but I know there are 2 results.

  That's because the  and  signs should be in the array key, not value. Try
  changing your conditions to something like this

  array(
 'conditions' = array(
'DATE(Post.date) ' = $date,
'DATE(Post.date) ' = $end_date
 )
  )

  2. Htaccess issue?

  view.ctp for posts:
  ?=$ajax-form('/comments/add', 'post', array('update'='comments')); ?

  Code generated for the form:
  action=/workspace/cake/posts/comments/add

  Results:
  Should this not be:
  action=/workspace/cake/comments/add ?

  Try to set 'model' = 'comments' in the options array.

  Kind Regards,
  Martin

  Cheers,

  Gabriel Gilini

 www.usosim.com.br
  [EMAIL PROTECTED]
  [EMAIL PROTECTED]
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cookie tutorial

2008-10-28 Thread [EMAIL PROTECTED]

I have the same issue, even removing the domain settings.

When I restart IE, it looks like the cookie is gone. $this-
Cookie.read($key) return null. Not sure why this happened.

On Oct 23, 11:44 pm, . [EMAIL PROTECTED] wrote:
 Is there a cake ticket for this? Or a possible fix?



 On Thu, Oct 23, 2008 at 2:47 AM, jamescowhen [EMAIL PROTECTED] wrote:

  I have the same issue, removing the domain seem to fix it, but that
  doesn't get at the root of the problem

  On Oct 21, 11:31 pm, . [EMAIL PROTECTED] wrote:
   same here.. so you still are leaving out the domain variable?

   On Tue, Oct 21, 2008 at 11:13 AM, Stinkbug [EMAIL PROTECTED] wrote:

I had a problem with cookies a while back. Couldn't seem to reference
them after I saved them. I know the docs say the domain variable is
required, but as soon as removed it, everything started working as
expected.

On Oct 20, 1:27 am, . [EMAIL PROTECTED] wrote:
 I don't think it is saving the cookie, because if i go to another
  page,
 doing $this-Cookie-read('name') returns null... how do i persist
  the
 cookie?

 On Sun, Oct 19, 2008 at 11:25 PM, . [EMAIL PROTECTED] wrote:
   $this-Cookie-name = 'location';
    $this-Cookie-time =  3600;  // or '1 hour'
    $this-Cookie-path = '/';
    $this-Cookie-domain = 'localhost';
    $this-Cookie-secure = true;  //i.e. only sent if using secure
  HTTPS
    $this-Cookie-key = 'qSI232qs*sXOw!';

   $this-Cookie-write('name','Larry');

  if I do the above, where is the cookie location saved to? I did a
search
  on my HDD but cannot find the file.

  On Sun, Oct 19, 2008 at 11:03 PM, Daniel Hofstetter 
[EMAIL PROTECTED]wrote:

  Hi,

   is there any tutorial about cookie component for cakephp? i am
having
   trouble using it.

 http://book.cakephp.org/view/177/Cookies

  Hope that helps!

  --
  Daniel Hofstetter
 http://cakebaker.42dh.com- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cookie tutorial

2008-10-28 Thread [EMAIL PROTECTED]

i figured it out.

it works if put the following lines in beforeFilter() of the
controller (don't put it in app_controller.php)

$this-Cookie-name = 'location';
  $this-Cookie-time =  3600;  // or '1 hour'
  $this-Cookie-path = '/';
  $this-Cookie-domain = 'localhost';
  $this-Cookie-secure = true;  //i.e. only sent if using secure
HTTPS
  $this-Cookie-key = 'qSI232qs*sXOw!';

On Oct 23, 11:44 pm, . [EMAIL PROTECTED] wrote:
 Is there a cake ticket for this? Or a possible fix?



 On Thu, Oct 23, 2008 at 2:47 AM, jamescowhen [EMAIL PROTECTED] wrote:

  I have the same issue, removing the domain seem to fix it, but that
  doesn't get at the root of the problem

  On Oct 21, 11:31 pm, . [EMAIL PROTECTED] wrote:
   same here.. so you still are leaving out the domain variable?

   On Tue, Oct 21, 2008 at 11:13 AM, Stinkbug [EMAIL PROTECTED] wrote:

I had a problem with cookies a while back. Couldn't seem to reference
them after I saved them. I know the docs say the domain variable is
required, but as soon as removed it, everything started working as
expected.

On Oct 20, 1:27 am, . [EMAIL PROTECTED] wrote:
 I don't think it is saving the cookie, because if i go to another
  page,
 doing $this-Cookie-read('name') returns null... how do i persist
  the
 cookie?

 On Sun, Oct 19, 2008 at 11:25 PM, . [EMAIL PROTECTED] wrote:
   $this-Cookie-name = 'location';
    $this-Cookie-time =  3600;  // or '1 hour'
    $this-Cookie-path = '/';
    $this-Cookie-domain = 'localhost';
    $this-Cookie-secure = true;  //i.e. only sent if using secure
  HTTPS
    $this-Cookie-key = 'qSI232qs*sXOw!';

   $this-Cookie-write('name','Larry');

  if I do the above, where is the cookie location saved to? I did a
search
  on my HDD but cannot find the file.

  On Sun, Oct 19, 2008 at 11:03 PM, Daniel Hofstetter 
[EMAIL PROTECTED]wrote:

  Hi,

   is there any tutorial about cookie component for cakephp? i am
having
   trouble using it.

 http://book.cakephp.org/view/177/Cookies

  Hope that helps!

  --
  Daniel Hofstetter
 http://cakebaker.42dh.com- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Radio buttons for HABTM

2008-10-28 Thread zwobot

Hello,
I am trying to make groups of radio buttons for a hasAndBelongsToMany
relation.

The background: In my application I have following relations in for my
models:

User hasAndBelongsToMany Workshop
Workshop belongsTo Event (Event hasMany Workshop)
Event belongsTo EventDay (EventDay hasMany Event)

A User should be able to select exactly 1 Workshop in every EventDay,
therefore I want to use a group of radio buttons for each EventDay. I
don't think there is a cake automagic way to get this done so I'm
doing this in my View to get the HTML code for the radio buttons:

http://bin.cakephp.org/view/1474966345

Which generates radio buttons like this:

http://bin.cakephp.org/view/680986107

The data array which comes from the View's form basically looks okay,
however the IDs of the Workshops selected via the radio buttons are
not always stored properly in the array.

[data] = Array
(
[Workshop] = Array
(
[Workshop] = Array
(
[0] =
[1] = 3
[2] = 5
)
)
)

I don't know why certain Workshops are not saved properly in the data
array; I thought it had something to do with the order of the
Workshops' IDs - like if the radio button for Workshop with ID 4 comes
before the Workshop with ID 2 it is not saved in the data array.
However I was not able to verify this and have no clue how I should
work around this as the Workshops are sorted by their starting time
and not their IDs.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: how can i set one controller to render actions from another controller in cakephp 1.2

2008-10-28 Thread johnbl4ck

and then again, how can i pass some parameters via url.

e.g. i have url like http://127.0.0.2/sections/view/14/autocard-3

this means that i call some controller with method autocard to get
record with id = 3.

if ($ctrlr != 'sections') {

(isset($action)) ? $action : $action = 'index';
$cAct = explode('-', $action);
$this-set('pish', $this-requestAction(array('controller' = $ctrlr,
'action' = $cAct[0]), array('return')));

}

this will work but wil not do what i need.
but if i change
$this-set('pish', $this-requestAction(array('controller' = $ctrlr,
'action' = $cAct[0]), array('return')));
to
$this-set('pish', $this-requestAction(array('controller' = $ctrlr,
'action' = $cAct[0]($cAct[1])), array('return')));

cakephp ends up with error Fatal error: Call to undefined function
autocard() in /var/www/hotcake/app/controllers/sections_controller.php
on line 55



On 28 окт, 12:37, johnbl4ck [EMAIL PROTECTED] wrote:
 hello, i'm new to cakephp. in my app there's controller named sections
 which renders pages and there're multiple controllers for special
 actions (e.g. photos, shop, etc).

 what i'm trying to do is to create whole pages structure with sections
 controller and set some pages to be rendered by other controllers in
 backend.

 i found out that renderAction will do this task

 e.g.

 $this-set('pish', $this-requestAction(array('controller' = 'photo',
 'action' = 'index'), array('return')));

 is it ok to use renderAction or there's better way to do it?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: how can i set one controller to render actions from another controller in cakephp 1.2

2008-10-28 Thread [EMAIL PROTECTED]


I am not absolutely sure, but I think you will get a little better
performance (and structure) from calling requestAction in your view in
this case.
That is, you create elements to do the rendering and use requestAction
to get the data to the element. Not to render anything.

If your application warrants it, you may also be better off loading up
the needed Models directly in the current controller. This would cut
out requestAction.
This would be a good option if your controller or action is for a
portal-style page that shows bits from different parts of the
application.

/Martin


On Oct 28, 9:12 am, johnbl4ck [EMAIL PROTECTED] wrote:
 and then again, how can i pass some parameters via url.

 e.g. i have url likehttp://127.0.0.2/sections/view/14/autocard-3

 this means that i call some controller with method autocard to get
 record with id = 3.

 if ($ctrlr != 'sections') {

         (isset($action)) ? $action : $action = 'index';
         $cAct = explode('-', $action);
         $this-set('pish', $this-requestAction(array('controller' = $ctrlr,
 'action' = $cAct[0]), array('return')));

         }

 this will work but wil not do what i need.
 but if i change
         $this-set('pish', $this-requestAction(array('controller' = $ctrlr,
 'action' = $cAct[0]), array('return')));
 to
         $this-set('pish', $this-requestAction(array('controller' = $ctrlr,
 'action' = $cAct[0]($cAct[1])), array('return')));

 cakephp ends up with error Fatal error: Call to undefined function
 autocard() in /var/www/hotcake/app/controllers/sections_controller.php
 on line 55

 On 28 окт, 12:37, johnbl4ck [EMAIL PROTECTED] wrote:

  hello, i'm new to cakephp. in my app there's controller named sections
  which renders pages and there're multiple controllers for special
  actions (e.g. photos, shop, etc).

  what i'm trying to do is to create whole pages structure with sections
  controller and set some pages to be rendered by other controllers in
  backend.

  i found out that renderAction will do this task

  e.g.

  $this-set('pish', $this-requestAction(array('controller' = 'photo',
  'action' = 'index'), array('return')));

  is it ok to use renderAction or there's better way to do it?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: how can i set one controller to render actions from another controller in cakephp 1.2

2008-10-28 Thread zwobot

Passing parameters via URL:
/controller_name/action_name/parameter_1/parameter_2/
parameter_n

Parameters are added with slashes into the URL after the action name,
so if you have an action autocard in your controller: (let's assume it
is called PostsController)

function autocard ($param1, $param2) {
  echo $param1;
  echo $param2;
}

Now you can call this function with the URL /posts/autocard/hello/
world
and it would print you in the view: hello world
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CSV file as DataSource

2008-10-28 Thread su6z3r0

Aaarrglll... I was so close... Anyway. It works. You are my hero!
Thank's dude.

Alex

On Oct 28, 4:20 am, ORCC [EMAIL PROTECTED] wrote:
 Actually, it is (assuming your db configuration variable is called
 default):

  $conn = ConnectionManager::getInstance()
  $conn-config-default['file'] = 'your_csv_file';
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CSV file as DataSource

2008-10-28 Thread su6z3r0

Seems interesting. Problem is I do not have access to MySQL 5.1(beta).
I will have an eye on it though.

Alex

On Oct 27, 10:38 pm, teknoid [EMAIL PROTECTED] wrote:
 If you are using MySQL you might consider 
 this:http://dev.mysql.com/tech-resources/articles/csv-storage-engine.html

 On Oct 27, 12:44 pm, su6z3r0 [EMAIL PROTECTED] wrote:

  Hello,

  I am trying to setup a csv file as data source. But I do not know how/
  where I could dynamically change the file name of the csv file. In my
  below example the name email.csv should actually be a file name
  which can be set up in the controller.

  the database.php contains:
      var $csv = array(
          'datasource' = 'Csv',
          'file' = 'email.csv'     - this should be a variable file
  name set up in the controller
      );

  In my model I connect to the source like this:

      function csvFindAll() {
          $this-setDataSource('csv');
          $csv = $this-getDataSource();
          return $csv-findAll();
      }

  the Csv_source.php file opens the file:

      function connect() {
          $this-File    = fopen(WWW_ROOT . 'files/' . $this-config['file'], 
  r);

          if (!$this-File) {
              return false;
          }else {
              return true;
          }
      }

  Any ideas, hints how I could achieve that?

  TIA,
  Alex


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: how can i set one controller to render actions from another controller in cakephp 1.2

2008-10-28 Thread johnbl4ck

yes i got that. but
http://127.0.0.2/sections/view/14/autocard/4

actually calls sections controller with method view and param 14,
autocard is method of cars controller and it's param should be 4 but i
can't get how to handle this via requestAction


On 28 окт, 14:09, zwobot [EMAIL PROTECTED] wrote:
 Passing parameters via URL:
 /controller_name/action_name/parameter_1/parameter_2/
 parameter_n

 Parameters are added with slashes into the URL after the action name,
 so if you have an action autocard in your controller: (let's assume it
 is called PostsController)

 function autocard ($param1, $param2) {
   echo $param1;
   echo $param2;

 }

 Now you can call this function with the URL /posts/autocard/hello/
 world
 and it would print you in the view: hello world
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Radio buttons for HABTM

2008-10-28 Thread grigri

I think this is related to ticket #4605: https://trac.cakephp.org/ticket/4605

On Oct 28, 8:38 am, zwobot [EMAIL PROTECTED] wrote:
 Hello,
 I am trying to make groups of radio buttons for a hasAndBelongsToMany
 relation.

 The background: In my application I have following relations in for my
 models:

 User hasAndBelongsToMany Workshop
 Workshop belongsTo Event (Event hasMany Workshop)
 Event belongsTo EventDay (EventDay hasMany Event)

 A User should be able to select exactly 1 Workshop in every EventDay,
 therefore I want to use a group of radio buttons for each EventDay. I
 don't think there is a cake automagic way to get this done so I'm
 doing this in my View to get the HTML code for the radio buttons:

 http://bin.cakephp.org/view/1474966345

 Which generates radio buttons like this:

 http://bin.cakephp.org/view/680986107

 The data array which comes from the View's form basically looks okay,
 however the IDs of the Workshops selected via the radio buttons are
 not always stored properly in the array.

 [data] = Array
                 (
                     [Workshop] = Array
                         (
                             [Workshop] = Array
                                 (
                                     [0] =
                                     [1] = 3
                                     [2] = 5
                                 )
                         )
                 )

 I don't know why certain Workshops are not saved properly in the data
 array; I thought it had something to do with the order of the
 Workshops' IDs - like if the radio button for Workshop with ID 4 comes
 before the Workshop with ID 2 it is not saved in the data array.
 However I was not able to verify this and have no clue how I should
 work around this as the Workshops are sorted by their starting time
 and not their IDs.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Radio buttons for HABTM

2008-10-28 Thread zwobot

It could be related, however the problem also was present when I had
values for my radio buttons...
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



An informal survey of development times using cake

2008-10-28 Thread keymaster

A post by Teknoid in this thread:
http://groups.google.com/group/cake-php/browse_thread/thread/0635f46f7b13c4a2#

... got me thinking.

Wouldn't it be nice to see some (very informal) accounts of actual
development times experienced using cakePHP?

Something like:
(app metrics, weeks)?

I was thinking of little more than a thread in this forum. One post in
the thread per project. Describe the project, Tell us how long you
spent on development.

What do people think?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Render speed difference between 1.1 and 1.2

2008-10-28 Thread Mark

Hi everyone,

Just a closing statement, I have to get this project out the door so I
went ahead and downgraded to the 1.1 framework. Thanks everyone for
your good advice.

Take care,
Mark


On Oct 24, 4:35 am, Mark [EMAIL PROTECTED] wrote:
 Thanks, Brett, good to know.

 It looks like both servers are running on grid 1; I'd be interested if
 anyone out there running on grid 3 could give the new version of the
 framework a try and let us know how it performs?

 m

 On Oct 23, 8:35 pm, Brett Wilton [EMAIL PROTECTED] wrote:

   Brett, I did try the same static page test on the fortunecookie
   server, with the same results. Out of curiosity, how can you tell that
   the applications are running on cluster 1?

  I wrote this note the other day on this :-

 http://wiltonsoftware.com/posts/view/finding-which-grid-cluster-your-...

  Simple answer is a traceroute to your site.

  ---
  Brett Wiltonhttp://wiltonsoftware.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Dynamic Routing

2008-10-28 Thread Dardo Sordi Bogado

This might help, look at the comments:

http://bakery.cakephp.org/articles/view/taking-advantage-of-the-pages-controller

Others approaches:

http://snook.ca/archives/cakephp/static_pages_cakephp12/
http://cakebaker.42dh.com/2008/06/18/an-alternative-approach-for-static-pages/
http://snook.ca/archives/cakephp/easier_static_pages_2/

 Could you possibly point me to the specific page in the manual
 where it refers to this area of functionality?

He is talking probably about the routes section.

 Also, is there a way to pass control from one controller to another?
 If thats in the manual also could you point me to the page in the
 manual where it talks about it?

For another action in the same controller you can use
$this-setAction(), but for a different controller you can use
$this-requestAction() or instanciate the other controller and do the
dispatching yourself (don't forget to call constructClasses()  in the
new controller).

HTH,
- Dardo Sordi.

 Thanks.

 On Oct 26, 2:18 am, deedod [EMAIL PROTECTED] wrote:
 What's the best way to go about setting updynamicrouting
 so that I can redirect all my 'missing controller' errors to another
 defined controller to perform operations on?

 I basically want any error page to filter through the pages controller
 (or any other controller I choose) so I can check the requested URL
 and determine if the URL is valid or not.

 I have some other defined controllers that I use as normal but I also
 want the ability to define custom URLs for a page and then to be
 able to pull the data for that page after checking the URL requested.

 Should I use some sort ofrouting?  Or is there another approach I
 should use.  I don't want to redirect ALL pages to the specified
 controller since I have a couple other controllers that I use.

 Also, is there a way that you can pass control from one controller
 to another?  For instance, I'm in the pages controller but is there a
 way to jump to another controller on the fly?

 Any help would be great.

 Thanks.
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Controller function parameter is lost

2008-10-28 Thread Dardo Sordi Bogado

Try

 ?php echo $form-create('User', array('url' = array('action'  =
'changePassword', 3))); ?

I'm sure you'll be able to make it works for others ids than 3 ;)

HTH,
- Dardo Sordi.

On Tue, Oct 28, 2008 at 12:30 AM, R. Davila [EMAIL PROTECTED] wrote:

 Hi,

 I have a controller function, and the corresponding view, setup like this:

 function changePassword($id = null)

 change_password.ctp

  ?php echo $form-create('User', array('action' = 'changePassword')); ?
  ?php echo $form-hidden('password'); ?
  .
  . Here I add the fields for old password, new password and retype new 
 password
  .
  ?php echo $form-end('Submit'); ?

 The following is the generated html (the parameter to the changePassword 
 function is the user id, in this case 3):

  form id=UserChangePasswordForm method=post 
 action=/users/changePassword/3
  fieldset style=display:none;input type=hidden name=_method 
 value=POST //fieldset
  input type=hidden name=data[User][password] value=encrypted password 
 value id=UserPassword /

 So far so good.

 The problem is that when I fill the form fields and click the Submit button,
  the data is being posted to /users/changePassword instead of 
 /users/changePassword/3

 I'm writing $this-params to the FirePHP console at the top of the 
 changePassword function and this is what I get:

 When I access the page initially:

 Array
 (
  [pass] = Array
   (
[0] = 3
   )
  [named] = Array
(
)
  [controller] = users
  [action] = changePassword
  [plugin] =
  [form] = Array
   (
   )
  [url] = Array
  (
   [url] = users/changePassword/3
  )
 )

 After I click on Submit:

 Array
 (
  [pass] = Array
   (
   )
  [named] = Array
(
)
  [controller] = users
  [action] = changePassword
  [plugin] =
  [form] = Array
   (
   )
  [url] = Array
  (
   [url] = users/changePassword
  )
 )

 As you can see the user id parameter is lost.

 Any ideas?

 Thanks in advance.


 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: question about relationship

2008-10-28 Thread Dardo Sordi Bogado

This:

var $hasMany = array('OrderMoviments');

Should be:

var $hasMany = array('OrderMoviment');

or:

var $hasMany = array('OrderMoviments' = array('className' =
'OrderMoviment'));

On Mon, Oct 27, 2008 at 3:12 PM, carlos ferrandis [EMAIL PROTECTED] wrote:

 I have posted another item using a diferent approach to the same
 problem. it is in

 http://groups.google.com/group/cake-php/browse_thread/thread/162e7b5d1daf8287#

 carlos

 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



More Fields in the HABTM Table

2008-10-28 Thread nomex

Hello, i have a DB Design like this

Table: Users (id, )
Table: Files (id,...)
Table files_users(id, user_id, voucher_id)


now i want to extend the files_users table with folowing fields:
uploaded and viewed (each a datetime)
how can i do this? didn't know where to start!

thanks for your 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: how can i set one controller to render actions from another controller in cakephp 1.2

2008-10-28 Thread teknoid

Are you sure this functionality shouldn't be in the model?

requestAction() is expensive and slow.

I'm not really sure what your action is doing, but consider this
approach instead:

$this-set('pish', $this-CurrentModel-RelatedModel-
getSomeData($withSomeParams));

or if the models are really not related, you can load the other
model:

$OtherModel  = ClassRegistry::init('OtherModelName');
$this-set('pish', $OtherModel-getSomeData($withSomeParams));

Either way, really it comes down to fat models and skinny controllers
and proper place to keep the logic.

On Oct 28, 4:23 am, johnbl4ck [EMAIL PROTECTED] wrote:
 yes i got that. buthttp://127.0.0.2/sections/view/14/autocard/4

 actually calls sections controller with method view and param 14,
 autocard is method of cars controller and it's param should be 4 but i
 can't get how to handle this via requestAction

 On 28 окт, 14:09, zwobot [EMAIL PROTECTED] wrote:

  Passing parameters via URL:
  /controller_name/action_name/parameter_1/parameter_2/
  parameter_n

  Parameters are added with slashes into the URL after the action name,
  so if you have an action autocard in your controller: (let's assume it
  is called PostsController)

  function autocard ($param1, $param2) {
    echo $param1;
    echo $param2;

  }

  Now you can call this function with the URL /posts/autocard/hello/
  world
  and it would print you in the view: hello world
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



setting up a $paginator.

2008-10-28 Thread Paamayim

Hi all.

This is my situation.

I have a ready element to display a pagebar (paginator.ctp) who does
make use of $paginator object to display page links, accessing
$paginator-params().

On the other hand, I have a full-custom sql query to gather the rows
to display (select ... where ... limit ...) and I have to stick with
it. I also have $page, $perpage, $npages scalar information.

My question is: how do I pass that information ($page, $perpage, ...)
to the $paginator object in the controller (?) so that the pagebar is
displayed correctly?

(if you're wondering, yes I've started learning CakePHP only a week
ago, so I'm still a beginner)

Thanks for any tips anyone could give me.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: More Fields in the HABTM Table

2008-10-28 Thread teknoid

cake creates a model for the join table, which you can use just like
any other model.
take a look here, hopefully it'll help:

http://teknoid.wordpress.com/2008/07/03/notes-on-cakephp-habtm-part-1-the-basics/

On Oct 28, 7:11 am, nomex [EMAIL PROTECTED] wrote:
 Hello, i have a DB Design like this

 Table: Users (id, )
 Table: Files (id,...)
 Table files_users(id, user_id, voucher_id)

 now i want to extend the files_users table with folowing fields:
 uploaded and viewed (each a datetime)
 how can i do this? didn't know where to start!

 thanks for your 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: setting up a $paginator.

2008-10-28 Thread teknoid

Why do you have to stick with a custom query?
What is it?

On Oct 28, 6:30 am, Paamayim [EMAIL PROTECTED] wrote:
 Hi all.

 This is my situation.

 I have a ready element to display a pagebar (paginator.ctp) who does
 make use of $paginator object to display page links, accessing
 $paginator-params().

 On the other hand, I have a full-custom sql query to gather the rows
 to display (select ... where ... limit ...) and I have to stick with
 it. I also have $page, $perpage, $npages scalar information.

 My question is: how do I pass that information ($page, $perpage, ...)
 to the $paginator object in the controller (?) so that the pagebar is
 displayed correctly?

 (if you're wondering, yes I've started learning CakePHP only a week
 ago, so I'm still a beginner)

 Thanks for any tips anyone could give me.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



HABTM in rc3 need now field id in link table.

2008-10-28 Thread Alexandru

i have a HABTM products-alloweduses

this is the linking table.

CREATE TABLE IF NOT EXISTS `alloweduses_products` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `allowedus_id` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `value` enum('yes','no','na') collate latin1_general_ci NOT NULL
default 'na',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `uk` (`allowedus_id`,`product_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
AUTO_INCREMENT=36 ;

if i remove id the edit of product will fail. anyone know about this
bug? there is already an opened ticket?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: setting up a $paginator.

2008-10-28 Thread Paamayim

 Why do you have to stick with a custom query?
 What is it?

Actually it's a want to rather than a have to.

By the way it's a query to browse photos with several filtering/
sorting/display/relationship options and it's not my priority (right
now, but later I'll do) to experiment with built-in ::paginate().

I have to accomplish this task and my time is limited, I have the
query ready, the paginator.ctp render element ready because other
controllers use it and I must join them.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



AW: concatenation in find('list')

2008-10-28 Thread Liebermann, Anja Carolin

Hi Mario,

I have similar situations in my application and I guess there is no automatic 
way to do it.

So what I do is get the data wth all fields and loop through them and create 
another array with value = id and shown sring firstname + family name.

If there is a more elegant solution I don't know it.

Anja


-Ursprüngliche Nachricht-
Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von mario
Gesendet: Sonntag, 26. Oktober 2008 16:09
An: CakePHP
Betreff: concatenation in find('list')


Hi guys,

I have this following code snippet from my controller:

$salespeople = $this-Campaign-Salesperson-find('list',
  array('order' = 'Salesperson.firstname ASC',
  'fields' = array('Salesperson.id', 
'Salesperson.firstname')));


In my view, I have this following line:

echo $form-input('salesperson_id');


This codes would create a combobox in my view that would have a key: 
salesperson.id and value: salesperson.firstname


Now here is what I want to do:

I also have a field 'lastname' under my salespeople table and I want it to be 
concatenated to the salespersons'
firstname (with a space between the firstname and lastname).

I can't just have the firstname in my combobox because there is a high 
possibility that there would be duplicates for firstnames.
It would be better if firstname and lastname would be displayed in my view's 
combobox and still would match to a corresponding salesperson.id.

Is there a way to do this?


Thanks,
Mario


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM in rc3 need now field id in link table.

2008-10-28 Thread [EMAIL PROTECTED]


I believe that when you have extra fields in a linking table you are
also required to have a primary key. I am not sure if Cake ca handle a
composite pk in this case. I.e. making your unique key into a primary.

/Martin


On Oct 28, 1:53 pm, Alexandru [EMAIL PROTECTED] wrote:
 i have a HABTM products-alloweduses

 this is the linking table.

 CREATE TABLE IF NOT EXISTS `alloweduses_products` (
   `id` int(10) unsigned NOT NULL auto_increment,
   `allowedus_id` int(10) unsigned NOT NULL,
   `product_id` int(10) unsigned NOT NULL,
   `value` enum('yes','no','na') collate latin1_general_ci NOT NULL
 default 'na',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `uk` (`allowedus_id`,`product_id`)
 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
 AUTO_INCREMENT=36 ;

 if i remove id the edit of product will fail. anyone know about this
 bug? there is already an opened ticket?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



AW: setting up a $paginator.

2008-10-28 Thread Liebermann, Anja Carolin

Hi  paamayim,

I found what villas posted on this list some weeks ago: 

Well we don't know what hacks you've read,  but here's a few things I
saw:

FAQ see section:  How to retain search param in paging?
http://groups.google.com/group/cake-php/web/faq?hl=en

A few other links I found:
http://groups.google.com/group/cake-php/msg/d9d2413b818446bd
http://bakery.cakephp.org/tags/view/pagination
http://www.hirdweb.com/2008/08/04/custom-pagination-in-cakephp/


I hope this helps!

Anja

-Ursprüngliche Nachricht-
Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Paamayim
Gesendet: Dienstag, 28. Oktober 2008 14:29
An: CakePHP
Betreff: Re: setting up a $paginator.


 Why do you have to stick with a custom query?
 What is it?

Actually it's a want to rather than a have to.

By the way it's a query to browse photos with several filtering/ 
sorting/display/relationship options and it's not my priority (right now, but 
later I'll do) to experiment with built-in ::paginate().

I have to accomplish this task and my time is limited, I have the query ready, 
the paginator.ctp render element ready because other controllers use it and I 
must join them.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: concatenation in find('list')

2008-10-28 Thread mario

Thanks. But Chad's suggestion works fine for me.
I suggest you also try it. =)


On Oct 28, 6:29 am, Liebermann, Anja Carolin
[EMAIL PROTECTED] wrote:
 Hi Mario,

 I have similar situations in my application and I guess there is no automatic 
 way to do it.

 So what I do is get the data wth all fields and loop through them and create 
 another array with value = id and shown sring firstname + family name.

 If there is a more elegant solution I don't know it.

 Anja

 -Ursprüngliche Nachricht-
 Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von mario
 Gesendet: Sonntag, 26. Oktober 2008 16:09
 An: CakePHP
 Betreff: concatenation in find('list')

 Hi guys,

 I have this following code snippet from my controller:

 $salespeople = $this-Campaign-Salesperson-find('list',
                                   array('order' = 'Salesperson.firstname 
 ASC',
                                           'fields' = array('Salesperson.id', 
 'Salesperson.firstname')));

 In my view, I have this following line:

 echo $form-input('salesperson_id');

 This codes would create a combobox in my view that would have a key: 
 salesperson.id and value: salesperson.firstname

 Now here is what I want to do:

 I also have a field 'lastname' under my salespeople table and I want it to be 
 concatenated to the salespersons'
 firstname (with a space between the firstname and lastname).

 I can't just have the firstname in my combobox because there is a high 
 possibility that there would be duplicates for firstnames.
 It would be better if firstname and lastname would be displayed in my view's 
 combobox and still would match to a corresponding salesperson.id.

 Is there a way to do this?

 Thanks,
 Mario
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Wamp cakePHP allright except bake

2008-10-28 Thread soldier.coder

Jacques,

The key to your problem is in your phrasing: everything works fine
until  In my experience, if your database worked fine before you
tried console, you probably have a pathing problem.  Cake has some
nice docs and if you want the long spiel on what to do, check out
http://book.cakephp.org/view/109/Introduction.  If you like short
concise instructions, here are mine:

1) Find the path to your Wamp's installation of php (if you are
installed on C: with defaults, most likely it is C:\wamp\bin\php
\php5.2.6.  Add that to your path.

2) Find the path to your app's cake console directory.  For example, I
developed an app called gradebook, so my path ended up being C:\wamp
\www\gradebook\cake\console.
You guessed it, add that to your path.

Btw, to add those to your path it is best if you add them to the
environment variables on your machine.

Restart your machine so the environment variables kick in.

Open a command window.  Change directories to your app's main
directory.
type cake bake and you should see a standard interactive menu for
cake.

If this did not work you have a configuration error.  If it did work,
congrats!



On Oct 27, 12:23 pm, Jacques Coeur [EMAIL PROTECTED] wrote:
 Hi,

 I am using cakephp and I am currently following the tutorial from IBM
 (currently part2).
 Everything was working fine until I needed to bake the Models (or the
 Controller).

 Whever I choose the test or default settings, I get :
 
 Fatal error : call to undefined function mysql_connect() in /dbo/
 dbi_mysql.php.
 
 The application can connect to the database otherwise.
 I only get an error with the baking ...

 Do you have any idea ?

 Thanks in advance.
 JCoeur
 PS : I am using apache 1.3, php 5x
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: is Cakephp 1.2 faster than Code Igniter ?

2008-10-28 Thread mbavio

Amen! That Hello World test are so useless... Teknoid, you are the
man!

Cheers,
mbavio

On Oct 27, 11:38 pm, teknoid [EMAIL PROTECTED] wrote:
 Here's a test...

 Create a file index.html in the web root of your server with the
 content hello world.
 Now take any framework and compare the speed it takes to render... the
 index.html framework beats them all!

 On the other hand we can do another test...

 Take CakePHP and develop a fully functional application with 60 models
 (or so) in two months. To double it's performance we purchase a
 dedicated server for $119/month.
 Or we could write one from scratch in about 4 months (if we're lucky),
 which means that we've spend 320 extra hours of development time (40
 hrs per week * 8 extra weeks) at $75/hr.. which translates to extra
 $24,000 spent on the project.

 I'm not really sure, which one of these tests is more pointless ...
 but to me it seems silly to measure a framework's performance with
 hello world.

 On Oct 27, 12:04 pm, wahyu setianto [EMAIL PROTECTED]
 wrote:

  I have read inhttp://www.yiiframework.com/performance, it is true ? i know
  that CI is faster than cakephp because CI is not using OOP actualy

  --
  Octopus
  East Java Baker
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: concatenation in find('list')

2008-10-28 Thread Samuel DeVore

The way I do it based on http://c7y.phparch.com/c/entry/1/art,mvc_and_cake and
http://www.pseudocoder.com/archives/2008/10/24/cakephp-custom-find-types/

I add to my app_model.php file (as per Matt's article)

function find($type, $options = array()) {
  $method = null;
  if(is_string($type)) {
$method = sprintf('__find%s', Inflector::camelize($type));
  }

  if($method  method_exists($this, $method)) {
return $this-{$method}($options);
  } else {
return parent::find($type, $options);
  }
}

Then I can create custom find types in models that need them, like in
my User model I have

function __findNames($options = array()) {
$users = $this-find('all', array(
'fields'=array('id','last_name','first_name'),

'order'=array('last_name','first_name'),'recursive'=-1));
$users = Set::combine($users, 
'{n}.User.id',array('%s
%s','{n}.User.first_name','{n}.User.last_name'));
return $users;

}   

which then  I can call when I need it like

$usersListForSelectMenu = $this-Dingus-User-find('names',array
(stuff in here))





On Tue, Oct 28, 2008 at 6:43 AM, mario [EMAIL PROTECTED] wrote:

 Thanks. But Chad's suggestion works fine for me.
 I suggest you also try it. =)


 On Oct 28, 6:29 am, Liebermann, Anja Carolin
 [EMAIL PROTECTED] wrote:
 Hi Mario,

 I have similar situations in my application and I guess there is no 
 automatic way to do it.

 So what I do is get the data wth all fields and loop through them and create 
 another array with value = id and shown sring firstname + family name.

 If there is a more elegant solution I don't know it.

 Anja

 -Ursprüngliche Nachricht-
 Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von mario
 Gesendet: Sonntag, 26. Oktober 2008 16:09
 An: CakePHP
 Betreff: concatenation in find('list')

 Hi guys,

 I have this following code snippet from my controller:

 $salespeople = $this-Campaign-Salesperson-find('list',
   array('order' = 'Salesperson.firstname 
 ASC',
   'fields' = 
 array('Salesperson.id', 'Salesperson.firstname')));

 In my view, I have this following line:

 echo $form-input('salesperson_id');

 This codes would create a combobox in my view that would have a key: 
 salesperson.id and value: salesperson.firstname

 Now here is what I want to do:

 I also have a field 'lastname' under my salespeople table and I want it to 
 be concatenated to the salespersons'
 firstname (with a space between the firstname and lastname).

 I can't just have the firstname in my combobox because there is a high 
 possibility that there would be duplicates for firstnames.
 It would be better if firstname and lastname would be displayed in my view's 
 combobox and still would match to a corresponding salesperson.id.

 Is there a way to do this?

 Thanks,
 Mario
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: concatenation in find('list')

2008-10-28 Thread teknoid

To keep your controllers skinny, the following approach (using pretty
much the same method does the trick):
http://teknoid.wordpress.com/2008/09/04/findlist-with-three-or-combined-fields/

Also, once you retrive the results and set them to a certain variable
in the controller, there is no need to pass the array to the view.
CakePHP will handle it for you... (another shameless self-promo :) )
http://teknoid.wordpress.com/2008/08/08/automagical-selects-or-checkboxes/


On Oct 28, 9:29 am, Liebermann, Anja Carolin
[EMAIL PROTECTED] wrote:
 Hi Mario,

 I have similar situations in my application and I guess there is no automatic 
 way to do it.

 So what I do is get the data wth all fields and loop through them and create 
 another array with value = id and shown sring firstname + family name.

 If there is a more elegant solution I don't know it.

 Anja

 -Ursprüngliche Nachricht-
 Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von mario
 Gesendet: Sonntag, 26. Oktober 2008 16:09
 An: CakePHP
 Betreff: concatenation in find('list')

 Hi guys,

 I have this following code snippet from my controller:

 $salespeople = $this-Campaign-Salesperson-find('list',
                                   array('order' = 'Salesperson.firstname 
 ASC',
                                           'fields' = array('Salesperson.id', 
 'Salesperson.firstname')));

 In my view, I have this following line:

 echo $form-input('salesperson_id');

 This codes would create a combobox in my view that would have a key: 
 salesperson.id and value: salesperson.firstname

 Now here is what I want to do:

 I also have a field 'lastname' under my salespeople table and I want it to be 
 concatenated to the salespersons'
 firstname (with a space between the firstname and lastname).

 I can't just have the firstname in my combobox because there is a high 
 possibility that there would be duplicates for firstnames.
 It would be better if firstname and lastname would be displayed in my view's 
 combobox and still would match to a corresponding salesperson.id.

 Is there a way to do this?

 Thanks,
 Mario
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: ?CAKEPHP= at end of links

2008-10-28 Thread Niraj Shah

Thanks! How do I enable cookies? I'm not using any on my site so I'm
not sure why it's happening.

On Oct 28, 2:42 am, Liebermann, Anja Carolin
[EMAIL PROTECTED] wrote:
 Hi Niraj,

 That sounds like the cookies are switched off and the session-id is attached 
 to the Url, as they should be, when Cookies are disabled.

 Anja

 -Ursprüngliche Nachricht-
 Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Niraj 
 Shah
 Gesendet: Dienstag, 28. Oktober 2008 05:20
 An: CakePHP
 Betreff: ?CAKEPHP= at end of links

 Hi everyone. I just redid my website (www.tlgmedia.com) using CakePHP.
 I love it, but every now and then any links I've created will add ?
 CAKEPHP=random characters to the end of the url. Does anyone know how to 
 prevent this from happening? Thanks.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: setting up a $paginator.

2008-10-28 Thread teknoid

... and the fastest and best to achieve it is to follow the
framework's methods.

But if you'd rather spend time trying to hack around the problem,
that's certainly up to you.

On Oct 28, 9:28 am, Paamayim [EMAIL PROTECTED] wrote:
  Why do you have to stick with a custom query?
  What is it?

 Actually it's a want to rather than a have to.

 By the way it's a query to browse photos with several filtering/
 sorting/display/relationship options and it's not my priority (right
 now, but later I'll do) to experiment with built-in ::paginate().

 I have to accomplish this task and my time is limited, I have the
 query ready, the paginator.ctp render element ready because other
 controllers use it and I must join them.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Error in using 3rd party helper - ExcelWriter

2008-10-28 Thread mario

I've seen this helper in thebakery (ExcelWriter)
http://bakery.cakephp.org/articles/view/generate-excel-spreadsheets-from-your-database

and I tried using it in my application.

However, when I tried to include the helper in my app with this line:
var $helpers = array('Html', 'Form','Excel');

I get the following notice:

Notice (8): Undefined property: ExcelHelper::$helpers [CORE\cake\libs
\view\view.php, line 748]
View::_loadHelpers() - CORE\cake\libs\view\view.php, line 748
View::_render() - CORE\cake\libs\view\view.php, line 633
View::render() - CORE\cake\libs\view\view.php, line 372
Controller::render() - CORE\cake\libs\controller\controller.php, line
744
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 262
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 213
[main] - APP\webroot\index.php, line 90


Here is the line where the notice occurred:

$loaded[$helper]-validationErrors = $this-validationErrors;
}
if (is_array($loaded[$helper]-helpers)  !empty($loaded[$helper]-
helpers)) { //this is highlighted in yellow



Here is the context of the notice:

$loaded =   array(
Html = HtmlHelper
HtmlHelper::$tags = array
HtmlHelper::$base = /testing
HtmlHelper::$here = /testing/salesScreen
HtmlHelper::$params = array
HtmlHelper::$action = index
HtmlHelper::$data = NULL
HtmlHelper::$_crumbs = array
HtmlHelper::$__docTypes = array
HtmlHelper::$helpers = NULL
HtmlHelper::$webroot = /testing/
HtmlHelper::$themeWeb = NULL
HtmlHelper::$plugin = NULL
HtmlHelper::$namedArgs = NULL
HtmlHelper::$argSeparator = NULL
HtmlHelper::$validationErrors = NULL
HtmlHelper::$__tainted = NULL
HtmlHelper::$__cleaned = NULL
HtmlHelper::$_log = NULL,
Form = FormHelper
FormHelper::$helpers = array
FormHelper::$fieldset = array
FormHelper::$__options = array
FormHelper::$fields = array
FormHelper::$requestType = NULL
FormHelper::$base = /testing
FormHelper::$webroot = /testing/
FormHelper::$themeWeb = NULL
FormHelper::$here = /testing/salesScreen
FormHelper::$params = array
FormHelper::$action = index
FormHelper::$plugin = NULL
FormHelper::$data = NULL
FormHelper::$namedArgs = NULL
FormHelper::$argSeparator = NULL
FormHelper::$validationErrors = NULL
FormHelper::$tags = array
FormHelper::$__tainted = NULL
FormHelper::$__cleaned = NULL
FormHelper::$_log = NULL
FormHelper::$Html = HtmlHelper object,
Excel = ExcelHelper
ExcelHelper::$workbook = ExcelWriter object
ExcelHelper::$worksheets = array
ExcelHelper::$formats = array
ExcelHelper::$font = Arial
ExcelHelper::$size = 10
ExcelHelper::$align = left
ExcelHelper::$valign = vcenter
ExcelHelper::$bold = 0
ExcelHelper::$italic = 0
ExcelHelper::$_filename = NULL
ExcelHelper::$_parser = NULL
ExcelHelper::$_1904 = NULL
ExcelHelper::$_activesheet = NULL
ExcelHelper::$_firstsheet = NULL
ExcelHelper::$_selected = NULL
ExcelHelper::$_xf_index = NULL
ExcelHelper::$_fileclosed = NULL
ExcelHelper::$_biffsize = NULL
ExcelHelper::$_sheetname = NULL
ExcelHelper::$_tmp_format = NULL
ExcelHelper::$_worksheets = NULL
ExcelHelper::$_sheetnames = NULL
ExcelHelper::$_formats = NULL
ExcelHelper::$_palette = NULL
ExcelHelper::$_url_format = NULL
ExcelHelper::$_codepage = NULL
ExcelHelper::$_country_code = NULL
ExcelHelper::$_tmp_dir = NULL
ExcelHelper::$_string_sizeinfo_size = NULL
ExcelHelper::$_BIFF_version = 1280
ExcelHelper::$_byte_order = NULL
ExcelHelper::$_data = NULL
ExcelHelper::$_datasize = NULL
ExcelHelper::$_limit = NULL
ExcelHelper::$base = /testing
ExcelHelper::$webroot = /testing/
ExcelHelper::$here = /testing/salesScreen
ExcelHelper::$params = array
ExcelHelper::$action = index
ExcelHelper::$data = NULL
ExcelHelper::$themeWeb = NULL
ExcelHelper::$plugin = NULL
)
$helpers=   array(
Html,
Form,
Excel,
Paginator,
Session
)
$parent =   null
$helper =   Excel
$i  =   2
$options=   array()
$plugin =   null
$helperCn   =   ExcelHelper
$isLoaded   =   false
$vars   =   array(
base,
webroot,
here,
params,
action,
data,
themeWeb,
plugin
)
$c  =   8
$j  =   8

It is very annoying to see this notice every time I set my
cakephp debug level to 2. Any idea on why this notice
occurs? Has anyone found a workaround to remove the
said notice?


Please help. I know that there is always someone there
in the cakephp community to count in to.



Thanks,

Mario




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM in rc3 need now field id in link table.

2008-10-28 Thread Alexandru

in rc2 all worked ok and i had to add some simple code in product
model to work
class AllowedusesProduct extends AppModel {

var $name = 'AllowedusesProduct';
var $useTable = 'alloweduses_products';

function beforeSave(){
$this-id = null;
return true;
}
}
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM in rc3 need now field id in link table.

2008-10-28 Thread teknoid

As far as I remember 'id' (or primary key column) was always required
for the join table to work correctly.
Cake doesn't support compound keys, so to ensure uniqueness of the
records the primary column is required.
At any rate it is certainly not a bug.

P.S. Also, cake doesn't support 'enums' out-of-the-box.

On Oct 28, 10:47 am, Alexandru [EMAIL PROTECTED] wrote:
 in rc2 all worked ok and i had to add some simple code in product
 model to work
 class AllowedusesProduct extends AppModel {

         var $name = 'AllowedusesProduct';
         var $useTable = 'alloweduses_products';

         function beforeSave(){
                 $this-id = null;
                 return true;
         }

 }


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM in rc3 need now field id in link table.

2008-10-28 Thread Alexandru

no no in rc2 this was on manual
Recipe HABTM Tag  = recipes_tags.recipe_id, recipes_tags.tag_id
BUT now they changed in manual and put this
Recipe HABTM Tag  = id,recipes_tags.recipe_id, recipes_tags.tag_id

now i know for sure it is NOT a BUG.

TOPIC CLOSED
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Error in using 3rd party helper - ExcelWriter

2008-10-28 Thread Samuel DeVore

In the excell helper try adding

var $helpers = array();

this has worked in some other older helpers when I upgraded to cake
1.2  (note i have not used the excel helper at all)

Sam D

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: is Cakephp 1.2 faster than Code Igniter ?

2008-10-28 Thread LunarDraco

I don't know about the rest of you.

But I don't use a Framework for its amazingly fast code. If I wanted
really fast code I'd write it all myself specific to each project.
I use a framework to decrease the amount of time I have to spend
working on any one project.
I use a framework to reduce the risk of a potentially major and costly
bugs.
I use a framework because I enjoy working with a good set of tools
covering a breadth of sometimes challenging topics.
And most important I use a framework because of the dedication and
commitment the community surrounding a framework has in improving the
aforementioned reasons.

Which framework is faster? It doesn't really matter if your project
never gets deployed.
I've found people looking for the fastest framework are just to lazy
to profile a working app to see exactly where the app has a real speed
issue that would even matter to the end user of the app.
These same type seem to profile the application before they have any
useful and functional code to profile.
And if your really curious Hello World! is neither useful or
functional. At least not to me or my customers.

If you were a real part of any of these communities your efforts in
profiling the speed of a framework should be to fix and contribute
faster code with test to the frameworks core. If you can neither fix
or contribute to the source then you don't understand the core, which
also means you shouldn't be profiling something you don't understand.

From my own experience with my end users, not one of them has
complained about the speed of the apps I've written using cakephp.
They have all made multiple request for more features, or for changes
in existing features. Which happily I'm able to say I can usually turn
those features out in a couple hours or days. Had I a faster framework
I'm sure those features would have taken weeks.

Comparing a frameworks speed is kinda like comparing the RPM of the
engine of race cars. Just because the engines rpm is faster to rev up
and just because the engines top rpm is greater than the other.
Doesn't mean the car will win. Their are so many more components like
the drive tran and wheel size, tire composition, and most important
the driver and his understanding of his machine.

LunarDraco

On Oct 28, 8:00 am, mbavio [EMAIL PROTECTED] wrote:
 Amen! That Hello World test are so useless... Teknoid, you are the
 man!

 Cheers,
 mbavio

 On Oct 27, 11:38 pm, teknoid [EMAIL PROTECTED] wrote:

  Here's a test...

  Create a file index.html in the web root of your server with the
  content hello world.
  Now take any framework and compare the speed it takes to render... the
  index.html framework beats them all!

  On the other hand we can do another test...

  Take CakePHP and develop a fully functional application with 60 models
  (or so) in two months. To double it's performance we purchase a
  dedicated server for $119/month.
  Or we could write one from scratch in about 4 months (if we're lucky),
  which means that we've spend 320 extra hours of development time (40
  hrs per week * 8 extra weeks) at $75/hr.. which translates to extra
  $24,000 spent on the project.

  I'm not really sure, which one of these tests is more pointless ...
  but to me it seems silly to measure a framework's performance with
  hello world.

  On Oct 27, 12:04 pm, wahyu setianto [EMAIL PROTECTED]
  wrote:

   I have read inhttp://www.yiiframework.com/performance, it is true ? i know
   that CI is faster than cakephp because CI is not using OOP actualy

   --
   Octopus
   East Java Baker
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Loading components from actions

2008-10-28 Thread LunarDraco

Because solving it now, is solving a problem that doesn't yet exist.
If you can not run/deploy your app then that is the first problem you
need to resolve.
And between now and the time you figure out the problem to run/deploy
your app this startup issue may never be the problem.
So solving it now is going to delay you getting a functional app.

On Oct 27, 4:41 pm, Turnquist, Jonah [EMAIL PROTECTED] wrote:
 No, it does not work for components that take use of startup()
 shutdown() or initialize()

 Sure, there will be worse bottlenecks, but why not solve this one now
 instead of later?

 I have created a ComponentLoaderComponent that will do my bidding for
 the meantime.

 I am assuming cake has no built in commands to load components on run-
 time then.  I have created a ticket for this.

 Thanks for your help (*not being sarcastic)

 On Oct 27, 3:10 pm, teknoid [EMAIL PROTECTED] wrote:

  Have you tried to use it? Does it work? Does it do what you need?

  ... as far as best practices go, it's best to build something and then
  worry about optimization.

  I assure you that you'll run into a lot more interesting and demanding
  issues before you get to the point where the bottleneck of your
  application will depend on when/where your Email component is
  instantiated.

  On Oct 27, 5:52 pm, Turnquist, Jonah [EMAIL PROTECTED] wrote:

   Erm... yes that will work, kind of, but then initialize(), startup()
   and shutdown() will not be called in the component (at least I don't
   see how they could... am I wrong?).

   I did not do any speed tests, but I would not like components to be
   instantiated unless needed (for instance what if the email component
   had a very heavy startup() method?  I am trying to develop good
   practices).

   My code seems more logical this way.  Here is a pseudocode code
   example

   register action:
   --if registration data validates {
   save user
   load email component
   send email to confirm given email address
   --}

   This way the email component is not loaded until the app is 100% sure
   it will even be sure.

   ...unless maybe cake will handle this potential speed problem for me
   in some way I can not imagine? I am in doubt but anyone is free to
   inform me.

   On Oct 27, 2:35 pm, teknoid [EMAIL PROTECTED] wrote:

Well, it does... but did you remember to:
$email = new EmailComponent; ?

p.s. what speed reasons did you run into?

On Oct 27, 5:21 pm, Turnquist, Jonah [EMAIL PROTECTED] wrote:

 I've come across a need to load a component via the action for speed
 reasons.

 My case:
 I have a user controller with view(), login(), and register()
 actions.  I need the email component in, and only in, the register()
 action.  So using var $components = array(etc); is not something I
 want to do for speed reasons.  I do not want the component loaded for
 actions that do not use it.

 Looking at the docs it looks like this should work:
 App::import('Component', 'Email');

 But it doesn't. (??)

 So how can this be done?

 Thanks,
 Jonah
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Politics aside.....

2008-10-28 Thread Walker Hamilton

I just thought I'd let the cakePHP community know that cakePHP is
powering a site and a utility service at the Barack Obama website. I
built both of these.

Here's the site: http://radar.barackobama.com/

The utility service isn't anything to look at, but let's just say,
it's provided some much needed plumbing for our infrastructure.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to render jscript code into a div when updating with Ajax

2008-10-28 Thread heavylu

HI everyone,

I adapted an sliding menu made in java script to be used in my
project, I got it to work with the framework, but just in some cases:
It can be called as component and displayed on a div on my layout in
normal use, but when I use ajax to update the content of the div and I
try to render the menu into the div, the site breaks down and the
entire layout is dropped. I mean, the html headers and everything is
ignored so the javascript catches many errors and is not displayed
properly, and the other divs of the layout disappear.  This bug only
happens when I try to put the javascript into the div; when I put pure
html everything goes smoothly.

I hope someone knows what is wrong with my site.

Thanks in advance.




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



AW: ?CAKEPHP= at end of links

2008-10-28 Thread Liebermann, Anja Carolin

Hi Niraj,

The user enables the cookies in his or her browser. If they aren't enabled the 
session ID is attached.If you start a session the you hvae this problem. 

Have a look here:
http://manual.cakephp.org/view/173/Sessions

Also do a bit background reading on Sessions:
http://en.wikipedia.org/wiki/Session_ID

Anja

-Ursprüngliche Nachricht-
Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Niraj 
Shah
Gesendet: Dienstag, 28. Oktober 2008 15:11
An: CakePHP
Betreff: Re: ?CAKEPHP= at end of links


Thanks! How do I enable cookies? I'm not using any on my site so I'm not sure 
why it's happening.

On Oct 28, 2:42 am, Liebermann, Anja Carolin
[EMAIL PROTECTED] wrote:
 Hi Niraj,

 That sounds like the cookies are switched off and the session-id is attached 
 to the Url, as they should be, when Cookies are disabled.

 Anja

 -Ursprüngliche Nachricht-
 Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im 
 Auftrag von Niraj Shah
 Gesendet: Dienstag, 28. Oktober 2008 05:20
 An: CakePHP
 Betreff: ?CAKEPHP= at end of links

 Hi everyone. I just redid my website (www.tlgmedia.com) using CakePHP.
 I love it, but every now and then any links I've created will add ?
 CAKEPHP=random characters to the end of the url. Does anyone know how to 
 prevent this from happening? Thanks.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



phpvideotutorials.com

2008-10-28 Thread gemmes

Hi all,


I bought the cakephp video tutorials this morning, I still have not
received a digital download or a confirmation email after paying
through Paypal (received confirmation from paypal).

has anyone else bought the 'paid tutorials' from
phpvideotutorials.com? What happens next? Should I have received the
digital download already?


Note: I know phpvideotutorials.com has its own forum but Im waiting
for activation, and im still waiting for a email response from them
too.

thanks


gemmes

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: An informal survey of development times using cake

2008-10-28 Thread teknoid

Here's one very interesting case study:
http://bakery.cakephp.org/articles/view/how-i-built-a-web-2-0-dating-site-in-66-5-hours


On Oct 28, 6:03 am, keymaster [EMAIL PROTECTED] wrote:
 A post by Teknoid in this 
 thread:http://groups.google.com/group/cake-php/browse_thread/thread/0635f46f...

 ... got me thinking.

 Wouldn't it be nice to see some (very informal) accounts of actual
 development times experienced using cakePHP?

 Something like:
 (app metrics, weeks)?

 I was thinking of little more than a thread in this forum. One post in
 the thread per project. Describe the project, Tell us how long you
 spent on development.

 What do people think?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Error in using 3rd party helper - ExcelWriter

2008-10-28 Thread mario

Thanks Samuel. Your suggestion works perfectly.

Cheers!

On Oct 28, 8:07 am, Samuel DeVore [EMAIL PROTECTED] wrote:
 In the excell helper try adding

 var $helpers = array();

 this has worked in some other older helpers when I upgraded to cake
 1.2  (note i have not used the excel helper at all)

 Sam D
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: More Fields in the HABTM Table

2008-10-28 Thread nomex

i don't look through.

how can i create an insert?

$this-data['File']['id'] = '99';
$this-data['User']['id'] = '66';
$this-data['FilesUser']['uploaded'] = '2008-06-06 06:06:20';

when i call $this-File-save($this-data);
it saves the user.id and the file.id in the Table, and leaves the
ofther files blank!



On 28 Okt., 13:26, teknoid [EMAIL PROTECTED] wrote:
 cake creates a model for the join table, which you can use just like
 any other model.
 take a look here, hopefully it'll help:

 http://teknoid.wordpress.com/2008/07/03/notes-on-cakephp-habtm-part-1...

 On Oct 28, 7:11 am, nomex [EMAIL PROTECTED] wrote:



  Hello, i have a DB Design like this

  Table: Users (id, )
  Table: Files (id,...)
  Table files_users(id, user_id, voucher_id)

  now i want to extend the files_users table with folowing fields:
  uploaded and viewed (each a datetime)
  how can i do this? didn't know where to start!

  thanks for your help!- Zitierten Text ausblenden -

 - Zitierten Text anzeigen -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: More Fields in the HABTM Table

2008-10-28 Thread teknoid

if you know both id's and just need to save one extra field, save
directly to the join table.
but i'm not willing to elaborate, if you aren't willing to spend some
time to learn.

On Oct 28, 11:55 am, nomex [EMAIL PROTECTED] wrote:
 i don't look through.

 how can i create an insert?

 $this-data['File']['id'] = '99';
 $this-data['User']['id'] = '66';
 $this-data['FilesUser']['uploaded'] = '2008-06-06 06:06:20';

 when i call $this-File-save($this-data);
 it saves the user.id and the file.id in the Table, and leaves the
 ofther files blank!

 On 28 Okt., 13:26, teknoid [EMAIL PROTECTED] wrote:

  cake creates a model for the join table, which you can use just like
  any other model.
  take a look here, hopefully it'll help:

 http://teknoid.wordpress.com/2008/07/03/notes-on-cakephp-habtm-part-1...

  On Oct 28, 7:11 am, nomex [EMAIL PROTECTED] wrote:

   Hello, i have a DB Design like this

   Table: Users (id, )
   Table: Files (id,...)
   Table files_users(id, user_id, voucher_id)

   now i want to extend the files_users table with folowing fields:
   uploaded and viewed (each a datetime)
   how can i do this? didn't know where to start!

   thanks for your help!- Zitierten Text ausblenden -

  - Zitierten Text anzeigen -


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Double Error Message

2008-10-28 Thread thatsgreat2345

I've made  a custom validation for a password field real simple

'pass_confirm' = array(
'samePass' = array('rule' = 
array('samePass'),

'message' = 'Passwords do not match.'

)
),

function samePass($data) {
if ( $this-data['User']['password'] == 
$data['pass_confirm'] )
{
return true;
} else {
return false;
}
}

well whenever the passwords do not match it shows the error message
twice, once before the input and once after the input, this is all I
have, they both have the same class error-message so I don't know why
there is 2.

 if ($form-isFieldError('User.pass_confirm')) { e($form-
error('User.pass_confirm', null));} e($form-
input('pass_confirm',array('label'='Confirm
Password:','type'='password')) . br /\n);

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Ajax Upload Using Prototype in CakePHP

2008-10-28 Thread Yodiaditya
i'm just asking, there are somebody made ajax upload using prototype in
cakePHP?
i'm confusing about iframe in ajax upload, especially in CakePHP.

i see somebody post that http://tomas.epineer.se have good example using
prototype in Ajax Upload.
But, that site get down right now.

Perhaps somebody can share about this problem.


Many thanks...

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: setting up a $paginator.

2008-10-28 Thread Paamayim

@teknoid
 ... and the fastest and best to achieve it is to follow the
 framework's methods.
 But if you'd rather spend time trying to hack around the problem,
 that's certainly up to you.

Sure you're right, but atm I estimate the time to hack smaller than to
learn fw methods.
The query delegate to that sorting may grow in complexity and I may
found hard to build right conditions to pass at the framework. Let's
say I have Photos, that belongs to Users and may have Comments, and
Clicks, and Ratings, and I want to order by Comment count or Rating or
Clicks over a certain span of time, but I don't want to always
estabilish a relationship with Clicks because I'm not always
interested in joining the tables because it may slow down the things
if the table is large, so (I suppose) I cannot play with -recursive
because I don't want to exclude all other relationships. Those are
many doubts of a beginner as I'm, aganist a problem (the pagination of
this thread) that if resolved, will trick them all.

@Liebermann
Thanks for the links. Picking here and there, I managed to get it to
work, I had to dig a bit into controller.php :)

I know that is not the optimal solution for the framework, it's an
hack and is not guaranteed to work for every release and is not
recommended to be used, but if anyone is interested:
A function could be used to create the paging array.

var $helpers = ... 'Paginator' ...;

function foo_controller::browse($page = 1)
{
...
$perpage = 2; // test. 15, 20, ...
$start = ($page - 1) * $perpage;

// custom query
$foos = $this-Foo-query(
select sql_calc_found_rows
Foo.*
from foos Foo
limit $start,$perpage
);

$this-set('foos', $foos);

$count = $this-Foo-query(select found_rows() as count);
$count = $count[0][0]['count'];

$npages = (int)ceil($count/$perpage);

// to transfer paging options to $paginator helper in the view
// my real issue was to accomplish this:
$this-set('paging', array(
'page'  = $page,
'current'   = count($foos),
'count' = $count,
'prevPage'  = ($page  1),
'nextPage'  = ($count  ($page * $perpage)),
'pageCount'= $npages,
'defaults'  = am(array('limit' = 20, 'step' = 1), $this-
paginate), // $this-paginate, found already in the controller
'options'   = array() // didnt know what to put here, put 
array(), it
works
));
}

views/foo/browse.ctp

?php $paginator-params['paging']['Foo'] = $paging; ?
?php echo $this-renderElement('paginator') // I had this element
ready to show a cross-site well styled pagebar ?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Politics aside.....

2008-10-28 Thread Nate

Hey, very cool.  You should submit this to the Cookbook's In the
Wild page.

On Oct 28, 11:33 am, Walker Hamilton [EMAIL PROTECTED] wrote:
 I just thought I'd let the cakePHP community know that cakePHP is
 powering a site and a utility service at the Barack Obama website. I
 built both of these.

 Here's the site:http://radar.barackobama.com/

 The utility service isn't anything to look at, but let's just say,
 it's provided some much needed plumbing for our infrastructure.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: More Fields in the HABTM Table

2008-10-28 Thread nomex

the save direct into the DB worked fine. thx

On 28 Okt., 17:05, teknoid [EMAIL PROTECTED] wrote:
 if you know both id's and just need to save one extra field, save
 directly to the join table.
 but i'm not willing to elaborate, if you aren't willing to spend some
 time to learn.

 On Oct 28, 11:55 am, nomex [EMAIL PROTECTED] wrote:



  i don't look through.

  how can i create an insert?

  $this-data['File']['id'] = '99';
  $this-data['User']['id'] = '66';
  $this-data['FilesUser']['uploaded'] = '2008-06-06 06:06:20';

  when i call $this-File-save($this-data);
  it saves the user.id and the file.id in the Table, and leaves the
  ofther files blank!

  On 28 Okt., 13:26, teknoid [EMAIL PROTECTED] wrote:

   cake creates a model for the join table, which you can use just like
   any other model.
   take a look here, hopefully it'll help:

  http://teknoid.wordpress.com/2008/07/03/notes-on-cakephp-habtm-part-1...

   On Oct 28, 7:11 am, nomex [EMAIL PROTECTED] wrote:

Hello, i have a DB Design like this

Table: Users (id, )
Table: Files (id,...)
Table files_users(id, user_id, voucher_id)

now i want to extend the files_users table with folowing fields:
uploaded and viewed (each a datetime)
how can i do this? didn't know where to start!

thanks for your help!- Zitierten Text ausblenden -

   - Zitierten Text anzeigen -- Zitierten Text ausblenden -

 - Zitierten Text anzeigen -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: An informal survey of development times using cake

2008-10-28 Thread Nate

This sort of thing is probably very difficult to measure.  While
CakePHP does remove the plumbing work that you need to do on your
application, the core business logic in each app is unique, and
therefore difficult to compare on a timeline.

On Oct 28, 6:03 am, keymaster [EMAIL PROTECTED] wrote:
 A post by Teknoid in this 
 thread:http://groups.google.com/group/cake-php/browse_thread/thread/0635f46f...

 ... got me thinking.

 Wouldn't it be nice to see some (very informal) accounts of actual
 development times experienced using cakePHP?

 Something like:
 (app metrics, weeks)?

 I was thinking of little more than a thread in this forum. One post in
 the thread per project. Describe the project, Tell us how long you
 spent on development.

 What do people think?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Politics aside.....

2008-10-28 Thread Marcus Silva

Very nice, got stuck on this page though 
http://radar.barackobama.com/news_items/

The links would not work and could not go back to the home page.


On Oct 28, 4:43 pm, Nate [EMAIL PROTECTED] wrote:
 Hey, very cool.  You should submit this to the Cookbook's In the
 Wild page.

 On Oct 28, 11:33 am, Walker Hamilton [EMAIL PROTECTED] wrote:

  I just thought I'd let the cakePHP community know that cakePHP is
  powering a site and a utility service at the Barack Obama website. I
  built both of these.

  Here's the site:http://radar.barackobama.com/

  The utility service isn't anything to look at, but let's just say,
  it's provided some much needed plumbing for our infrastructure.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Double Error Message

2008-10-28 Thread grigri

FormHelper::input() automatically adds the error message unless you
tell it not too:

?php

echo $form-error('User.pass_confirm'); // No conditional needed,
won't display anything if there is no error

echo $form-input('pass_confirm', array(
  'label' = 'Confirm Password',
  'type' = 'password',
  'error' = false
));

?

On Oct 28, 4:08 pm, thatsgreat2345 [EMAIL PROTECTED] wrote:
 I've made  a custom validation for a password field real simple

 'pass_confirm' = array(
                                                 'samePass' = array('rule' = 
 array('samePass'),
                                                                               
           'message' = 'Passwords do not match.'
                                                                               
           )
                                                 ),

 function samePass($data) {
                                         if ( $this-data['User']['password'] 
 == $data['pass_confirm'] )
 {
                                                 return true;
                                         } else {
                                                 return false;
                                         }
                                 }

 well whenever the passwords do not match it shows the error message
 twice, once before the input and once after the input, this is all I
 have, they both have the same class error-message so I don't know why
 there is 2.

      if ($form-isFieldError('User.pass_confirm')) { 
 e($form-error('User.pass_confirm', null));} e($form-
 input('pass_confirm',array('label'='Confirm

 Password:','type'='password')) . br /\n);
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Politics aside.....

2008-10-28 Thread Mariano Iglesias
Is this a way to convince us Bakers to vote for Obama?

Nate wrote:
 Hey, very cool.  You should submit this to the Cookbook's In the
 Wild page.

 On Oct 28, 11:33 am, Walker Hamilton [EMAIL PROTECTED] wrote:
   
 I just thought I'd let the cakePHP community know that cakePHP is
 powering a site and a utility service at the Barack Obama website. I
 built both of these.

 Here's the site:http://radar.barackobama.com/

 The utility service isn't anything to look at, but let's just say,
 it's provided some much needed plumbing for our infrastructure
 

-- 
-MI
*Coding Ninja* @ CRICAVA Technologies http://www.cricava.com
 
*Blog*: http://www.marianoiglesias.com.ar
*Twitter*:  http://twitter.com/mgiglesias
*LinkedIn*: http://www.linkedin.com/pub/2/483/B94
*Facebook*: http://facebook.com/people/Mariano_Iglesias/646886921


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Politics aside.....

2008-10-28 Thread Gonzalo Servat
On Tue, Oct 28, 2008 at 1:33 PM, Walker Hamilton [EMAIL PROTECTED]wrote:


 I just thought I'd let the cakePHP community know that cakePHP is
 powering a site and a utility service at the Barack Obama website. I
 built both of these.

 Here's the site: http://radar.barackobama.com/

 The utility service isn't anything to look at, but let's just say,
 it's provided some much needed plumbing for our infrastructure.


Very nice! Nice work.

- Gonzalo

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Display Images off document root

2008-10-28 Thread mwcbrent

This issue has been solved when i updated my Cake build.

On Oct 23, 6:13 pm, mwcbrent [EMAIL PROTECTED] wrote:
 I am also experiencing this, it seems to get very partial data like
 there may be a timeout??

 On Aug 28, 4:05 am, Andrewk [EMAIL PROTECTED] wrote:

  Hello,
  I encounter the same problem, when I trying to retrieve images 
  viaMediaview, not all images displayed, for example I have 20 thumbnails
  images on the page an only 8~12 first displayed, and on others
  displayed alt text.
  In my application I am using cakephp Authentication component and when
  I trying to display not loaded  thumbnails images, by pressing web
  browser refresh button I redirected to login page  to perform
  Authentication.
  Moreover number of displayed images on page varies from browser to
  browser ;
  I checked in Opera , Firefox and IE6.

  Anyone have the solution?

  On Aug 3, 10:16 am, gapiangco [EMAIL PROTECTED] wrote:

   Got it to work now! Hurray!

   What I did:
   1. Created a layout for items/view(controller/action) which contains
   nothing but:
   ?php echo $content_for_layout; ?

   2. In my items/viewaction I have:
   functionview($file = null) {
   // check if user/member is logged her
   // ...
   if ($file) {
   $this-layout = 'view_image';
   $this-view= 'Media';
   $params = array(
   'id' = {$file}.jpg,
   'name' = $file,
   'download' = false,
   'extension' = 'jpeg',
   'path' = 'items' . DS
   );
   $this-set($params);
   }
   }

   And yeah it now displays the images. But I did encounter some problem.
   Not all images are displayed. Like out of 18 images per page, 8 of
   them doesn't show up.

   Trying the right-clickproperties on Firefox shows:
   Location:http://localhost/projects/tattoo/items/view/z0g7KSoXbu1217687984
   Width: 100px
   Height: 100px
   Size of file: Unknown (not cached)
   Alternate text: blank

   Anyone can help?

   On Aug 3, 1:52 pm, Dr. Tarique Sani [EMAIL PROTECTED] wrote:

On Sun, Aug 3, 2008 at 10:28 AM, gapiangco [EMAIL PROTECTED] wrote:

 Took a second look and yeah JPEG and JPG are there. My bad. The
 example from the book was intended for downloading. What if from the
 example URL

 mysite.com/designs/view/$slug

 where:
 designs: controller
view: action
 $slug: slug name of the design category

 And from that URL, a list of images available under that specified
 category will be displayed. Something like a gallery of images. How to
 use MediaView on such? Would be nice to have more examples on the
 cookbook :-(

Well - step back for a while or step out, take a deep breath and think!

Do you know how to accomplish the above withoutMediaView? If yes then 
all
you need to do is replace the links to images with the new controller 
call
it say protectedimages and action called show

You will have to do a certain amount of programming in the show action 
which
will ensure that the person currently logged can see unwatermarked 
image or
not

I presume you are missing the trick that the img src will contain a URL 
to a
controller action and some param rather than the URL to the image 
itself.

If you want to create conditional links to image itself then you will 
have
to write your own helper.

HTH

Tarique

--
=
Cheesecake-Photoblog:http://cheesecake-photoblog.org
PHP for E-Biz:http://sanisoft.com
=- Hide 
quoted text -

   - Show quoted text -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: is Cakephp 1.2 faster than Code Igniter ?

2008-10-28 Thread mark_story

On Oct 27, 9:38 pm, teknoid [EMAIL PROTECTED] wrote:
 Here's a test...

 Create a file index.html in the web root of your server with the
 content hello world.
 Now take any framework and compare the speed it takes to render... the
 index.html framework beats them all!


index.html framework is by far the best clearly!  Forget this CakePHP
crap, I'm going all index.html framework from now on.
/sarcasm

I would like to see some development benchmarks as well, that would be
interesting.  How long it takes to build an example non 'hello world'
app in each of these frameworks.  Like teknoid said, servers are cheap
man months are not.  So this benchmark could be more useful for people
choosing frameworks.  With the example teknoid gave, it would take 16
years of CakePHP hosting to equal index.html framework development
time.

-Mark

 On the other hand we can do another test...

 Take CakePHP and develop a fully functional application with 60 models
 (or so) in two months. To double it's performance we purchase a
 dedicated server for $119/month.
 Or we could write one from scratch in about 4 months (if we're lucky),
 which means that we've spend 320 extra hours of development time (40
 hrs per week * 8 extra weeks) at $75/hr.. which translates to extra
 $24,000 spent on the project.

 I'm not really sure, which one of these tests is more pointless ...
 but to me it seems silly to measure a framework's performance with
 hello world.

 On Oct 27, 12:04 pm, wahyu setianto [EMAIL PROTECTED]
 wrote:

  I have read inhttp://www.yiiframework.com/performance, it is true ? i know
  that CI is faster than cakephp because CI is not using OOP actualy

  --
  Octopus
  East Java Baker
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: PHPShop v2 is a cake app!

2008-10-28 Thread Nate

I think it would be possible to write the core of the application as a
plugin, but distribute it inside of an application that provides the
front-end.  This would serve the purpose of (a) appealing to a mass
market by making it a working application out of the box, (b)
providing a plugin for CakePHP developers to integrate into their own
apps, and (c) an example application that demonstrates how to
integrate said plugin, for the benefit of those who wish to do so.

I think a lot of re-distributable CakePHP apps could benefit from
being designed like this.  Anyway, something to think about.

On Oct 23, 9:12 am, Mathew [EMAIL PROTECTED] wrote:
  I have honestly not given that idea much thought.  I mostly approached
  the development as if phpShop were the base application and that it
  would have it's own set of plugins to expand its functionality.  I
  would have to see how a plugin can have plugins...  Or how to have a
  similar ability to extend functionality.  If you have ideas or can
  point me in the right direction, please let me know.

 If you redesign it to be a CakePHP plug-in then your addressing a much
 smaller market, and that isn't healthy for the project.

 What you should do is continue with what your doing, but add a
 phpShopAPI and then develop a CakePHP plugin that uses that
 phpShopAPI.

 Now PHP developers can use your phpShopAPI, and Cake developers can
 use the phpShopAPI plugin. While regular phpShop users can just use
 the standalone application.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Ajax Form Multiple Calls

2008-10-28 Thread jabocs

I am using 1.2RC2 and the FIRST TIME IT WORKS...when I save the data
to the table using Ajax... 2nd time it fails unless I refresh the
page.  So I get one update before I get the following error replaced
into my div:
Not Found

Error: The requested address '/golearns/saveprof' was not found on
this server.



I have a simple form with one textarea:
?=$form-create('Golearn')?
div id=golearn_textarea
?=$form-
input('body',array('label'=false,'div'=false,'error'=false,'type'='textarea','id'='notes_text'))?

/div
div class=golearn_notes_btns
  ?=$ajax-submit(Save Profile,array('url'='/golearns/
saveprof','update'='golearn_textarea','class'='golearn_save_btn'))?
/div
?=$form-end()?


My controller has:
function saveprof() {
if (!empty($this-data)) {
$this-Profile-create();
$this-data['Profile']['user_id'] = 
$this-Auth-user('id');
$this-data['Profile']['type'] = 'notes';
$this-data['Profile']['notes'] = 
$this-data['Golearn']['body'];
if ($this-Profile-save($this-data)) {
$this-render('add_success','ajax');
//exit();
}
}
}


the add_success.ctp is setup to replace the Textarea with a new
Textarea swapping out the text:
?=$form-
input('body',array('label'=false,'div'=false,'error'=false,'type'='textarea','id'='notes_text','value'='Notes
saved to profile.'))?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Troubles Saving hasMany Relationship

2008-10-28 Thread djXternal

Ok I've been searching trying to figure out my problem all day, with
no luck...

I have a table `channels` and a table `users`

Layout of `channels`:
id::int(11) PRIMARY KEY
title::varchar(255)
manager_id::int(11)
owner_id::int(11)

Layout of `users`:
id::int(11) PRIMARY KEY
name::varchar(100)

Name of Relationship (Manager):
`channels`.`manager_id` belongsTo `users`
`users` hasMany `channels`.`manager_id`

Name of Relationship (Owner):
`channels`.`owner_id` belongsTo `users`
`users` hasMany `channels`.`owner_id`

My edit form:
?php
echo $form-input('id');
echo $form-input('title');
echo $form-input('Manager');
echo $form-input('Owner');
?

My edit function in ChannelsController:
function edit($id = null) {
if (!$id  empty($this-data)) {
$this-Session-setFlash(__('Invalid Channel', true));
$this-redirect(array('action'='index'));
}
if (!empty($this-data)) {
if ($this-Channel-save($this-data)) {
$this-Session-setFlash(__('The Channel has been 
saved', true));
$this-redirect(array('action'='index'));
} else {
$this-Session-setFlash(__('The Channel could not be 
saved.
Please, try again.', true));
}
}
if (empty($this-data)) {
$this-data = $this-Channel-read(null, $id);
}
$tags = $this-Channel-Tag-find('list');
$manager = $this-Channel-Manager-find('list');
$owner = $this-Channel-Owner-find('list');
$this-set(compact('tags', 'manager', 'owner'));
}

The id's for manager and owner are being set into $this-data, but
they are not being saved in the database. The resulting entry in the
db is an id of 0 for both fields. Why is this not saving?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Politics aside.....

2008-10-28 Thread teknoid

Very nice.

I imagine that you get some decent traffic there?
Any chance you could share some numbers, experiences and how cake is
holding up?
Maybe a little case study?

On Oct 28, 11:33 am, Walker Hamilton [EMAIL PROTECTED] wrote:
 I just thought I'd let the cakePHP community know that cakePHP is
 powering a site and a utility service at the Barack Obama website. I
 built both of these.

 Here's the site:http://radar.barackobama.com/

 The utility service isn't anything to look at, but let's just say,
 it's provided some much needed plumbing for our infrastructure.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Politics aside.....

2008-10-28 Thread BrendonKoz

I'd be interested in knowing what's powering the site's search
mechanism.  ;)  I'm sure anyone would be interested to know *anything*
about a high profile site.

On Oct 28, 3:44 pm, teknoid [EMAIL PROTECTED] wrote:
 Very nice.

 I imagine that you get some decent traffic there?
 Any chance you could share some numbers, experiences and how cake is
 holding up?
 Maybe a little case study?

 On Oct 28, 11:33 am, Walker Hamilton [EMAIL PROTECTED] wrote:



  I just thought I'd let the cakePHP community know that cakePHP is
  powering a site and a utility service at the Barack Obama website. I
  built both of these.

  Here's the site:http://radar.barackobama.com/

  The utility service isn't anything to look at, but let's just say,
  it's provided some much needed plumbing for our infrastructure.- Hide 
  quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Admin + Members suggested setup??

2008-10-28 Thread Brenton B

Quick question as to what would be the best Cake-y setup:

So I've got a list of Users who can either be Admin, Editors, or
simply Members.
Members can edit their own profiles, but Admin can also edit anyone's
profile (at this point Editors are just normal Members with special
status).

When it comes to admin routing, should that only be used for strictly
Admins and not Members?
Ex:
/profiles/edit - what Members use and there's a check that the
profile matches with the member
/profiles/admin_edit - only Admin uses this.

And how would that all work with ACL? It seems like there's a wee bit
of overlap here.

How have people set this up?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Problem with global search

2008-10-28 Thread galves

Hello, I've been using CakePHP for a short while, and while trying to
implement a global search engine in my blog project using this
documentation and behaviour:

http://bakery.cakephp.org/articles/view/search-feature-to-cakephp-blog-example

...I've come to a problem. Global searches like described here:

http://code.google.com/p/searchable-behaviour-for-cakephp/

...work fine, but for some reason I cannot search for words that are
directly before a newline, even if I remove newlines from the string
before saving it in the search_index table. I'm using tinyMCE for text
formating in my posts and comments.

Thanks in advance for any assistance. :)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Method Naming Convention

2008-10-28 Thread tobi_one

Hi,

this probably is a super easy question to answer, but somehow I'm
stuck.
In the Cookbook it says on

http://book.cakephp.org/view/559/URL-Considerations-for-Controller-Names

However, the convention is that your urls are lowercase and
underscored, therefore /red_apples/go_pick is the correct form to
access the RedApplesController::goPick action

I had my methods named e.g. add_first and - in order to follow
convention - I changed this to addFirst. Now I get the error:

Error: The action add_first is not defined in controller
ExamplesController
Error: Create ExamplesController::add_first() in file: app/controllers/
examples_controller.php.

when trying to access the URL /examples/add_first

Shouldn't cake translate this to addFirst as mentioned above?
What am I missing or are the docs outdated?!

Cheers,
tobi_one

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Method Naming Convention

2008-10-28 Thread teknoid

it's true for the controller name, but not for the action name.

the docs should be updated ... ehh..

On Oct 28, 5:05 pm, tobi_one [EMAIL PROTECTED] wrote:
 Hi,

 this probably is a super easy question to answer, but somehow I'm
 stuck.
 In the Cookbook it says on

 http://book.cakephp.org/view/559/URL-Considerations-for-Controller-Names

 However, the convention is that your urls are lowercase and
 underscored, therefore /red_apples/go_pick is the correct form to
 access the RedApplesController::goPick action

 I had my methods named e.g. add_first and - in order to follow
 convention - I changed this to addFirst. Now I get the error:

 Error: The action add_first is not defined in controller
 ExamplesController
 Error: Create ExamplesController::add_first() in file: app/controllers/
 examples_controller.php.

 when trying to access the URL /examples/add_first

 Shouldn't cake translate this to addFirst as mentioned above?
 What am I missing or are the docs outdated?!

 Cheers,
 tobi_one
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Double Error Message

2008-10-28 Thread thatsgreat2345

Oh wow awesome did not know that thanks!

On Oct 28, 9:51 am, grigri [EMAIL PROTECTED] wrote:
 FormHelper::input() automatically adds the error message unless you
 tell it not too:

 ?php

 echo $form-error('User.pass_confirm'); // No conditional needed,
 won't display anything if there is no error

 echo $form-input('pass_confirm', array(
   'label' = 'Confirm Password',
   'type' = 'password',
   'error' = false
 ));

 ?

 On Oct 28, 4:08 pm, thatsgreat2345 [EMAIL PROTECTED] wrote:

  I've made  a custom validation for a password field real simple

  'pass_confirm' = array(
                                                  'samePass' = array('rule' 
  = array('samePass'),
                                                                              
              'message' = 'Passwords do not match.'
                                                                              
              )
                                                  ),

  function samePass($data) {
                                          if ( 
  $this-data['User']['password'] == $data['pass_confirm'] )
  {
                                                  return true;
                                          } else {
                                                  return false;
                                          }
                                  }

  well whenever the passwords do not match it shows the error message
  twice, once before the input and once after the input, this is all I
  have, they both have the same class error-message so I don't know why
  there is 2.

       if ($form-isFieldError('User.pass_confirm')) { 
  e($form-error('User.pass_confirm', null));} e($form-
  input('pass_confirm',array('label'='Confirm

  Password:','type'='password')) . br /\n);
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Method Naming Convention

2008-10-28 Thread tobi_one

ok, many thanks for pointing this out!

On Oct 28, 10:24 pm, teknoid [EMAIL PROTECTED] wrote:
 it's true for the controller name, but not for the action name.

 the docs should be updated ... ehh..

 On Oct 28, 5:05 pm, tobi_one [EMAIL PROTECTED] wrote:

  Hi,

  this probably is a super easy question to answer, but somehow I'm
  stuck.
  In the Cookbook it says on

 http://book.cakephp.org/view/559/URL-Considerations-for-Controller-Names

  However, the convention is that your urls are lowercase and
  underscored, therefore /red_apples/go_pick is the correct form to
  access the RedApplesController::goPick action

  I had my methods named e.g. add_first and - in order to follow
  convention - I changed this to addFirst. Now I get the error:

  Error: The action add_first is not defined in controller
  ExamplesController
  Error: Create ExamplesController::add_first() in file: app/controllers/
  examples_controller.php.

  when trying to access the URL /examples/add_first

  Shouldn't cake translate this to addFirst as mentioned above?
  What am I missing or are the docs outdated?!

  Cheers,
  tobi_one

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Loading components from actions

2008-10-28 Thread Turnquist, Jonah

I can see your argument but I do not think it applies to me.  You must
realize my current project it simply a dummy project to learn the
CakePHP framework better and to define for myself a set of good
practices and methods for future projects when I might be working for
a client.  Whether I ever run/deploy this project is not a priority to
me.  It is my nature to question everything.  I will not fall into a
habit of using a certain practice unless I am sure it is the most
optimal practice there is for the given type of problem.  I have now
found (or created rather) a more optimal solution for my problem, and
I will use it until I am enlightened by a better one.

On Oct 28, 8:29 am, LunarDraco [EMAIL PROTECTED] wrote:
 Because solving it now, is solving a problem that doesn't yet exist.
 If you can not run/deploy your app then that is the first problem you
 need to resolve.
 And between now and the time you figure out the problem to run/deploy
 your app this startup issue may never be the problem.
 So solving it now is going to delay you getting a functional app.

 On Oct 27, 4:41 pm, Turnquist, Jonah [EMAIL PROTECTED] wrote:

  No, it does not work for components that take use of startup()
  shutdown() or initialize()

  Sure, there will be worse bottlenecks, but why not solve this one now
  instead of later?

  I have created a ComponentLoaderComponent that will do my bidding for
  the meantime.

  I am assuming cake has no built in commands to load components on run-
  time then.  I have created a ticket for this.

  Thanks for your help (*not being sarcastic)

  On Oct 27, 3:10 pm, teknoid [EMAIL PROTECTED] wrote:

   Have you tried to use it? Does it work? Does it do what you need?

   ... as far as best practices go, it's best to build something and then
   worry about optimization.

   I assure you that you'll run into a lot more interesting and demanding
   issues before you get to the point where the bottleneck of your
   application will depend on when/where your Email component is
   instantiated.

   On Oct 27, 5:52 pm, Turnquist, Jonah [EMAIL PROTECTED] wrote:

Erm... yes that will work, kind of, but then initialize(), startup()
and shutdown() will not be called in the component (at least I don't
see how they could... am I wrong?).

I did not do any speed tests, but I would not like components to be
instantiated unless needed (for instance what if the email component
had a very heavy startup() method?  I am trying to develop good
practices).

My code seems more logical this way.  Here is a pseudocode code
example

register action:
--if registration data validates {
save user
load email component
send email to confirm given email address
--}

This way the email component is not loaded until the app is 100% sure
it will even be sure.

...unless maybe cake will handle this potential speed problem for me
in some way I can not imagine? I am in doubt but anyone is free to
inform me.

On Oct 27, 2:35 pm, teknoid [EMAIL PROTECTED] wrote:

 Well, it does... but did you remember to:
 $email = new EmailComponent; ?

 p.s. what speed reasons did you run into?

 On Oct 27, 5:21 pm, Turnquist, Jonah [EMAIL PROTECTED] wrote:

  I've come across a need to load a component via the action for speed
  reasons.

  My case:
  I have a user controller with view(), login(), and register()
  actions.  I need the email component in, and only in, the register()
  action.  So using var $components = array(etc); is not something I
  want to do for speed reasons.  I do not want the component loaded 
  for
  actions that do not use it.

  Looking at the docs it looks like this should work:
  App::import('Component', 'Email');

  But it doesn't. (??)

  So how can this be done?

  Thanks,
  Jonah
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Rendering complete layout from a controller?

2008-10-28 Thread 3lancer.eu

Hi,

As the app grows larger and larger I need a way to get a completely
rendered layout + view in one of my controller's methods. Can you
suggest a way to do that?

I'm working Rc3.

Regards,
Piotr
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Several Custom SQL Pagination 1.2

2008-10-28 Thread Ita

Hello,
I have just implemented pagination successfully but seem to have a
problem with expanding this.
Iĺl explain.

I have a controller that can do several kind of searches.
lets say it has the following functions:
searchByAAA
searchByBBB
searchByCCC
searchByDDD

each search is complicated and has to be done using custom SQL query.
Now when I implement pagination I need to pass this SQL to the
paginator which I undestand cannot be done.
I know I can override the model paginate and paginateCount functions
but this will only help me in one case.
How do I know which SQL to run?
Can I pass some kind of parameter to the paginate function so Iĺl know
from where I´m coming?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Saving extra fields in the join table (for HABTM models)

2008-10-28 Thread nomex

Hey guys, sorry to bother you again, but i'm spending hours on this
problem and can't find the solution:

teknoid has this nice blog, where he describes his metode so save some
extra data to the HABTM table by binding them as hasMany.

http://teknoid.wordpress.com/2008/09/24/saving-extra-fields-in-the-join-table-for-habtm-models/


i have 3 tables:
users, Companies and CompaniesUser

my code looks like this:

$this-data['CompaniesUser'][0]['company_id'] = '99';
$this-data['CompaniesUser'][0]['status'] = 'disabled';


$this-User-bindModel(array('hasMany'=array('CompaniesUser')));
$this-User-saveAll($this-data)

it saved the user correctly and it saves the company_id and the status
in the companiesUser table, but it didn't insert the user_id from the
new created user. any idea what i'm doing wrong?

thx for your 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Controller function parameter is lost

2008-10-28 Thread R. Davila

Hi,

Sorry, but it didn't work.

This is what i did (following your example):
 ?php echo $form-create('User', array('url' = array('action' = 
'changePassword', $form-value('User.id'; ?

And this was the generated html:
 form id=UserEditForm method=post 
action=/users/changePassword/3/3fieldset style=display:none;input 
type=hidden name=_method value=PUT /


Actually I had already tried something similar (hardcoding the parameter) and 
had seen that generated form tag (functionName/id/id).

The Form Helper is actually creating the form tag correctly. The problem is 
when submitting the generated form.

If I simply code echo $form-create('User', array('action' = 
'changePassword')); the Form Helper correctly generates the form tag (adding 
the parameter at the end).

The problem is when submitting the generated form.




Dardo Sordi Bogado wrote:
 Try
 
  ?php echo $form-create('User', array('url' = array('action'  =
 'changePassword', 3))); ?
 
 I'm sure you'll be able to make it works for others ids than 3 ;)
 
 HTH,
 - Dardo Sordi.
 
 On Tue, Oct 28, 2008 at 12:30 AM, R. Davila [EMAIL PROTECTED] wrote:
 Hi,

 I have a controller function, and the corresponding view, setup like this:

 function changePassword($id = null)

 change_password.ctp

  ?php echo $form-create('User', array('action' = 'changePassword')); ?
  ?php echo $form-hidden('password'); ?
  .
  . Here I add the fields for old password, new password and retype new 
 password
  .
  ?php echo $form-end('Submit'); ?

 The following is the generated html (the parameter to the changePassword 
 function is the user id, in this case 3):

  form id=UserChangePasswordForm method=post 
 action=/users/changePassword/3
  fieldset style=display:none;input type=hidden name=_method 
 value=POST //fieldset
  input type=hidden name=data[User][password] value=encrypted password 
 value id=UserPassword /

 So far so good.

 The problem is that when I fill the form fields and click the Submit button,
  the data is being posted to /users/changePassword instead of 
 /users/changePassword/3

 I'm writing $this-params to the FirePHP console at the top of the 
 changePassword function and this is what I get:

 When I access the page initially:

 Array
 (
  [pass] = Array
   (
[0] = 3
   )
  [named] = Array
(
)
  [controller] = users
  [action] = changePassword
  [plugin] =
  [form] = Array
   (
   )
  [url] = Array
  (
   [url] = users/changePassword/3
  )
 )

 After I click on Submit:

 Array
 (
  [pass] = Array
   (
   )
  [named] = Array
(
)
  [controller] = users
  [action] = changePassword
  [plugin] =
  [form] = Array
   (
   )
  [url] = Array
  (
   [url] = users/changePassword
  )
 )

 As you can see the user id parameter is lost.

 Any ideas?

 Thanks in advance.


 
  
 
 
 
 
 No virus found in this incoming message.
 Checked by AVG - http://www.avg.com 
 Version: 8.0.175 / Virus Database: 270.8.4/1752 - Release Date: 10/28/2008 
 10:04 AM
 

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Forum instead of Mailing List?

2008-10-28 Thread 703designs

Just an idea. I think that the Bakery's in a good position right now
(as the heart of the Cake community), and that the CakePHP knowledge
base and its usability would improve if discussions took place in a
regular web forum rather than on a mailing list. Thoughts?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Controller function parameter is lost

2008-10-28 Thread 703designs

You're using a POST method for your form, so you can retrieve the data
from $this-data on the controller side. Why would you want POST data
in a URL? That's what GET requests are for.

Thomas

On Oct 28, 6:43 pm, R. Davila [EMAIL PROTECTED] wrote:
 Hi,

 Sorry, but it didn't work.

 This is what i did (following your example):
  ?php echo $form-create('User', array('url' = array('action' = 
 'changePassword', $form-value('User.id'; ?

 And this was the generated html:
  form id=UserEditForm method=post 
 action=/users/changePassword/3/3fieldset style=display:none;input 
 type=hidden name=_method value=PUT /

 Actually I had already tried something similar (hardcoding the parameter) and 
 had seen that generated form tag (functionName/id/id).

 The Form Helper is actually creating the form tag correctly. The problem is 
 when submitting the generated form.

 If I simply code echo $form-create('User', array('action' = 
 'changePassword')); the Form Helper correctly generates the form tag 
 (adding the parameter at the end).

 The problem is when submitting the generated form.

 Dardo Sordi Bogado wrote:
  Try

   ?php echo $form-create('User', array('url' = array('action'  =
  'changePassword', 3))); ?

  I'm sure you'll be able to make it works for others ids than 3 ;)

  HTH,
  - Dardo Sordi.

  On Tue, Oct 28, 2008 at 12:30 AM, R. Davila [EMAIL PROTECTED] wrote:
  Hi,

  I have a controller function, and the corresponding view, setup like this:

  function changePassword($id = null)

  change_password.ctp

   ?php echo $form-create('User', array('action' = 'changePassword')); ?
   ?php echo $form-hidden('password'); ?
   .
   . Here I add the fields for old password, new password and retype new 
  password
   .
   ?php echo $form-end('Submit'); ?

  The following is the generated html (the parameter to the changePassword 
  function is the user id, in this case 3):

   form id=UserChangePasswordForm method=post 
  action=/users/changePassword/3
   fieldset style=display:none;input type=hidden name=_method 
  value=POST //fieldset
   input type=hidden name=data[User][password] value=encrypted 
  password value id=UserPassword /

  So far so good.

  The problem is that when I fill the form fields and click the Submit 
  button,
   the data is being posted to /users/changePassword instead of 
  /users/changePassword/3

  I'm writing $this-params to the FirePHP console at the top of the 
  changePassword function and this is what I get:

  When I access the page initially:

  Array
  (
   [pass] = Array
            (
             [0] = 3
            )
   [named] = Array
             (
             )
   [controller] = users
   [action] = changePassword
   [plugin] =
   [form] = Array
            (
            )
   [url] = Array
           (
            [url] = users/changePassword/3
           )
  )

  After I click on Submit:

  Array
  (
   [pass] = Array
            (
            )
   [named] = Array
             (
             )
   [controller] = users
   [action] = changePassword
   [plugin] =
   [form] = Array
            (
            )
   [url] = Array
           (
            [url] = users/changePassword
           )
  )

  As you can see the user id parameter is lost.

  Any ideas?

  Thanks in advance.

  

  No virus found in this incoming message.
  Checked by AVG -http://www.avg.com
  Version: 8.0.175 / Virus Database: 270.8.4/1752 - Release Date: 10/28/2008 
  10:04 AM
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Several Custom SQL Pagination 1.2

2008-10-28 Thread Ita

Now that I think about it maybe its not that difficult.
The paginate function has a scope parameter which can be used to pass
sql condition.
I could try and pass some kind of hint in this array about the search
I want to preform.
h.
Should work.

Too late to check it now but will do it tomorrow and write about it
afterwards.


On Oct 29, 12:34 am, Ita [EMAIL PROTECTED] wrote:
 Hello,
 I have just implemented pagination successfully but seem to have a
 problem with expanding this.
 Iĺl explain.

 I have a controller that can do several kind of searches.
 lets say it has the following functions:
 searchByAAA
 searchByBBB
 searchByCCC
 searchByDDD

 each search is complicated and has to be done using custom SQL query.
 Now when I implement pagination I need to pass this SQL to the
 paginator which I undestand cannot be done.
 I know I can override the model paginate and paginateCount functions
 but this will only help me in one case.
 How do I know which SQL to run?
 Can I pass some kind of parameter to the paginate function so Iĺl know
 from where I´m coming?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: phpvideotutorials.com

2008-10-28 Thread tobi_one

I got the email with the download _immediately_ after paypal payment!
You should contact leighmac...

Cheers,
tobi_one

On Oct 28, 4:11 pm, gemmes [EMAIL PROTECTED] wrote:
 Hi all,

 I bought the cakephp video tutorials this morning, I still have not
 received a digital download or a confirmation email after paying
 through Paypal (received confirmation from paypal).

 has anyone else bought the 'paid tutorials' from
 phpvideotutorials.com? What happens next? Should I have received the
 digital download already?

 Note: I know phpvideotutorials.com has its own forum but Im waiting
 for activation, and im still waiting for a email response from them
 too.

 thanks

 gemmes

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cakephp Paginate with associated tables

2008-10-28 Thread rainmore

Hi ,

I realize there is no one working on this google group.

Finally, I found the solution by myself.  That is to use container,
which can be found by http://book.cakephp.org/view/474/Containable.

Also, in order to get the exactly result, I'd like to add more
reference key or (foreign key).

In my case, I change the hasMany relationship to belongsTo. Then, use
unbindModel and bindModel to bind the relationship as I want.

HTH

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Forum instead of Mailing List?

2008-10-28 Thread villas

I think this google group is excellent due mainly to the power of
google searching.
Not sure about the Bakery being the 'heart' at present,  but the forum
suggestion does seem popular judging by the number of posts on:
http://www.cakephpforum.net/

On Oct 28, 10:45 pm, 703designs [EMAIL PROTECTED] wrote:
 Just an idea. I think that the Bakery's in a good position right now
 (as the heart of the Cake community), and that the CakePHP knowledge
 base and its usability would improve if discussions took place in a
 regular web forum rather than on a mailing list. Thoughts?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



$uses kills associations in cakephp 1.2

2008-10-28 Thread AussieFreelancer

Hi all, I have been struggling to find the root of a problem i am
having, and i think i have just found it. It appears that when i use
the $uses variable in my controller, the tables are no longer
associated...

As an example,

League belongsTo User
$this-League-read(null, $id)
returns:
Array([League] = array(), [User] = array())

However, when I put var $uses = array('League', 'Setting'); at the top
of the controller, because I also want to be able to access Settings,
which are not related to the League, the above read returns the
following:
Array([League] = array())

Should this be happening? Or am I just doing something wrong?

Thanks

Patrick
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Forum instead of Mailing List?

2008-10-28 Thread Gonzalo Servat
On Tue, Oct 28, 2008 at 8:45 PM, 703designs [EMAIL PROTECTED] wrote:


 Just an idea. I think that the Bakery's in a good position right now
 (as the heart of the Cake community), and that the CakePHP knowledge
 base and its usability would improve if discussions took place in a
 regular web forum rather than on a mailing list. Thoughts?


This subject must come up at least half a dozen times on a few of the
mailing lists I'm on. There are many arguments against the idea and few in
favor. Anyway, the best balance between the two is using the mailing list as
we do now and if you really like the forum idea, you can use the forum-like
interface Nabble:

http://www.nabble.com/CakePHP-f16511.html

- Gonzalo

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Controller function parameter is lost

2008-10-28 Thread R. Davila

Hi Thomas,

The POST method is generated by $form-create()

The GET method will put the variables in the URL (visible to the user), so 
that's not an option.

$form-create() works for the add() and edit() scaffolded functions without 
problems.

The problem is not the generated HTML, but when submitting the generated form.
The changePassword function is not receiving the parameter.



703designs wrote:
 You're using a POST method for your form, so you can retrieve the data
 from $this-data on the controller side. Why would you want POST data
 in a URL? That's what GET requests are for.
 
 Thomas
 
 On Oct 28, 6:43 pm, R. Davila [EMAIL PROTECTED] wrote:
 Hi,

 Sorry, but it didn't work.

 This is what i did (following your example):
  ?php echo $form-create('User', array('url' = array('action' = 
 'changePassword', $form-value('User.id'; ?

 And this was the generated html:
  form id=UserEditForm method=post 
 action=/users/changePassword/3/3fieldset style=display:none;input 
 type=hidden name=_method value=PUT /

 Actually I had already tried something similar (hardcoding the parameter) 
 and had seen that generated form tag (functionName/id/id).

 The Form Helper is actually creating the form tag correctly. The problem 
 is when submitting the generated form.

 If I simply code echo $form-create('User', array('action' = 
 'changePassword')); the Form Helper correctly generates the form tag 
 (adding the parameter at the end).

 The problem is when submitting the generated form.

 Dardo Sordi Bogado wrote:
 Try
  ?php echo $form-create('User', array('url' = array('action'  =
 'changePassword', 3))); ?
 I'm sure you'll be able to make it works for others ids than 3 ;)
 HTH,
 - Dardo Sordi.
 On Tue, Oct 28, 2008 at 12:30 AM, R. Davila [EMAIL PROTECTED] wrote:
 Hi,
 I have a controller function, and the corresponding view, setup like this:
 function changePassword($id = null)
 change_password.ctp
  ?php echo $form-create('User', array('action' = 'changePassword')); ?
  ?php echo $form-hidden('password'); ?
  .
  . Here I add the fields for old password, new password and retype new 
 password
  .
  ?php echo $form-end('Submit'); ?
 The following is the generated html (the parameter to the changePassword 
 function is the user id, in this case 3):
  form id=UserChangePasswordForm method=post 
 action=/users/changePassword/3
  fieldset style=display:none;input type=hidden name=_method 
 value=POST //fieldset
  input type=hidden name=data[User][password] value=encrypted 
 password value id=UserPassword /
 So far so good.
 The problem is that when I fill the form fields and click the Submit 
 button,
  the data is being posted to /users/changePassword instead of 
 /users/changePassword/3
 I'm writing $this-params to the FirePHP console at the top of the 
 changePassword function and this is what I get:
 When I access the page initially:
 Array
 (
  [pass] = Array
   (
[0] = 3
   )
  [named] = Array
(
)
  [controller] = users
  [action] = changePassword
  [plugin] =
  [form] = Array
   (
   )
  [url] = Array
  (
   [url] = users/changePassword/3
  )
 )
 After I click on Submit:
 Array
 (
  [pass] = Array
   (
   )
  [named] = Array
(
)
  [controller] = users
  [action] = changePassword
  [plugin] =
  [form] = Array
   (
   )
  [url] = Array
  (
   [url] = users/changePassword
  )
 )
 As you can see the user id parameter is lost.
 Any ideas?
 Thanks in advance.
 
 No virus found in this incoming message.
 Checked by AVG -http://www.avg.com
 Version: 8.0.175 / Virus Database: 270.8.4/1752 - Release Date: 10/28/2008 
 10:04 AM
  
 
 
 
 
 No virus found in this incoming message.
 Checked by AVG - http://www.avg.com 
 Version: 8.0.175 / Virus Database: 270.8.4/1752 - Release Date: 10/28/2008 
 10:04 AM
 

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



More L10n for InputHelper Date

2008-10-28 Thread David Christopher Zentgraf

Hi,

Is there an elegant way to completely l6e (localize) the InputHelper's  
Date widget? I know about being able to translate month names via .po  
files. But I want to built a date input in Japanese, and the 100%  
correct way would be like this:
2008年10月29日, i.e. inserting 年, 月 and 日 either between the  
drop-down fields or include them in the values.

Is there a simple way to do this without doing every field individually?
My users could survive with just number dropdowns, but it'd be nice to  
do it correctly.

Chrs,
Dav
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---