Re: $useTable ignored when using bindModel()?

2009-05-12 Thread deefens

nobody familar with this? *hope*


On 9 Mai, 09:16, deefens steff.muel...@gmail.com wrote:
 Hi guys,

 this is driving me nuts: when i use bindModel() to add a relationship
 on the fly to an certain model, it seems that cake ignores the table
 name specified in the attached model in var $useTable.

 Example:

 class ActivitiesHostess extends AppModel {

    var $name = 'ActivitiesHostess';
    var $useTable = 'v_activities_hostess';

    var $belongsTo = array('Activity', 'Hostess');

 }

 this is my added relationship class, providing one girl per activity
 (don't mess, thats a harmless website smile.gif. so i attach this on
 the fly in the hostess controller:

 $url['activity']?$this-Hostess-bindModel(array('hasOne'=array
 ('ActivitiesHostess' = array())), false):'';

 but then, after clearing the cache and reload the website cake says:

  Error:  Database table activities_hostesses for model ActivitiesHostess 
  was not found.

 but in the model i specified the table name as v_activities_hostess
 (it's a view). has anyone any explanation for this or a workaround to
 avoid cake aborting here? googled half the world, but didn't have any
 success...

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



Re: Poll: what do you hate about CakePHP?

2009-05-12 Thread Pierre MARTIN

Thanks (again) nate for this opening to the community !

My 2 cents :
- CakePHP (Several good things have already been said so I kept the
most important to me)
+ No namespaces : CakePHP 2.0 must be PHP5.3+
+ Better plugin management : dependencies management, versions, some
API changes (HTMLHelper ...) to make it easier to use in plugins
+ Bake might permit to choose the application language
+ A CoffeeBehavior ... because it's a shame to not have a good coffee
to go with a beautiful Cake :o)

- Community
+ More tolerance towards ticket openers : I saw many people totally
hate you guys because their tickets go won't fix because a test was
missing ... everyone can't spend 2 hours on a ticket, it has to be
understood otherwise no more feedbacks !
+ Missing a Uber-Bakery containing official plugins, behaviors ...
with their SCM. The place where one can find the right code when he
needs it. Note: it does not means that a messy bakery is not useful,
but in my opinion the community needs a place to find the best plugins
and behaviors to contribute instead of reinventing the wheel.
+ Less tools but more homogeneity : tools are not clear enough for
newcomers (or not so good english speakers). Between thechaw, bakery,
cake, cakeforge, IRC, Google group, CakePlanet (blogs), Ohloh, twitter
(etc.) it's hard to follow everything without missing important
announcements.
+ (Last but not least ^^) Include local communities for communication
purposes. As one of the french community leader, I cannot read all the
google groups messages or announcement or other discussions because we
have our own forum with people to help, discussions, tutorials to
maintain and several other things. However, it would be great if this
kind of discussion was broadcasted through local communities along
with announcements. PROPOSAL = send an email to each community
contact (e.g cakephp-translators mailing-list) when an important
announcement is made so we can transmit it to our communities.
... and my multi-language Cake with built-in translations !

Thanks again for this interesting discussion, I hope a summary of all
these points will be communicated elsewhere.
I love CakePHP and its developers, thank you for everything which has
been done ...

Pierre (aka real34)

On 12 mai, 22:18, yodi y...@yodi.web.id wrote:
 1. PHP 4 Support *let's make CakePHP more fast with full PHP 5
 2. Prototype and Scriptlous * it's better using Jquery
 3. No CounterCache HABTM
 4. Complex and heavy ACL * it's works to me but very hard for newbie
 5. Still not effective form helper html

 imagine how long code using form helper for link of image like this :
 lt;a href=gt;imglt;/agt;

 On Thu, 2009-05-07 at 15:29 -0700, Nate wrote:
  Well, maybe hate's a strong word.  Let's say, what do you like the
  least?  Kind of an odd question, I know, but since we've kick-started
  development of a new version, I'd like to know what the most
  frustrating things with the framework are, even if they're things we
  can't fix right away.

  I'll get us started: PHP 4 support.

  Who's next? TIA for the input.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



HABTM relation with custom named table

2009-05-12 Thread MPeg

Hi to all bakers!

I'm diving into Cake1.2 relations while building a demo ACL
application (Just to learn about...)

I'm creating a custom plugin to solve this issue so my tables have a
custom name just to mantain order into db:

Model Yuser - Table freyr_users
Model Ypermission - Table freyr_permissions

I built a join_table like:

Table name: freyr_objects_permissions
object_id | bigint (16)
permission_id | bigint (16)

I have set up my Yuser - YPermission HABTM relation this way:

var $hasAndBelongsToMany = array(
'Ypermission' = array(
'className' = 'Ypermission',
'joinTable' = 
'freyr_objects_permissions',
'foreignKey'= 'object_id',
'associationForeignKey' = 'permission_id',
),
);

This relation causes a missing table error because Ypermission
model try to use a table named ypermissions (just using naming
conventions)... It seems to ignore the useTable directive set into
model.

I have temporary solved this problem just renaming
freyr_ypermissions into ypermissions but I want to use custom
table names to maintain order in my db!

Tables grows up every day
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: I eliminated the default pages routing and now my controllers won't load

2009-05-12 Thread Dr. Loboto

This is complete example. Value from :controller will be used by
Cake as controller name and value from :action as action name.

On May 11, 7:44 pm, Bankai hgnelso...@gmail.com wrote:
 Loboto, and how do I indicate action in the URL?

 For example, I have a controller named Contact.

 Router::connect('/:controller/:action/*');

 Am I suppose to replace the above line to my Contact controller?

 On 12 mayo, 04:01, Dr. Loboto drlob...@gmail.com wrote:

  You can try this routes set:

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

  Controllers index actions won't work still, you always need to
  indicate action in URL.

  On May 11, 12:21 am, Bankai hgnelso...@gmail.com wrote:

   I wanted my URLs to look like:www.website.com/some_content

   Instead of the cakephp default:www.website.com/pages/some_content

   So I edited the router.php to this

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

   But now my controllers are not loading. It's asking for views instead.
   Also, when I type:

   ?php e($html-link('Somelink', 'somelink')); ?
   It still puts /pages in the url. How do I get rid of 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $useTable ignored when using bindModel()?

2009-05-12 Thread John Andersen

If I understand what I read from the source, then your code should be:

... bindModel( array( 'hasOne' = array('ActivitiesHostess' = array
('ActivitiesHostess') ) ), false )'

Thus your models name should be used as the name for the model that
CakePHP thinks it has to use (inflected etc)!
Enjoy,
   John

On May 12, 9:07 am, deefens steff.muel...@gmail.com wrote:
 nobody familar with this? *hope*

 On 9 Mai, 09:16, deefens steff.muel...@gmail.com wrote:

  Hi guys,

  this is driving me nuts: when i use bindModel() to add a relationship
  on the fly to an certain model, it seems that cake ignores the table
  name specified in the attached model in var $useTable.

  Example:

  class ActivitiesHostess extends AppModel {

     var $name = 'ActivitiesHostess';
     var $useTable = 'v_activities_hostess';

     var $belongsTo = array('Activity', 'Hostess');

  }

  this is my added relationship class, providing one girl per activity
  (don't mess, thats a harmless website smile.gif. so i attach this on
  the fly in the hostess controller:

  $url['activity']?$this-Hostess-bindModel(array('hasOne'=array
  ('ActivitiesHostess' = array())), false):'';

  but then, after clearing the cache and reload the website cake says:

   Error:  Database table activities_hostesses for model ActivitiesHostess 
   was not found.

  but in the model i specified the table name as v_activities_hostess
  (it's a view). has anyone any explanation for this or a workaround to
  avoid cake aborting here? googled half the world, but didn't have any
  success...

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



Re: Question about how manage particular data in session

2009-05-12 Thread Miles J

Well first off you would need to have Security.level medium for ajax
to work. Secondly, you could just store all the service_ids in an
array instead of 1 at a time.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Poll: what do you hate about CakePHP?

2009-05-12 Thread nastya

I wish a better Translate behavior! The recent one is really not
great. To get all the translations for all the languages is a
nightmare. The idea of 
http://www.palivoda.eu/2008/04/i18n-in-cakephp-12-database-content-translation-part-2/
is much better though there are some bugs in the proposed solution.
Would be great to have it in Cake core.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



imap_open causes Debugger Error

2009-05-12 Thread Brad V. aka iBspoof

When trying to use imap_open() command with CakePHP either r8120 or
r8166 when debug is set to 1 or 2 I get the following error:

Fatal error: Class 'Debugger' not found in ../cake/libs/debugger.php
on line 169
#   TimeMemory  FunctionLocation
1   0.1322  1828636 Debugger-handleError( )../debugger.php:0

The same issue happens if I suppress errors on imap_open ala @imap_open
().  Anyone have any suggestions?

I checked Trac and found and old bug (https://trac.cakephp.org/ticket/
3057) that was updated 2 years ago, but nothing mentioning a specific
conflict with imap_open().

Best,
Brad

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



Re: Question about how manage particular data in session

2009-05-12 Thread byqsri

Ok
But how can I know which service is active in a particular moment?

On 12 Mag, 10:04, Miles J mileswjohn...@gmail.com wrote:
 Well first off you would need to have Security.level medium for ajax
 to work. Secondly, you could just store all the service_ids in an
 array instead of 1 at a time.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Login form on index page

2009-05-12 Thread dnoop

Hi sorry for making my question so obscure  I had a home.ctp which
should contain a login form ...  Right now i just redirected the index
to login ... is it posssible by making login.ctp as a element and
including it in home.ctp ...?

On May 9, 7:47 pm, brian bally.z...@gmail.com wrote:
 What are you trying to do? Include the form as an element? Redirect to
 the login form?

 On Sat, May 9, 2009 at 1:04 AM, dnoop dan...@gmail.com wrote:

  Hi,
           I am a newbie here and i was doing one user profile
  system .. seems almost everything is working fine .. in my  but when i
  went to apply it to my design i just need a login form only  ...no
  need of the original index page which shows list of users .. what
  should i do  ..?

   $this-redirect(array('controller' = 'users', 'action' = 'login'));

  is this the correct way to do it ...?
  I just wanted to include login form along with registration form
  too ... should i put login as an element ..? Please help

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



Re: Modifying html after all loading completes

2009-05-12 Thread Bert Van den Brande

Maybe you could add a 'click' event on the advertising links using
Jquery's $(document).ready ?



On Tue, May 12, 2009 at 10:52 AM, ccm...@gmail.com ccm...@gmail.com wrote:

 Hey guys, is there any way to modify the html content loaded by
 cakephp after it finishes loading?

 Basically, what I want to do is to track the clicks in google adwords
 and save it to my database. However, I can't think of any other ways
 other than mannually modify the link so that it will redirect to my
 page first before it goes out to the external page.

 If you can think of any other ways,  please feel free to suggest .
 (btw, I know about google analystics, it can be used to track it. But
 I need to manually to export it and save it.it's just too much
 work)

 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Login form on index page

2009-05-12 Thread Richard
That's a reasonable approach to take; yes.

On Tue, May 12, 2009 at 10:40 AM, dnoop dan...@gmail.com wrote:


 Hi sorry for making my question so obscure  I had a home.ctp which
 should contain a login form ...  Right now i just redirected the index
 to login ... is it posssible by making login.ctp as a element and
 including it in home.ctp ...?

 On May 9, 7:47 pm, brian bally.z...@gmail.com wrote:
  What are you trying to do? Include the form as an element? Redirect to
  the login form?
 
  On Sat, May 9, 2009 at 1:04 AM, dnoop dan...@gmail.com wrote:
 
   Hi,
I am a newbie here and i was doing one user profile
   system .. seems almost everything is working fine .. in my  but when i
   went to apply it to my design i just need a login form only  ...no
   need of the original index page which shows list of users .. what
   should i do  ..?
 
$this-redirect(array('controller' = 'users', 'action' = 'login'));
 
   is this the correct way to do it ...?
   I just wanted to include login form along with registration form
   too ... should i put login as an element ..? Please help
 
   with regards
  Anoop
 


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



Re: really really lost

2009-05-12 Thread rich...@home

It sounds like they have a dev version of the site tucked away in the
webroot.

Live site - http://www.example.com/

Dev site - http://www.example/com/dev/

On May 12, 2:56 am, Braydenstyles brayden.sty...@gmail.com wrote:
 my previous devs had a working website live for us but now the devs
 are gone and i've been trying to get this site up

 they way they have it weird though.. and i'm just trying to get it to
 run on a single server

 so maybe someone can help

 they have in my /html

 app/ dir

 which has the app contollers config models etc...

 the aslo have in /html

 core/ dir

 which is the cake stuff

 but in the app/webroot/ dir they have dev/ dir folder which has app/
 dir in as well as another cor/ dir

 now i know we had a live server  and the dev server was off site, so
 i'm confused??
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Change FormHelper (and HtmlHelper) default settings

2009-05-12 Thread AD7six



On May 12, 12:02 pm, Ernesto e.fanz...@gmail.com wrote:
 Hi Miles

 i really appreciated your help.

 i ended up hard-coding all the settings. Near every hard-coded setting
 i wrote a comment like this
 /* [MODIFYWHENCAKELWILLSUPPORTHELPEREXTENSIONS] */

 so i'll easily modify the code in future :)

There's a better way, or in reality several ways, to achieve the same
thing without editing the core.

e.g. http://cakebaker.42dh.com/2008/11/07/an-idea-for-hacking-core-helpers/

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



Re: Poll: what do you hate about CakePHP?

2009-05-12 Thread Ernesto

Some add:

- can't overload core helpers

On 8 Mag, 00:29, Nate nate.ab...@gmail.com wrote:
 Well, maybe hate's a strong word.  Let's say, what do you like the
 least?  Kind of an odd question, I know, but since we've kick-started
 development of a new version, I'd like to know what the most
 frustrating things with the framework are, even if they're things we
 can't fix right away.

 I'll get us started: PHP 4 support.

 Who's next? TIA for the input.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Change FormHelper (and HtmlHelper) default settings

2009-05-12 Thread Teh Treag

Ernesto,

I'm not sure what you are trying to do exactly.  But I am curious
about feedback on this method; I have used to override the default
behavior of the formHelper in the past.  I know there are other ways
to provide the functionality that's in this example.

I would provide my own class, myFormHelper in this example.

?php
App::import('Helper','Form');
class MyFormHelper extends FormHelper {
  public $default_options=array('label'=false,'div'=false));
  public function input($fieldname,$options=array()){
return parent::input($fieldname,am($options,$this-
default_options));
  }
?

Now, there are two ways I use classes like this.  When I'm working on
a new project, I just add 'MyForm' to the helpers list in my
controllers, and use $myForm-input() in my views.  For an existing
project, I take a different route.  For an existing project, I don't
want to go through all the views and update them to use the new
helper, so I make mine available with the old name.

?php // Some controller
public $helpers=array('Html','MyForm');
public function beforeRender(){
  $this-Form = $this-MyForm;
}
?

Ernesto, would this fit your goals?

-teh

On May 11, 3:26 am, Ernesto e.fanz...@gmail.com wrote:
 Hello.

 is there any way to change FormHelper and HtmlHelper default settings??
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Duplicate Queries Problem with Containable

2009-05-12 Thread Jérémie

Hi,

I've got the same problem
Hope someone can help

Thanks !
Jérémie

On 11 mai, 18:50, Astro astr...@gmail.com wrote:
 I have a problem whith Cake PHP generating duplicate mysql queries
 when using 'contain' with find().

 In the controller:

                 $data   =       $this-Client-find('first',aa(
                         'conditions',aa(
                                 'Client.id',$id
                         ),
                         'contain',array(
                                 'Country',
                                 'Sale'=array('User','Product','ProductGroup')
                         )
                 ));

 It fetches all data I want, but generates the same queries again if
 for instance different Sales have the same ProductGroup. Here is what
 the mysql debug says:

 37      SELECT `ProductGroup`.`id`, `ProductGroup`.`name`,
 `ProductGroup`.`description`, `ProductGroup`.`price_per_month`,
 `ProductGroup`.`price_one_time`, `ProductGroup`.`period`,
 `ProductGroup`.`created`, `ProductGroup`.`modified` FROM
 `product_groups` AS `ProductGroup` WHERE `ProductGroup`.`id` = 6
 38      SELECT `ProductGroup`.`id`, `ProductGroup`.`name`,
 `ProductGroup`.`description`, `ProductGroup`.`price_per_month`,
 `ProductGroup`.`price_one_time`, `ProductGroup`.`period`,
 `ProductGroup`.`created`, `ProductGroup`.`modified` FROM
 `product_groups` AS `ProductGroup` WHERE `ProductGroup`.`id` = 6
 39      SELECT `ProductGroup`.`id`, `ProductGroup`.`name`,
 `ProductGroup`.`description`, `ProductGroup`.`price_per_month`,
 `ProductGroup`.`price_one_time`, `ProductGroup`.`period`,
 `ProductGroup`.`created`, `ProductGroup`.`modified` FROM
 `product_groups` AS `ProductGroup` WHERE `ProductGroup`.`id` = 6
 40      SELECT `ProductGroup`.`id`, `ProductGroup`.`name`,
 `ProductGroup`.`description`, `ProductGroup`.`price_per_month`,
 `ProductGroup`.`price_one_time`, `ProductGroup`.`period`,
 `ProductGroup`.`created`, `ProductGroup`.`modified` FROM
 `product_groups` AS `ProductGroup` WHERE `ProductGroup`.`id` = 6

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



Re: Duplicate Queries Problem with Containable

2009-05-12 Thread Jérémie

Hi,

I've got the same problem
Hope someone can help

Thanks !
Jérémie

On 11 mai, 18:50, Astro astr...@gmail.com wrote:
 I have a problem whith Cake PHP generating duplicate mysql queries
 when using 'contain' with find().

 In the controller:

                 $data   =       $this-Client-find('first',aa(
                         'conditions',aa(
                                 'Client.id',$id
                         ),
                         'contain',array(
                                 'Country',
                                 'Sale'=array('User','Product','ProductGroup')
                         )
                 ));

 It fetches all data I want, but generates the same queries again if
 for instance different Sales have the same ProductGroup. Here is what
 the mysql debug says:

 37      SELECT `ProductGroup`.`id`, `ProductGroup`.`name`,
 `ProductGroup`.`description`, `ProductGroup`.`price_per_month`,
 `ProductGroup`.`price_one_time`, `ProductGroup`.`period`,
 `ProductGroup`.`created`, `ProductGroup`.`modified` FROM
 `product_groups` AS `ProductGroup` WHERE `ProductGroup`.`id` = 6
 38      SELECT `ProductGroup`.`id`, `ProductGroup`.`name`,
 `ProductGroup`.`description`, `ProductGroup`.`price_per_month`,
 `ProductGroup`.`price_one_time`, `ProductGroup`.`period`,
 `ProductGroup`.`created`, `ProductGroup`.`modified` FROM
 `product_groups` AS `ProductGroup` WHERE `ProductGroup`.`id` = 6
 39      SELECT `ProductGroup`.`id`, `ProductGroup`.`name`,
 `ProductGroup`.`description`, `ProductGroup`.`price_per_month`,
 `ProductGroup`.`price_one_time`, `ProductGroup`.`period`,
 `ProductGroup`.`created`, `ProductGroup`.`modified` FROM
 `product_groups` AS `ProductGroup` WHERE `ProductGroup`.`id` = 6
 40      SELECT `ProductGroup`.`id`, `ProductGroup`.`name`,
 `ProductGroup`.`description`, `ProductGroup`.`price_per_month`,
 `ProductGroup`.`price_one_time`, `ProductGroup`.`period`,
 `ProductGroup`.`created`, `ProductGroup`.`modified` FROM
 `product_groups` AS `ProductGroup` WHERE `ProductGroup`.`id` = 6

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



Re: Duplicate Queries Problem with Containable

2009-05-12 Thread Jérémie

Actually, seems it's a known bug and that we have to wait for Cake
2.0 :(
https://trac.cakephp.org/ticket/5336


On 12 mai, 15:16, Jérémie jeremie.c...@gmail.com wrote:
 Hi,

 I've got the same problem
 Hope someone can help

 Thanks !
 Jérémie

 On 11 mai, 18:50, Astro astr...@gmail.com wrote:

  I have a problem whith Cake PHP generating duplicate mysql queries
  when using 'contain' with find().

  In the controller:

                  $data   =       $this-Client-find('first',aa(
                          'conditions',aa(
                                  'Client.id',$id
                          ),
                          'contain',array(
                                  'Country',
                                  
  'Sale'=array('User','Product','ProductGroup')
                          )
                  ));

  It fetches all data I want, but generates the same queries again if
  for instance different Sales have the same ProductGroup. Here is what
  the mysql debug says:

  37      SELECT `ProductGroup`.`id`, `ProductGroup`.`name`,
  `ProductGroup`.`description`, `ProductGroup`.`price_per_month`,
  `ProductGroup`.`price_one_time`, `ProductGroup`.`period`,
  `ProductGroup`.`created`, `ProductGroup`.`modified` FROM
  `product_groups` AS `ProductGroup` WHERE `ProductGroup`.`id` = 6
  38      SELECT `ProductGroup`.`id`, `ProductGroup`.`name`,
  `ProductGroup`.`description`, `ProductGroup`.`price_per_month`,
  `ProductGroup`.`price_one_time`, `ProductGroup`.`period`,
  `ProductGroup`.`created`, `ProductGroup`.`modified` FROM
  `product_groups` AS `ProductGroup` WHERE `ProductGroup`.`id` = 6
  39      SELECT `ProductGroup`.`id`, `ProductGroup`.`name`,
  `ProductGroup`.`description`, `ProductGroup`.`price_per_month`,
  `ProductGroup`.`price_one_time`, `ProductGroup`.`period`,
  `ProductGroup`.`created`, `ProductGroup`.`modified` FROM
  `product_groups` AS `ProductGroup` WHERE `ProductGroup`.`id` = 6
  40      SELECT `ProductGroup`.`id`, `ProductGroup`.`name`,
  `ProductGroup`.`description`, `ProductGroup`.`price_per_month`,
  `ProductGroup`.`price_one_time`, `ProductGroup`.`period`,
  `ProductGroup`.`created`, `ProductGroup`.`modified` FROM
  `product_groups` AS `ProductGroup` WHERE `ProductGroup`.`id` = 6

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



Re: Change FormHelper (and HtmlHelper) default settings

2009-05-12 Thread Ernesto

thanks a lot for the reply, Treag.

your solution works but, as the code in post #4, it is a hack or
fancy logic as Miles stated.

the only (???) real solution is: wait for CakePHP update :)

a real thank to everyone who replied this thread :)

On 12 Mag, 14:47, Teh Treag tehtr...@gmail.com wrote:
 Ernesto,

 I'm not sure what you are trying to do exactly.  But I am curious
 about feedback on this method; I have used to override the default
 behavior of the formHelper in the past.  I know there are other ways
 to provide the functionality that's in this example.

 I would provide my own class, myFormHelper in this example.

 ?php
 App::import('Helper','Form');
 class MyFormHelper extends FormHelper {
   public $default_options=array('label'=false,'div'=false));
   public function input($fieldname,$options=array()){
     return parent::input($fieldname,am($options,$this-default_options));

   }
 ?

 Now, there are two ways I use classes like this.  When I'm working on
 a new project, I just add 'MyForm' to the helpers list in my
 controllers, and use $myForm-input() in my views.  For an existing
 project, I take a different route.  For an existing project, I don't
 want to go through all the views and update them to use the new
 helper, so I make mine available with the old name.

 ?php // Some controller
     public $helpers=array('Html','MyForm');
     public function beforeRender(){
       $this-Form = $this-MyForm;
     }
 ?

 Ernesto, would this fit your goals?

 -teh

 On May 11, 3:26 am, Ernesto e.fanz...@gmail.com wrote:



  Hello.

  is there any way to change FormHelper and HtmlHelper default settings??
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Change FormHelper (and HtmlHelper) default settings

2009-05-12 Thread Teh Treag

Ernesto,

If you use $myForm in your views and remove the assignment from the
beforeRender(), I wouldn't consider this a hack.
The hack part comes in when you want to substitute your helper for the
existing one.  Good luck.

-teh

On May 12, 9:12 am, Ernesto e.fanz...@gmail.com wrote:
 thanks a lot for the reply, Treag.

 your solution works but, as the code in post #4, it is a hack or
 fancy logic as Miles stated.

 the only (???) real solution is: wait for CakePHP update :)

 a real thank to everyone who replied this thread :)

 On 12 Mag, 14:47, Teh Treag tehtr...@gmail.com wrote:

  Ernesto,

  I'm not sure what you are trying to do exactly.  But I am curious
  about feedback on this method; I have used to override the default
  behavior of the formHelper in the past.  I know there are other ways
  to provide the functionality that's in this example.

  I would provide my own class, myFormHelper in this example.

  ?php
  App::import('Helper','Form');
  class MyFormHelper extends FormHelper {
    public $default_options=array('label'=false,'div'=false));
    public function input($fieldname,$options=array()){
      return parent::input($fieldname,am($options,$this-default_options));

    }
  ?

  Now, there are two ways I use classes like this.  When I'm working on
  a new project, I just add 'MyForm' to the helpers list in my
  controllers, and use $myForm-input() in my views.  For an existing
  project, I take a different route.  For an existing project, I don't
  want to go through all the views and update them to use the new
  helper, so I make mine available with the old name.

  ?php // Some controller
      public $helpers=array('Html','MyForm');
      public function beforeRender(){
        $this-Form = $this-MyForm;
      }
  ?

  Ernesto, would this fit your goals?

  -teh

  On May 11, 3:26 am, Ernesto e.fanz...@gmail.com wrote:

   Hello.

   is there any way to change FormHelper and HtmlHelper default settings??
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Change FormHelper (and HtmlHelper) default settings

2009-05-12 Thread Ernesto

that's what i'm doing :P

thx again

On 12 Mag, 16:34, Teh Treag tehtr...@gmail.com wrote:
 Ernesto,

 If you use $myForm in your views and remove the assignment from the
 beforeRender(), I wouldn't consider this a hack.
 The hack part comes in when you want to substitute your helper for the
 existing one.  Good luck.

 -teh

 On May 12, 9:12 am, Ernesto e.fanz...@gmail.com wrote:



  thanks a lot for the reply, Treag.

  your solution works but, as the code in post #4, it is a hack or
  fancy logic as Miles stated.

  the only (???) real solution is: wait for CakePHP update :)

  a real thank to everyone who replied this thread :)

  On 12 Mag, 14:47, Teh Treag tehtr...@gmail.com wrote:

   Ernesto,

   I'm not sure what you are trying to do exactly.  But I am curious
   about feedback on this method; I have used to override the default
   behavior of the formHelper in the past.  I know there are other ways
   to provide the functionality that's in this example.

   I would provide my own class, myFormHelper in this example.

   ?php
   App::import('Helper','Form');
   class MyFormHelper extends FormHelper {
     public $default_options=array('label'=false,'div'=false));
     public function input($fieldname,$options=array()){
       return parent::input($fieldname,am($options,$this-default_options));

     }
   ?

   Now, there are two ways I use classes like this.  When I'm working on
   a new project, I just add 'MyForm' to the helpers list in my
   controllers, and use $myForm-input() in my views.  For an existing
   project, I take a different route.  For an existing project, I don't
   want to go through all the views and update them to use the new
   helper, so I make mine available with the old name.

   ?php // Some controller
       public $helpers=array('Html','MyForm');
       public function beforeRender(){
         $this-Form = $this-MyForm;
       }
   ?

   Ernesto, would this fit your goals?

   -teh

   On May 11, 3:26 am, Ernesto e.fanz...@gmail.com wrote:

Hello.

is there any way to change FormHelper and HtmlHelper default settings??
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question about how manage particular data in session

2009-05-12 Thread brian

On Tue, May 12, 2009 at 4:33 AM, byqsri marco.rizze...@gmail.com wrote:

 Ok
 But how can I know which service is active in a particular moment?

You could make the service_ids the array keys with a value of false,
except the active 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Underscores do what?? ?php __('...'); ?

2009-05-12 Thread Stuart

Sigh, CakePHP newb here,

I see this type of syntax used in bake generated code and views like
default.ctp but don't see it used in the cookbook. It seems to replace
echo in some places and not in others. I'm guessing this is some sort
of php function to do some string manipulation but I can't seem to
figure out how to search for it via google, the PHP manual, or in the
cookbook. Searching for ?php __(  just returns code excerpts
without any explanation.

Can somebody give me a hint. I'll read the docs, I just need to have
some idea what I'm looking for.

Beware, if you answer this I'm bound to ask another question.
Sometime.

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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Underscores do what?? ?php __('...'); ?

2009-05-12 Thread Matt Curry

http://book.cakephp.org/view/163/Internationalization-in-CakePHP

-Matt
http://www.pseudocoder.com

On May 12, 11:30 am, Stuart stuart.ba...@gmail.com wrote:
 Sigh, CakePHP newb here,

 I see this type of syntax used in bake generated code and views like
 default.ctp but don't see it used in the cookbook. It seems to replace
 echo in some places and not in others. I'm guessing this is some sort
 of php function to do some string manipulation but I can't seem to
 figure out how to search for it via google, the PHP manual, or in the
 cookbook. Searching for ?php __(  just returns code excerpts
 without any explanation.

 Can somebody give me a hint. I'll read the docs, I just need to have
 some idea what I'm looking for.

 Beware, if you answer this I'm bound to ask another question.
 Sometime.

 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Authentication problem

2009-05-12 Thread Spinlock

Auth is hashing your this-data[$this-alias]['password'] field as
soon as it is submitted.
So in fact you are double hashing the field.
First, on submit, Auth hashes the field with key = 'password'
Second you manually has this using Security::hash

Try this instead - rename your field in your form to 'pwd'

Then hash the 'pwd' field into $this-data[$this-alias]['password']

See if that helps.

On May 10, 10:01 am, carlito999 towhid...@gmail.com wrote:
 But the problem still goes on. The saved password in database is
 hashed. But they always shows 'login error' while trying to log in.

 On May 9, 8:51 pm, brian bally.z...@gmail.com wrote:



  Auth hashes the password automatically.

  On Fri, May 8, 2009 at 11:39 PM, carlito towhid...@gmail.com wrote:

    I m using auth component in my project.In my beforesave() function in
   user.php i used this to hash password.

   if(isset($this-data[$this-alias]['password']))
   $this-data[$this-alias]['password'] = Security::hash($this-data
   [$this-alias]['password'], null, true);

   But it login error still remains. I think i need to hash the password
   i give as input. If that's right then how 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question about how manage particular data in session

2009-05-12 Thread byqsri



On 12 Mag, 17:02, brian bally.z...@gmail.com wrote:
 On Tue, May 12, 2009 at 4:33 AM, byqsri marco.rizze...@gmail.com wrote:

  Ok
  But how can I know which service is active in a particular moment?

 You could make the service_ids the array keys with a value of false,
 except the active one.

I can't to do this because I can have some controller/action that is
requested in many services.
I must keep an information of active service in the session
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



database naming convention in conflict with cakePHP naming convention

2009-05-12 Thread j.h09

Hi all,

This is my database table :

DROP TABLE IF EXISTS `Service`;
CREATE TABLE IF NOT EXISTS `Service`
(   --- 'Service' instead of
'Services'
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `operatorId` int(11) unsigned NOT NULL,
--- 'operatorId' instead of 'operator_id' (FK)
  PRIMARY KEY (`serviceId`),
  KEY `Index_OperatorId` (`operatorId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;


As you can see :
- the name of the table 'Service' is not a plural,
- and the foreign key 'operatorId' is without underscore.

The problem is that I cannot change these naming conventions.

Is there any solution to make cakePHP model work with this table?

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



Re: Underscores do what?? ?php __('...'); ?

2009-05-12 Thread Stuart

Wow that was quick! Thanks for the link. I did search _() in the
cookbook but got nearly 500 hits. Guess I got frustrated before I got
to internationalization.

Thanks again.

On May 12, 10:33 am, Matt Curry m...@mcurry.net wrote:
 http://book.cakephp.org/view/163/Internationalization-in-CakePHP

 -Matthttp://www.pseudocoder.com

 On May 12, 11:30 am, Stuart stuart.ba...@gmail.com wrote:

  Sigh, CakePHP newb here,

  I see this type of syntax used in bake generated code and views like
  default.ctp but don't see it used in the cookbook. It seems to replace
  echo in some places and not in others. I'm guessing this is some sort
  of php function to do some string manipulation but I can't seem to
  figure out how to search for it via google, the PHP manual, or in the
  cookbook. Searching for ?php __(  just returns code excerpts
  without any explanation.

  Can somebody give me a hint. I'll read the docs, I just need to have
  some idea what I'm looking for.

  Beware, if you answer this I'm bound to ask another question.
  Sometime.

  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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: database naming convention in conflict with cakePHP naming convention

2009-05-12 Thread Ernesto

just set the proper variables inside your model

var $useTable = Service;
var $primaryKey = operatorID;

have fun :)

On 12 Mag, 17:39, j.h09 julie.hon...@gmail.com wrote:
 Hi all,

 This is my database table :

 DROP TABLE IF EXISTS `Service`;
 CREATE TABLE IF NOT EXISTS `Service`
 (                           --- 'Service' instead of
 'Services'
   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
   `operatorId` int(11) unsigned NOT NULL,
 --- 'operatorId' instead of 'operator_id' (FK)
   PRIMARY KEY (`serviceId`),
   KEY `Index_OperatorI
d` (`operatorId`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

 As you can see :
         - the name of the table 'Service' is not a plural,
         - and the foreign key 'operatorId' is without underscore.

 The problem is that I cannot change these naming conventions.

 Is there any solution to make cakePHP model work with this table?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: database naming convention in conflict with cakePHP naming convention

2009-05-12 Thread Ernesto

misreaded your post

var $primaryKey = serviceID;

:)

On 12 Mag, 17:51, Ernesto e.fanz...@gmail.com wrote:
 just set the proper variables inside your model

 var $useTable = Service;
 var $primaryKey = operatorID;

 have fun :)

 On 12 Mag, 17:39, j.h09 julie.hon...@gmail.com wrote:



  Hi all,

  This is my database table :

  DROP TABLE IF EXISTS `Service`;
  CREATE TABLE IF NOT EXISTS `Service`
  (                           --- 'Service' instead of
  'Services'
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `operatorId` int(11) unsigned NOT NULL,
  --- 'operatorId' instead of 'operator_id' (FK)
    PRIMARY KEY (`serviceId`),
    KEY `Index_OperatorI
 d` (`operatorId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

  As you can see :
          - the name of the table 'Service' is not a plural,
          - and the foreign key 'operatorId' is without underscore.

  The problem is that I cannot change these naming conventions.

  Is there any solution to make cakePHP model work with this table?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Basic Cake install directory

2009-05-12 Thread harrzack

Just starting with Cake - a little unclear as to how to setup
the basic directory structure.

My hosting service has my server root (htdocs equiv) at
public_html. Would a Cake app be installed like this:
public_html
app  (possibly renamed to something significant)
config
models
vendors
.
.
.
app_controller.php
index.php
etc,etc

If the above is true, could I also add sub-domains like:
public_html
 app1
 app2
 app3



Also -
If I rename the app folder to something else,
is there a config file that needs to show this?

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



Re: Basic Cake install directory

2009-05-12 Thread Ernesto

see the advanced installation chapter in cake's cookbook

http://book.cakephp.org/view/35/Advanced-Installation

On 12 Mag, 17:49, harrzack a...@sargasso-sea.net wrote:
 Just starting with Cake - a little unclear as to how to setup
 the basic directory structure.

 My hosting service has my server root (htdocs equiv) at
 public_html. Would a Cake app be installed like this:
 public_html
         app  (possibly renamed to something significant)
                 config
                 models
                 vendors
                 .
                 .
                 .
                 app_controller.php
                 index.php
                 etc,etc

 If the above is true, could I also add sub-domains like:
 public_html
      app1
      app2
      app3

 Also -
 If I rename the app folder to something else,
 is there a config file that needs to show this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Change FormHelper (and HtmlHelper) default settings

2009-05-12 Thread AD7six



On May 12, 4:54 pm, Ernesto e.fanz...@gmail.com wrote:
 that's what i'm doing :P

You wrote:

On May 12, 12:02 pm, Ernesto e.fanz...@gmail.com wrote:
 i ended up hard-coding all the settings. Near every hard-coded setting
 i wrote a comment like this
 /* [MODIFYWHENCAKELWILLSUPPORTHELPEREXTENSIONS] */

Which probably mean you haven't seen the light yet.

In my own code, $html and $form in views are instances of MiHtmlHelper
and MiFormHelper. I assume it's the same for Teh Treag (and many
others).

You also wrote:

your solution works but, as the code in post #4, it is a hack or fancy logic 
as Miles stated.

Post 4 is your own, and contains code that won't work - is that what
you're refering to?
What's the difference between fancy logic and doing some work?
Allowing users to alias their helpers is likely to come eventually but
in the mean time I think you need to do some work and remove any
hacks you've already put in place as in the long run they will only
cost you time.


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



Re: Underscores do what?? ?php __('...'); ?

2009-05-12 Thread AD7six



On May 12, 5:45 pm, Stuart stuart.ba...@gmail.com wrote:
 Wow that was quick! Thanks for the link. I did search _() in the
 cookbook but got nearly 500 hits. Guess I got frustrated before I got
 to internationalization.

For some terms (probably all none-word search terms), the book's
search won't return results.

However, the api is where you should be looking for function
definitions

http://api.cakephp.org/search/__

Which (accounting for a minor hickup whereby the links aren't right
for basics.php) point here:
http://api.cakephp.org/file/basics.php#function-__

hth,

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



Re: validation: 1 rule for 2 or more fields

2009-05-12 Thread Alexandre Brasil

Actually I'm new on cake and still not be able to do Complex Custom
Validation Rules.

So, I saw this example on bin cake, but not works for me. Any ideas or
another code that can I grab the code?

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

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



Re: $useTable ignored when using bindModel()?

2009-05-12 Thread deefens

hi john,

it still doesn't work. i get the same message again:

Error:  Database table activities_hostesses for model
ActivitiesHostess was not found

:(


On 12 Mai, 09:47, John Andersen j.andersen...@gmail.com wrote:
 If I understand what I read from the source, then your code should be:

 ... bindModel( array( 'hasOne' = array('ActivitiesHostess' = array
 ('ActivitiesHostess') ) ), false )'

 Thus your models name should be used as the name for the model that
 CakePHP thinks it has to use (inflected etc)!
 Enjoy,
    John

 On May 12, 9:07 am, deefens steff.muel...@gmail.com wrote:

  nobody familar with this? *hope*

  On 9 Mai, 09:16, deefens steff.muel...@gmail.com wrote:

   Hi guys,

   this is driving me nuts: when i use bindModel() to add a relationship
   on the fly to an certain model, it seems that cake ignores the table
   name specified in the attached model in var $useTable.

   Example:

   class ActivitiesHostess extends AppModel {

      var $name = 'ActivitiesHostess';
      var $useTable = 'v_activities_hostess';

      var $belongsTo = array('Activity', 'Hostess');

   }

   this is my added relationship class, providing one girl per activity
   (don't mess, thats a harmless website smile.gif. so i attach this on
   the fly in the hostess controller:

   $url['activity']?$this-Hostess-bindModel(array('hasOne'=array
   ('ActivitiesHostess' = array())), false):'';

   but then, after clearing the cache and reload the website cake says:

Error:  Database table activities_hostesses for model 
ActivitiesHostess was not found.

   but in the model i specified the table name as v_activities_hostess
   (it's a view). has anyone any explanation for this or a workaround to
   avoid cake aborting here? googled half the world, but didn't have any
   success...

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



Re: Poll: what do you hate about CakePHP?

2009-05-12 Thread Arvind

@Smelly Eddie checked further postings! LOL

I love cakephp. In fact i have been building major projects in cake
php for last 2 years now. And mind you it has never let me down.

I had (or may have) complaints (and already covered in this post) but
every time i was able to find a quick solution for that. So its OK.

None+. :)

On May 8, 6:08 pm, Smelly Eddie ollit...@gmail.com wrote:
 I hate that it is a powerful framework that can make the tedious work
 of developing sites a breeze.  Its strict adherence to the tried and
 true MVC model is a pain point as well.  Why so logical?

 I hate the active community involvement and powerful documentation and
 API sites.  I hate that people expect Cake to do every little thing.

 It is a framework! Not a solve everything-all-in-one-cms-portal-file-
 manager-blog-forum.

 Use the framework to create an upload component, it takes all of 5
 minutes!!

 On May 8, 8:56 am, Dennis S. Hennen dennis.hen...@gmail.com wrote:

  Consider Post hasMany Comment

       Comment-find('all') returns {n}.Comment.*

       Post-find('all') gives you Comment.{n}.*

  If I want a helper to do processing on a list of comments, I have to
  handle both potential formats, or massage the data.

  Related to this is the $primary parameter to the afterFind callback.

  Perhaps find results as objects instead of arrays?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: validation: 1 rule for 2 or more fields

2009-05-12 Thread Stu

It wouldn't require much Cake knowledge as much as basic programming
knowledge to create a custom validation rule.  You would liek that
your field is unique, so here is what you could do:

add this to your model:

function uniqueValidation($data, $field){
  $list = $this-Model-find('list' array('fields'=$field));
  if(in_array($data['Model'][$field], $list)){
return false;
  }else{
return true;
  }
}

and this on top...

var $validate = array(
 'field' = array(
   'rule' = array('uniqueValidation', 'field1'),
   'message' = 'The name is already taken, please choose another
one.'
 ),
 'field2' = array(
   'rule' = array('uniqueValidation', 'field2'),
   'message' = 'The name is already taken, please choose another
one.'
 ),
 );

You could even add the function to your app_model and use it through
your whole 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



TCPDF FPDI inside Cake...

2009-05-12 Thread ryan

I am pretty good at getting around in cake, I have been using TCPDF to
handle creating PDFs for my app. I am currently trying to extend TCPD
with FPDI and FPDI_TPL.

http://bakery.cakephp.org/articles/view/creating-pdf-files-with-cakephp-and-tcpdf

TCPDF : http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf
FPDI : http://www.setasign.de/support/manuals/fpdi/
FPDI_TPL : http://www.setasign.de/support/manuals/fpdf-tpl/introduction/

Does anyone know how I would go about doing this?

Thank you.

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



ActAs in hasMany/belongsTo relationship doesn't work?

2009-05-12 Thread vla...@gmail.com

Hi!

I'm using behavior: 
http://bakery.cakephp.org/articles/view/actas-image-column-behavior

So. It's looks like:

Model A actAs ('Image'...)
Model A hasMany Model B

Model B belongsTo Model A

...

So, when I do some thing like Model A-find('all') - all fine.
Behavior work fine, and I get my images as I wanted.

But, when I try to use
$this-Model B-Model A-find('all..) behavior doesn't work
When I try
$this-Model-B-find(...) behavior doesn't work

Where I'm wrong?

I whant to make select from Model B and getting related Model A with
working behavior... Where is my mistake?

Cake 1.2.3.8166

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



Re: validation: 1 rule for 2 or more fields

2009-05-12 Thread rartavia

The code I showed before does work, and cake already has a unique
validation so why code it your self. Try his:

var $validate = array(
'field1' = array(
'unique' = array(
'rule' = 'isUnique',
'required' = true,
'message' = 'Duplicate entry in Field1'
)
),
'field2' = array(
'unique' = array(
'rule' = 'isUnique',
'required' = true,
'message' = 'Duplicate entry in Field2'
)
)
);

Again, you should take a look to:
http://book.cakephp.org/view/133/Multiple-Rules-per-Field
http://book.cakephp.org/view/134/Core-Validation-Rules
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Email Component Help: smtpError

2009-05-12 Thread rartavia

Any body knows any other nice email component available to use with
cake?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Database Associations Not Linking Up

2009-05-12 Thread Site Reference

Hey all,

I apologize if this is a bit of a newbie question, but I am having
trouble getting my database associations to link up...here is what I
have:

MySQL Tables

CREATE TABLE phones (
  id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  profile_id INTEGER UNSIGNED NULL,
  phone VARCHAR(255) NULL,
  created INTEGER UNSIGNED NULL,
  modified INTEGER UNSIGNED NULL,
  PRIMARY KEY(id)
);

CREATE TABLE profiles (
  id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  name VARCHAR(255) NULL,
  main_address VARCHAR(255) NULL,
  created INTEGER UNSIGNED NULL,
  modified INTEGER UNSIGNED NULL,
  PRIMARY KEY(id)
);


Here are my models:

?php
class Phone extends AppModel {
var $name = 'Phone';
var $belongsTo = 'Profile';
}
?

?php
class Profile extends AppModel {
var $name = 'Profile';
var $hasMany = 'Phone';
}
?


I am using scaffolding for the controllers.  Cake seems to see the
relationship, but is not listing phones in the profiles.  Is there
anyway that I can do this, or is the fact that there are many phone
numbers to a profile a problem?


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



Re: Email Component Help: smtpError

2009-05-12 Thread mscdex

rartavia wrote:
 Any body knows any other nice email component available to use with
 cake?

PHPMailer (http://phpmailer.codeworxtech.com/index.php?pg=phpmailer)
is a popular standalone library that you could use within cake. IIRC
you just have to place it in the vendors folder and import it in your
cake app.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Null value for tinyint field

2009-05-12 Thread Drake

I'm developing my first CakePHP and this is my first post here, so
bare with me. Thanks in advance for any help.

I have a form with several yes/no questions. I chose to store these in
the database as tinyint(1) (using mysql), since they are fundamentally
boolean values. By default, CakePHP renders these fields as
checkboxes. I chose to override this functionality and display these
questions with two yes/no radio buttons, so no and nothing
selected can be distinguished. This setup is working great if one of
the two options is selected.

I'm having problems getting Cake to do the right thing, however, when
neither radio button is selected. In this case, I would like to store
NULL in the database, to represent the fact that neither option was
selected. After posting, $this-data correctly shows empty values for
the fields with neither option selected. But Cake is automatically
writing 0 to all the tinyint fields that aren't explicitly set to
1. This includes all the fields with no option selected.

OK, so my question is, is there any way to stop cake from writing 0
to a tinyint field by default, if no value is set in $this-data?

If this isn't possible, I think I can probably change all these
tinyint fields into enums with yes and no as options, or something
along those lines. If possible, though, I'd like to stick to tinyints
since they're more appropriate for the data.

Thanks for the help!

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



ACL issue

2009-05-12 Thread Dave Maharaj :: WidePixels.com
Asked this before but did some more testing and the problem has come up
again.
 
When building an ACL app i followed the cookbook and initBD and buildACL
work fine. When I add tables to that setup and then I get MAX_JOIN error in
SQL? What would cause this? I checked mySQL settings and MAX_JOIN_SIZE is
listed at 100,000,000. 
 
If i run the exact same table structure locally where my MAX_JOIN_SIZE is
4,294,967,295 it runs the initBD and buildAcl fine with no errors reported.
 
Tested using cake 1.2.3.8166
There are 40 tables in the db 10 are HABTM tables. Is there a limitation of
any kinds using HABTM or something thats causing this error?
What is MAX_JON_SIZE exactly? And what would cause it to be over? My tables
are only populated with 10 entries each with dummy info as its just in
development.
 
All my tables have ID PRIMARY key INT (10) AUTO INCREMENT
 
There is a patch i found on 
 
http://realm3.com/articles/setting_up_users_groups_withacl_and_auth_in_cake
_1.2.php
http://realm3.com/articles/setting_up_users_groups_withacl_and_auth_in_cake_
1.2.php and if i modify the db_acl.php it runs with no errors but still
patching the app is not what i want. Just to find out why it does this.
 
Could I get some feed back on people usingACL with large database tables who
could give me an idea of the size of their tables and let me know what your
MAX_JOIN_SIZE is listed at for your mySQL? Maybe its a hosting issue and
nothing to do with cake at all.
 
Thanks in advance.
 
Dave 

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



setup for Plesk

2009-05-12 Thread brian

The production server for an app has (ugh!) Plesk installed and I'm
having some trouble getting things working. Right now, I'm getting a
403 (forbidden) error when trying to browse the site. I suspect that I
haven't quite covered everything in dealing with Plesk's
DOCUMENT_ROOT, etc. Here are the changes I've made so far:

The cake install looks like so:
/var/www/vhosts/DOMAIN.com/cake/app
libs:
/var/www/vhosts/DOMAIN.com/cake/app/cake_1.2.3.8166/cake

webroot/index.php has the following:
define('CAKE_CORE_INCLUDE_PATH',
dirname(dirname(dirname(__FILE__))).DS.'cake_1.2.3.8166');

I created Plesk Apache conf file to change open_basedir

vi /var/www/vhosts/DOMAIN.com/conf/vhost.conf
Location /
php_admin_value open_basedir /var/www/vhosts/DOMAIN.com/cake
/Location

Next, I pointed DOCUMENT_ROOT to app dir:

cp -R httpdocs/plesk-stat cake/app/
mv httpdocs{,.BAK}
ln -s cake/app httpdocs

... and updated Plesk:
/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=DOMAIN.com

After restarting Apache, I'm getting the 403 I mentioned. And I don't
see anything in Apache's error log. Any ideas? Besides removing Plesk?

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



Re: setup for Plesk

2009-05-12 Thread brian

I got it working. I changed Plesk's vhost.conf to:

DocumentRoot /var/www/vhosts/DOMAIN.com/httpdocs/app/webroot/

Directory /var/www/vhosts/DOMAIN.com/httpdocs/app/webroot/

php_admin_value open_basedir /var/www/vhosts/DOMAIN.com/httpdocs:/tmp

Options Indexes ExecCGI FollowSymLinks MultiViews
AddHandler cgi-script .cgi
AllowOverride all
Order allow,deny
Allow from all
/Directory

I then removed the symlink I'd made and created a real httpdocs dir
again so I had:

/var/www/vhosts/DOMAIN.com/httpdocs/app/
/var/www/vhosts/DOMAIN.com/httpdocs/cake_1.2.3.8166

I'd forgotten to mention that I'd read somewhere that simply doing
this might be a problem for Plesk. But I thought I'd give it a go,
anyway. It's not like it's anything that can't be undone. It seemsto
be fine.

I think the other way would have worked, actually. The problem was
probably due to AllowOverride all being missing (.htaccess ignored).


On Tue, May 12, 2009 at 10:29 PM, brian bally.z...@gmail.com wrote:
 The production server for an app has (ugh!) Plesk installed and I'm
 having some trouble getting things working. Right now, I'm getting a
 403 (forbidden) error when trying to browse the site. I suspect that I
 haven't quite covered everything in dealing with Plesk's
 DOCUMENT_ROOT, etc. Here are the changes I've made so far:

 The cake install looks like so:
 /var/www/vhosts/DOMAIN.com/cake/app
 libs:
 /var/www/vhosts/DOMAIN.com/cake/app/cake_1.2.3.8166/cake

 webroot/index.php has the following:
 define('CAKE_CORE_INCLUDE_PATH',
 dirname(dirname(dirname(__FILE__))).DS.'cake_1.2.3.8166');

 I created Plesk Apache conf file to change open_basedir

 vi /var/www/vhosts/DOMAIN.com/conf/vhost.conf
 Location /
 php_admin_value open_basedir /var/www/vhosts/DOMAIN.com/cake
 /Location

 Next, I pointed DOCUMENT_ROOT to app dir:

 cp -R httpdocs/plesk-stat cake/app/
 mv httpdocs{,.BAK}
 ln -s cake/app httpdocs

 ... and updated Plesk:
 /usr/local/psa/admin/sbin/websrvmng -u --vhost-name=DOMAIN.com

 After restarting Apache, I'm getting the 403 I mentioned. And I don't
 see anything in Apache's error log. Any ideas? Besides removing Plesk?


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



RE: ACL issue

2009-05-12 Thread Dave Maharaj :: WidePixels.com

The server I am hosting with cannot have anything changed so this is it
 
max_allowed_packet   33554432
max_binlog_cache_size18446744073709547520
max_binlog_size  1073741824  
max_connect_errors   10  
max_connections  600 
max_delayed_threads  20  
max_error_count  64  
max_heap_table_size  268435456   
max_insert_delayed_threads   20  
max_join_size1   
max_length_for_sort_data 1024
max_prepared_stmt_count  16382   
max_relay_log_size   0   
max_seeks_for_key18446744073709551615
max_sort_length  1024
max_sp_recursion_depth   0   
max_tmp_tables   1024
max_user_connections 60  
max_write_lock_count 18446744073709551615
 

Does this look normal to what you are using for your apps?



From: Dave Maharaj :: WidePixels.com [mailto:d...@widepixels.com] 
Sent: May-12-09 9:29 PM
To: cake-php@googlegroups.com
Subject: ACL issue


Asked this before but did some more testing and the problem has come up
again.
 
When building an ACL app i followed the cookbook and initBD and buildACL
work fine. When I add tables to that setup and then I get MAX_JOIN error in
SQL? What would cause this? I checked mySQL settings and MAX_JOIN_SIZE is
listed at 100,000,000. 
 
If i run the exact same table structure locally where my MAX_JOIN_SIZE is
4,294,967,295 it runs the initBD and buildAcl fine with no errors reported.
 
Tested using cake 1.2.3.8166
There are 40 tables in the db 10 are HABTM tables. Is there a limitation of
any kinds using HABTM or something thats causing this error?
What is MAX_JON_SIZE exactly? And what would cause it to be over? My tables
are only populated with 10 entries each with dummy info as its just in
development.
 
All my tables have ID PRIMARY key INT (10) AUTO INCREMENT
 
There is a patch i found on 
http://realm3.com/articles/setting_up_users_groups_withacl_and_auth_in_cake_
1.2.php
http://realm3.com/articles/setting_up_users_groups_withacl_and_auth_in_cake
_1.2.php  and if i modify the db_acl.php it runs with no errors but still
patching the app is not what i want. Just to find out why it does this.
 
Could I get some feed back on people usingACL with large database tables who
could give me an idea of the size of their tables and let me know what your
MAX_JOIN_SIZE is listed at for your mySQL? Maybe its a hosting issue and
nothing to do with cake at all.
 
Thanks in advance.
 
Dave 





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



Re: Question about how manage particular data in session

2009-05-12 Thread Dr. Loboto

You should save service_id in session as associative array:
current_url = service_id. When your controller/action is requested,
search service_id in session by $this-referer() key. You also should
be always aware that referrer or session will be empty and be able to
act normally in this case too.

On May 12, 10:39 pm, byqsri marco.rizze...@gmail.com wrote:
 On 12 Mag, 17:02, brian bally.z...@gmail.com wrote:

  On Tue, May 12, 2009 at 4:33 AM, byqsri marco.rizze...@gmail.com wrote:

   Ok
   But how can I know which service is active in a particular moment?

  You could make the service_ids the array keys with a value of false,
  except the active one.

 I can't to do this because I can have some controller/action that is
 requested in many services.
 I must keep an information of active service in the session
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $useTable ignored when using bindModel()?

2009-05-12 Thread Dr. Loboto

Check filename of ActivitiesHostess model, it should be
activities_hostess.php Such error will occur if Cake is unable to find
your model file and load generic model that assume conventional
table name.

On May 13, 1:01 am, deefens steff.muel...@gmail.com wrote:
 hi john,

 it still doesn't work. i get the same message again:

 Error:  Database table activities_hostesses for model
 ActivitiesHostess was not found

 :(

 On 12 Mai, 09:47, John Andersen j.andersen...@gmail.com wrote:

  If I understand what I read from the source, then your code should be:

  ... bindModel( array( 'hasOne' = array('ActivitiesHostess' = array
  ('ActivitiesHostess') ) ), false )'

  Thus your models name should be used as the name for the model that
  CakePHP thinks it has to use (inflected etc)!
  Enjoy,
     John

  On May 12, 9:07 am, deefens steff.muel...@gmail.com wrote:

   nobody familar with this? *hope*

   On 9 Mai, 09:16, deefens steff.muel...@gmail.com wrote:

Hi guys,

this is driving me nuts: when i use bindModel() to add a relationship
on the fly to an certain model, it seems that cake ignores the table
name specified in the attached model in var $useTable.

Example:

class ActivitiesHostess extends AppModel {

   var $name = 'ActivitiesHostess';
   var $useTable = 'v_activities_hostess';

   var $belongsTo = array('Activity', 'Hostess');

}

this is my added relationship class, providing one girl per activity
(don't mess, thats a harmless website smile.gif. so i attach this on
the fly in the hostess controller:

$url['activity']?$this-Hostess-bindModel(array('hasOne'=array
('ActivitiesHostess' = array())), false):'';

but then, after clearing the cache and reload the website cake says:

 Error:  Database table activities_hostesses for model 
 ActivitiesHostess was not found.

but in the model i specified the table name as v_activities_hostess
(it's a view). has anyone any explanation for this or a workaround to
avoid cake aborting here? googled half the world, but didn't have any
success...

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



Re: Poll: what do you hate about CakePHP?

2009-05-12 Thread Reuben Helms
Cake PHP is leaps and bounds ahead of what I used to use, but I'd like to
see...
* Improved support for Search Engine Friendly URLs.  There are many types of
SEF, and while there are already published versions of a few of them, I'd
like to see some core support, so that a new revision of Cake doesnt break
them. Types of SEF support I'd like to see are:
  * SEF Slug additions.  This is the one that usually gets used. The a
search engine friendly slug is appended to the URL. i.e.
/controller/view/1/my-content-title
  * SEF Slug replacements.  This is were the id gets replaced with a SEF
slug.  i.e. /controller/view/my-content-title maps to /controller/view/1
  * Virtual Paths.  This is where a controller/action/id gets mapped to a
virtual path.  Probably the trickiest to do, and perhaps well beyond the
scope of supporting in Cake Core.  The path would be mapped to a
controller/action/id on the way in, and links would be recognised and
converted on the way out.

* Naming of helpers.  Often, I need to overload the Form or HTML helper with
custom actions, or additional actions. When I do this, I have a
CustomFormHelper that extends the default FormHelper, but I then have to
reference the newer helper via $customForm.  Given that I'm extending
FormHelper, and still have access to all of those functions provided to it,
I'd like to specify that $form references CustomFormHelper.  Downside of
this is that the programmer becomes partially responsible for resolving for
variable conflicts if they incorrectly name something, or have a helper in
the app controller that conflicts with a helper name in the actual
controller.

On Fri, May 8, 2009 at 8:29 AM, Nate nate.ab...@gmail.com wrote:


 Well, maybe hate's a strong word.  Let's say, what do you like the
 least?  Kind of an odd question, I know, but since we've kick-started
 development of a new version, I'd like to know what the most
 frustrating things with the framework are, even if they're things we
 can't fix right away.

 I'll get us started: PHP 4 support.

 Who's next? TIA for the input.
 


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



Re: Email Component Help: smtpError

2009-05-12 Thread rartavia

Thanks man,
I ended up using SwiftMailer. I found a Cake Component by Matt Huggins
(http://bakery.cakephp.org/articles/view/improved-swiftmailer-
component) that used SwiftMailer 3, since current version is 4.0.3 I
modified Matt's Component for current release and thats what I'm using
now.
The problem I was having actually disappeared with the use of
SwiftMailer, so I guess there's something wrong with cake's email
component sending through SMTP, at least with my hosting (bluehost).
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Email Component, cc and bcc not working?

2009-05-12 Thread Louie Miranda
Hi, I have setup the email component properly on cakephp. I can send and
it's ok for both html and text.

I tried adding the cc and bcc option, however. It seems to be not working.
http://api.cakephp.org/class/email-component

$this-Email-to = 'u...@example.com, lmira...@example.com';
$this-Email-cc = 'us...@example.com';
$this-Email-bcc = 'bcc...@example.com';

I am using CakePHP...

cat VERSION.txt
///
//
+---+
//
// + $Id: VERSION.txt 7962 2008-12-25 23:30:33Z gwoo $
// + Last Modified: $Date: 2008-12-25 17:30:33 -0600 (Thu, 25 Dec 2008) $
// + Modified By: $LastChangedBy: gwoo $
//
+---+
//
///

*1.2.0.7962*

any ideas?
--
Louie Miranda (lmira...@gmail.com)
http://www.louiemiranda.net

Quality Web Hosting - www.axishift.com
Pinoy Web Hosting, Web Hosting Philippines

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



Re: Email Component, cc and bcc not working?

2009-05-12 Thread Graham Weldon
Hi Louie,

I believe the cc and bcc variables need to be arrays.
Try wrapping them in an array and see how that goes for you.

Cheers,
Graham Weldon
http://grahamweldon.com





Louie Miranda wrote:
 Hi, I have setup the email component properly on cakephp. I can send 
 and it's ok for both html and text.

 I tried adding the cc and bcc option, however. It seems to be not working.
 http://api.cakephp.org/class/email-component

 $this-Email-to = 'u...@example.com mailto:u...@example.com, 
 lmira...@example.com mailto:lmira...@example.com';
 $this-Email-cc = 'us...@example.com mailto:us...@example.com';
 $this-Email-bcc = 'bcc...@example.com mailto:bcc...@example.com';

 I am using CakePHP...

 cat VERSION.txt
 ///
 // 
 +---+
  
 //
 // + $Id: VERSION.txt 7962 2008-12-25 23:30:33Z gwoo $
 // + Last Modified: $Date: 2008-12-25 17:30:33 -0600 (Thu, 25 Dec 2008) $
 // + Modified By: $LastChangedBy: gwoo $
 // 
 +---+
  
 //
 ///

 *1.2.0.7962*

 any ideas?
 --
 Louie Miranda (lmira...@gmail.com mailto:lmira...@gmail.com)
 http://www.louiemiranda.net

 Quality Web Hosting - www.axishift.com http://www.axishift.com
 Pinoy Web Hosting, Web Hosting Philippines

 


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



What is the best way?

2009-05-12 Thread Dave Maharaj :: WidePixels.com
I have multiple HABTM tables for a user to select different options relating
to skills / preferences / experience. Would it be possible to use the tree
behaviour to group the options into 1 table and the user select from them
and only update the specific section? I am using multiple HABTM tables
simply because I need the user to update skills / preferences / experience
individually. Putting them all into one form updates them all and they are
all in different forms so that does not work. Is there a way to put all the
options into one table and if the user is updating their skills it will not
update their preferences or skills?
 
What is the best approach to this?
 
Dave

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



Re: Email Component, cc and bcc not working?

2009-05-12 Thread Louie Miranda
It worked! thanks a lot.

$ccArray = array('lmira...@example.com', 'us...@example.com');
--
Louie Miranda (lmira...@gmail.com)
http://www.louiemiranda.net

Quality Web Hosting - www.axishift.com
Pinoy Web Hosting, Web Hosting Philippines


On Wed, May 13, 2009 at 12:17 PM, Graham Weldon gra...@grahamweldon.comwrote:

  Hi Louie,

 I believe the cc and bcc variables need to be arrays.
 Try wrapping them in an array and see how that goes for you.

 Cheers,
 Graham Weldon
 http://grahamweldon.com






 Louie Miranda wrote:

 Hi, I have setup the email component properly on cakephp. I can send and
 it's ok for both html and text.

 I tried adding the cc and bcc option, however. It seems to be not working.
 http://api.cakephp.org/class/email-component

 $this-Email-to = 'u...@example.com, lmira...@example.com';
 $this-Email-cc = 'us...@example.com';
 $this-Email-bcc = 'bcc...@example.com';

 I am using CakePHP...

 cat VERSION.txt

 ///
 //
 +---+
 //
 // + $Id: VERSION.txt 7962 2008-12-25 23:30:33Z gwoo $
 // + Last Modified: $Date: 2008-12-25 17:30:33 -0600 (Thu, 25 Dec 2008) $
 // + Modified By: $LastChangedBy: gwoo $
 //
 +---+
 //

 ///

 *1.2.0.7962*

 any ideas?
 --
 Louie Miranda (lmira...@gmail.com)
 http://www.louiemiranda.net

 Quality Web Hosting - www.axishift.com
 Pinoy Web Hosting, Web Hosting Philippines




 


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



Good star rating tutorial

2009-05-12 Thread jwerd

Hey there fellow Bakers

Looking for a good, easy to follow star rating tutorial that is Cake-
PHP friendly (preferably one that is based around Cake-PHP).  You can
also post code samples if you already have one going...

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



Re: Good star rating tutorial

2009-05-12 Thread Graham Weldon

Hey,

There are quite a few out there. I just googled cakephp star rating 
and found a bunch.
Try there first, and report back if you have any specific implementation 
issues that you need help with.

Cheers,
Graham Weldon
http://grahamweldon.com


jwerd wrote:
 Hey there fellow Bakers

 Looking for a good, easy to follow star rating tutorial that is Cake-
 PHP friendly (preferably one that is based around Cake-PHP).  You can
 also post code samples if you already have one going...

 TIA!
 
   


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



api.cakephp.org still broken

2009-05-12 Thread Mr-Yellow

For months now the API documentation site has not been accessible to
IE.

The search button is stretched over the navigation area.

The site is also not usable in FF as the source view loads in a div
with hidden overflow which bugs.

Only way to use the site is o first navigate using FF then switch to
IE for viewing the source.

-Ben

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



generating slug from title - must be unique! (using sluggable-1.1.3)

2009-05-12 Thread mig_akira


Hello!

I'm using the behavior sluggable-1.1.3 and the instructions from
http://bakery.cakephp.org/articles/view/sluggable-behavior

Everything works fine, except that if I create two pages with the same
Title, then the slugged URL will be the same for both. Is there some way to
stop it from generating the same slug, or to change it somehow (by
generating something like title1, title2, etc)?

Thanks a lot!!
-- 
View this message in context: 
http://www.nabble.com/generating-slug-from-title---must-be-unique%21-%28using-sluggable-1.1.3%29-tp23515374p23515374.html
Sent from the CakePHP mailing list archive at Nabble.com.


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



Re: Good star rating tutorial

2009-05-12 Thread jwerd

I searched before I came here, tbh...

http://www.reversefolds.com/articles/show/rating2 - too outddated,
it'd be more work than worth to get it going to 1.2

http://bakery.cakephp.org/articles/view/star-rating-control-with-formhelper-jquery
- broken links to actually get the download (located at the bottom)

So, I'm still on the prowl to find something that is working.  I think
the bakery system would serve me well, however, I can get all the
corresponding files to put it all together (it's a 404 on the site).

TIA!


On May 12, 10:50 pm, Graham Weldon gra...@grahamweldon.com wrote:
 Hey,

 There are quite a few out there. I just googled cakephp star rating
 and found a bunch.
 Try there first, and report back if you have any specific implementation
 issues that you need help with.

 Cheers,
 Graham Weldonhttp://grahamweldon.com

 jwerd wrote:
  Hey there fellow Bakers

  Looking for a good, easy to follow star rating tutorial that is Cake-
  PHP friendly (preferably one that is based around Cake-PHP).  You can
  also post code samples if you already have one going...

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