A link to view page.

2010-03-23 Thread jiru
Hii, Can anybody add a link on this code ?

And when click on the link it should redirect to the view of the
search result.( ie.to  array('controller' = 'members', 'action' =
'view'))

code :

echo 'li onClick=fill(\''.addslashes($results['members']
['name']).'\');'.$results['members']['name'].'/li';

I'm faild to add the link on it.
Plz help me.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Class 'AppController' not found.

2010-03-23 Thread Martin Duris
check, if you you have AppController  in C:\xampp\htdocs\cakephp\app\
... maybe you have deleted it ...

2010/3/23 Sean sean...@gmail.com:
 Hey, guys.  I'm a newbie here.  I encountered this problem when trying
 to run a simple controller starting with the following lines:

 class UsersController extends AppController {
        var $name = 'Users';
        var $scarffold;
        var $helpers = array('Html', 'Form', 'Session');
        var $components = array('Auth');
        ...

 And the debugger said Fatal error: Class 'AppController' not found in
 C:\xampp\htdocs\cakephp\app\controllers\users_controller.php on line
 2

 Would you please advise me what kind of mistake could I have made?
 And how can I solve it?
 Thanks a lot.

 - Sean

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

 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

 To unsubscribe from this group, send email to 
 cake-php+unsubscribegooglegroups.com or reply to this email with the words 
 REMOVE ME as the subject.


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Basic ACL question; Why have all users in the ARO?

2010-03-23 Thread Martin Duris
try this : http://book.cakephp.org/view/465/Understanding-How-ACL-Works
sometimes, maybe you will need to create groups for users but in those
groups there will must be some users, who have special - premium acces
...

2010/3/23 xtraorange xtraora...@gmail.com:
 Howdy all,

 Maybe someone can explain this to me, because I'm just having trouble
 understanding:
 In the tutorial (http://book.cakephp.org/view/641/Simple-Acl-
 controlled-Application) the author seems to be suggesting that all
 users should be listed in the ARO table (and their group updated as
 needed).  The thing that I don't understand about this is why?

 Wouldn't it make more sense to just list the users that need special
 permission, and for everyone else just check what their group_id is in
 the user table, and use said for their permission levels?  I doubt
 I'll even have one user that will need a different set of permissions
 other than what the groups will be set to... so is it really necessary
 to list all my users in that table?  What's the advantage there?

 Thanks!
 James

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

 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

 To unsubscribe from this group, send email to 
 cake-php+unsubscribegooglegroups.com or reply to this email with the words 
 REMOVE ME as the subject.


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: iis micronovae mod-rewrite

2010-03-23 Thread miryamfv
just fyi, i solved the issue. the problem was I had cakephp on a
subfolder, so i just added a RewriteBase /subfolder/ to the .htaccess

On Mar 19, 2:07 am, miryamfv mirya...@gmail.com wrote:
 Hello,

 I'm trying to get mod_rewrite to work on iis, my hosting company is
 using themicronovaemodule but which allows you use a .htaccess file,
 but I cant make it work,

 does anybody know about this?

 Thank you very much

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Class 'AppController' not found.

2010-03-23 Thread Jeremy Burns
Just a small extra point - did you mean var $scaffold?

Jeremy Burns
jeremybu...@me.com


On 23 Mar 2010, at 07:53, Martin Duris wrote:

 check, if you you have AppController  in C:\xampp\htdocs\cakephp\app\
 ... maybe you have deleted it ...
 
 2010/3/23 Sean sean...@gmail.com:
 Hey, guys.  I'm a newbie here.  I encountered this problem when trying
 to run a simple controller starting with the following lines:
 
 class UsersController extends AppController {
var $name = 'Users';
var $scarffold;
var $helpers = array('Html', 'Form', 'Session');
var $components = array('Auth');
...
 
 And the debugger said Fatal error: Class 'AppController' not found in
 C:\xampp\htdocs\cakephp\app\controllers\users_controller.php on line
 2
 
 Would you please advise me what kind of mistake could I have made?
 And how can I solve it?
 Thanks a lot.
 
 - Sean
 
 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.
 
 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
 
 To unsubscribe from this group, send email to 
 cake-php+unsubscribegooglegroups.com or reply to this email with the words 
 REMOVE ME as the subject.
 
 
 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.
 
 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
 
 To unsubscribe from this group, send email to 
 cake-php+unsubscribegooglegroups.com or reply to this email with the words 
 REMOVE ME as the subject.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: A link to view page.

2010-03-23 Thread Amit Rawat
Try this:-

li
?php echo $html-link($results['members']['name'],'/members/view',null);?
/li

Enjoy:
Amit:)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Weird Validation Question

2010-03-23 Thread WebbedIT
I agree with cricket as it's more likely a person will have one email
address and will chose to make it public or not.  In the site I am
currently designing I am allowing messages to be sent through the site
so no-one gets to see other members emails.  But each member can chose
to display their email address.

But then again I also allow each member to add multiple online
addresses, postal addresses, telephony numbers and each have their own
model.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Ckeditor + CkFinder How to

2010-03-23 Thread Rafael Gomes
Well guys,

I was trying many hours how to configure this two apps on cake.

Let's my explanation.

If don't you know about then go to : http://ckeditor.com/ and
http://ckfinder.com/


Let's go.


1 - First you have to download the ckeditor and ckfinder.

2 - Unzip then on webroot

like this:

webroot
= js
= ckfinder
= ckeditor

3 - go to your controller that you wanna activate and write on the
class, out of the method.
var $helpers = array('Html', 'Form', 'Javascript');  -  this enables
the helpers

4 - If you put on the webroot, just past this on your view and you
have to name an id of a textare to 'editor';

?php $javascript-codeBlock(window.onload = function()
{
CKEDITOR.replace( 'editor',
{
filebrowserBrowseUrl : 
'.$html-url('/ckfinder/ckfinder.html').',
filebrowserImageBrowseUrl : 
'.$html-url('/ckfinder/ckfinder.html?
type=Images').',
filebrowserFlashBrowseUrl : 
'.$html-url('/ckfinder/ckfinder.html?
type=Flash').',
filebrowserUploadUrl : 
'.$html-url('/ckfinder/core/connector/php/
connector.php?command=QuickUploadtype=FilescurrentFolder=/upload/
image/').',
filebrowserImageUploadUrl : 
'.$html-url('/ckfinder/core/connector/
php/connector.php?command=QuickUploadtype=ImagescurrentFolder=/
upload/flash/').',
filebrowserFlashUploadUrl : 
'.$html-url('/ckfinder/core/connector/
php/connector.php?command=QuickUploadtype=Flash').',
filebrowserWindowWidth : '1000',
filebrowserWindowHeight : '700'
}
);
}, array('inline' = false)); ?

This will activate you ckeditor and almost ckfinder.

but you have to put the textare like I said. something like this.
?php echo $form-input('Model.field', array('type' = 'textarea',
'id' = 'editor', 'label' = 'Tex:br /', 'value' = '')); ?

5 - put this on your config.php inside the ckdinder directory ---
this break the security
function CheckAuthentication()
{
 return true;
}

If anyone have the right way to do that, please send. But this works.

6 - modify your urlBase on your config.php on your ckfinder directory
$baseUrl = '/website/app/webroot/upload/';
This set the directory of upload to webroot

Make sure that you have permission on the directory.


That's it ... any doubts just ask :)

I'm learning too...and this was hard to me..


Ahhh.. sorry about my english :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Fata error: non-object ?

2010-03-23 Thread WebbedIT
Problem here is the OP did not tell anyone what the association was so
some people have assumed it's a HABTM and others have not and hence we
have a lot of conflicting advice :o)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Flatten Array

2010-03-23 Thread WebbedIT
Can I ask why you want to flatten it as that would be a non-cake-like
data array then which would break a lot of automagic?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: retrieve related model data

2010-03-23 Thread sebb86
Thanks for your help but i still dont get it working. sorry for my bad
knowledge.

In my addModel, i added this line: [code]var $actsAs =
array('Containable');[/code]

In my controller i tryed this to use contain with paginate:
[code]
$this-set('ports', $this-paginate('Port', array('fields' =
array('*'), 'contain' = array('PortUplink' =
array('HardwareUnit');
[/code]
But i get lots of errors...for example, 'fields' is unknown.
Greetings.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Is there Dual Select Box for CakePHP?

2010-03-23 Thread Vadim Frolov
Thanks, Nick. I also did some search on this. Seems that jQuery is a way to
go. It has several nice plugins to do this.
Just some more linke for those who may need this too:
http://wheresrhys.co.uk/resources/crossSelect/crossSelect.html
http://plugins.jquery.com/project/comboselect

Vadim.

On 23 March 2010 04:08, nurvzy nur...@gmail.com wrote:

 Found one:
 http://gsgd.co.uk/sandbox/jquery/picklists/

 Nick


 On Mar 22, 9:04 pm, nurvzy nur...@gmail.com wrote:
  That's really a javascript thing more than a CakePHP thing.  A few
  years back I had a client who wanted the same type of thing.  I ended
  up writing a nice little prototype-js class that I could use whenever
  I needed by just passing in the two select list ids in.
 
  Unfortunately, it was for a rather paranoid client and I was unable to
  open source it, but it certainly wasn't rocket science.  A quick
  google search led me to this:
 http://javascript.internet.com/miscellaneous/move-dual-list.html
 
  It's not nearly as nice, but it might give you a place to start.
 
  Another thought, I'm a prototype guy, but I know most people here are
  jQuery freaks, and this is the type of thing I'm sure jQuery people
  have already done as a nice plugin.  Any of you jQuery people know of
  a nice dual select box plugin?
 
  Nick
 
  On Mar 22, 12:33 am, Vadim Frolov fra...@gmail.com wrote:
 
   Hi there!
 
   Maybe someone of you know the realization of dual select boxes idea.
 Such
   control is used for example in ASP.NET (
 http://www.asp.net/community/control-gallery/Item.aspx?i=642). I would
 like
   to have two areas: left area contains all available for selection
 items,
   right one contains selected items.
 
   Of course, one could implement it by himself, but I would rather use
 (and
   modify) existing code than reinvent the wheel.
 
   Best regards,
   Vadim Frolov.

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

 To unsubscribe from this group, send email to cake-php+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Change __() default behavior

2010-03-23 Thread djogo
Hello

I asked the same thing some time ago, in this thread (couldn't find
googlegroups link, sorry)

http://www.mail-archive.com/cake-php@googlegroups.com/msg79031.html

Somebody said it was in the developer's plans, but still...

I thought about creating ___(), but it's a lot of keystrokes. Also,
I'm not sure whether the string extraction script would work that way,
and that's one of the good things about _() or __().

Is it possible to undefine __() [ or maybe _() ] and redefine it in
boostrap.php (pun intended) ? I think it would be better.


On Mar 23, 12:52 am, xtraorange xtraora...@gmail.com wrote:
 Thanks!  :)

 (I liked boostrap.php better, but I followed what you were
 saying.  :P)

 On Mar 22, 10:23 pm, nurvzy nur...@gmail.com wrote:

  Whops... boostrap.php = bootstrap.php

  Just incase you were confused. lol

  Nick

  On Mar 22, 9:21 pm, nurvzy nur...@gmail.com wrote:

   Put it in app/config/boostrap.php

   You'll have access to it throughout your app.
   Nick

   On Mar 22, 8:06 pm, xtraorange xtraora...@gmail.com wrote:

That's actually exactly what I was just thinking of doing, lol.
Thanks!

The only thing I can't find... where am I supposed to place a function
that I want available both on the control and view levels?

On Mar 22, 8:59 pm, Gonzalo Servat gser...@gmail.com wrote:

 On Tue, Mar 23, 2010 at 12:44 PM, xtraorange xtraora...@gmail.com 
 wrote:
  Howdy all,

  This should be a quick one:
  Is there any way, without editing the cake core (so that upgrades 
  are
  easy), to switch the default behavior of __() from by default 
  echoing,
  to by default returning?  I find that 99% of the time, I don't want 
  it
  to echo, and it's annoying to add the true parameter in there every
  single time.

 What about creating a new function like ___() that calls __() with 
 the true
 parameter?

 Regards
 Gonzalo

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: A link to view page.

2010-03-23 Thread jiru
hii, It was a long time to cu.

ok here it shows the old error :Notice 8: Undefined variable html



On Mar 23, 1:32 pm, Amit Rawat rawatami...@gmail.com wrote:
 Try this:-

 li
 ?php echo $html-link($results['members']['name'],'/members/view',null);?
 /li

 Enjoy:
 Amit:)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: A link to view page.

2010-03-23 Thread Amit Rawat
include the Html helper in your controller

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: A link to view page.

2010-03-23 Thread jiru
I tried this but shows the Undefined variable html :

echo 'li', $html-link($results['members']
['name'],array('controller' = 'members', 'action' = 'view',
$results['Member']['id']),array('class' = 'MembersController')), '/
li';

On Mar 23, 1:32 pm, Amit Rawat rawatami...@gmail.com wrote:
 Try this:-

 li
 ?php echo $html-link($results['members']['name'],'/members/view',null);?
 /li

 Enjoy:
 Amit:)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Dynamic Form Data

2010-03-23 Thread WebbedIT
To make things easier, lets strip this back to the core requirements
then you can add in your specific formatting afterwards

$form-input('User.country_id', array('empty' = '-- Select --'));
echo $ajax-observeField('UserCountryId', array('url' =
'countrySelect', 'update' = 'countryAction'));

This should trigger an ajax call to /app/users/countrySelect which
sets a $regions array and renders /app/view/users/country_select.ctp
using the ajax layout (you've obviously managed to get this far).  /
app/view/users/country_select.ctp view could look as simple as

$form-input('User.region_id', array('empty' = '-- Select --'));
echo $ajax-observeField('UserRegionId', array('url' =
'regionSelect', 'update' = 'regionAction'));

I have switched everything back to using cake's conventions, as it's
much easier to learn cake that way.

I imagine both the country and region fields are foreign_keys linking
to tables containing the Countries and Regions which are in turn
related to allow you to know which regions to show for which country
etc.  All foreign keys should have _id after them and form-input will
automagically look for a countries array if a field is called
country_id and a regions array for the field region_id.

HTH

Paul.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Setting arrays for a complicated HABTM relationship

2010-03-23 Thread WebbedIT
Working with and quickly understanding utility libraries early on is a
sign that you should do ok.  And we're always here to help if we can!

Paul

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: MySQL error on field update

2010-03-23 Thread WebbedIT
There can't be a primary key ID of 0 as 0 = false.  As such you're not
passing an id to saveField  so it's running an INSERT instead of an
UPDATE.

You need to take a look at your db table definition as it should not
allow a primary key of 0 if it's an INT/Primary Key/Auto Increment
which it should be.

HTH

Paul

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Better way to handle this model association

2010-03-23 Thread WebbedIT
If there is no validation I would probably create my data array so you
have one Review with Many ServiceTypes, each with its many Criterias.

In the controller I would then save the Review before looping through
each ServiceType using saveAll to save ServiceType and it's many
Criteria.

This should negate the need for massaging the data array as I don't
think you can call one saveAll to save all of this in one go.

Hope this gives you another angle to consider, and form looks good by
the way :P

Paul

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Auth login with email or mobile

2010-03-23 Thread WebbedIT
If I were a genius I would not spend an hour scratching my head
staring at a white screen every time this happens to me!  I think I
have managed to cut the head scratching down to 30mins of late
though :P

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: A link to view page.

2010-03-23 Thread jiru
helper already included.
var $helpers = array('Html', 'Form', 'Ajax', 'Upload', 'Javascript');

On Mar 23, 3:29 pm, Amit Rawat rawatami...@gmail.com wrote:
 include the Html helper in your controller

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: A link to view page.

2010-03-23 Thread Sam Sherlock
Is this code within a helper?

if so

$this-Html-link(...);
- S



On 23 March 2010 10:55, jiru jiransl...@gmail.com wrote:

 helper already included.
 var $helpers = array('Html', 'Form', 'Ajax', 'Upload', 'Javascript');

 On Mar 23, 3:29 pm, Amit Rawat rawatami...@gmail.com wrote:
  include the Html helper in your controller

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

 To unsubscribe from this group, send email to cake-php+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Dynamic Form Data

2010-03-23 Thread Ed Propsner
I actually ended up creating a .js file to hold my functions and initiated
my Ajax with 'onChange' = someFunction(); I pulled the field value into the
script and passed that into the controller action as a named param. etc.
etc. etc. (the entire process seemed a bit unnecessary and long-winded) The
bottom line is that it worked (for the field that was NOT created
dynamically). I repeated the process for the newly generated form field
which in turn did not work. No matter what I try I just can't retrieve any
data from form fields that get generated dynamically and thus the query
fails.

I'll take another wack at it using the suggestions you made and see how I
make out.

Yes, there are separate tables for country, state, and city. I believe I
have the associations set up correctly but who knows, I've been managing to
make a mess of everything else ;) Region and country are my foreign keys
however they are RegionID and CountryID in the db ... I'll change them to
region_id and country_id. The naming conventions in Cake take a little
getting used to.

On Tue, Mar 23, 2010 at 6:39 AM, WebbedIT p...@webbedit.co.uk wrote:

 To make things easier, lets strip this back to the core requirements
 then you can add in your specific formatting afterwards

 $form-input('User.country_id', array('empty' = '-- Select --'));
 echo $ajax-observeField('UserCountryId', array('url' =
 'countrySelect', 'update' = 'countryAction'));

 This should trigger an ajax call to /app/users/countrySelect which
 sets a $regions array and renders /app/view/users/country_select.ctp
 using the ajax layout (you've obviously managed to get this far).  /
 app/view/users/country_select.ctp view could look as simple as

 $form-input('User.region_id', array('empty' = '-- Select --'));
 echo $ajax-observeField('UserRegionId', array('url' =
 'regionSelect', 'update' = 'regionAction'));

 I have switched everything back to using cake's conventions, as it's
 much easier to learn cake that way.

 I imagine both the country and region fields are foreign_keys linking
 to tables containing the Countries and Regions which are in turn
 related to allow you to know which regions to show for which country
 etc.  All foreign keys should have _id after them and form-input will
 automagically look for a countries array if a field is called
 country_id and a regions array for the field region_id.

 HTH

 Paul.

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

 To unsubscribe from this group, send email to cake-php+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: A link to view page.

2010-03-23 Thread jiru
echo 'li', $html-link($results['members']
['name'],array('controller' = 'members', 'action' = 'view',
$results['Member']['id']),array('class' = 'MembersController')), '/
li';

is the code. This is inside a function search() and  on top I added
var $helpers = array('Html', 'Form', 'Ajax', 'Upload', 'Javascript');
but shows the same error.

On Mar 23, 4:07 pm, Sam Sherlock sam.sherl...@gmail.com wrote:
 Is this code within a helper?

 if so

 $this-Html-link(...);
 - S

 On 23 March 2010 10:55, jiru jiransl...@gmail.com wrote:

  helper already included.
  var $helpers = array('Html', 'Form', 'Ajax', 'Upload', 'Javascript');

  On Mar 23, 3:29 pm, Amit Rawat rawatami...@gmail.com wrote:
   include the Html helper in your controller

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
  with their CakePHP related questions.

  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.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

  To unsubscribe from this group, send email to cake-php+
  unsubscribegooglegroups.com or reply to this email with the words REMOVE
  ME as the subject.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: retrieve related model data

2010-03-23 Thread cricket
On Mar 23, 5:28 am, sebb86 kahlc...@googlemail.com wrote:
 Thanks for your help but i still dont get it working. sorry for my bad
 knowledge.

Ha! No worries. I'm certainly no expert.

 In my addModel, i added this line: [code]var $actsAs =
 array('Containable');[/code]

 In my controller i tryed this to use contain with paginate:
 [code]
 $this-set('ports', $this-paginate('Port', array('fields' =
 array('*'), 'contain' = array('PortUplink' =
 array('HardwareUnit');
 [/code]
 But i get lots of errors...for example, 'fields' is unknown.
 Greetings.


I see the problem. You must set the pagination options in the class
var $paginate. The *method* paginate() takes different params:

http://api.cakephp.org/class/controller#method-Controllerpaginate

The 2nd param there is for conditions. So, with what you did 'fields'
was passed in the SQL query literally and the DB complained it didn't
know about that column.

Try this:

var $paginate = array(
'Port' = array(
'fields' = array('*'),
'limit' = some number here,
'order' = array('Port.some_field' = 'ASC'),
'contain' = array(
'PortUplink' = array(
'HardwareUnit'
)
)
)
);

Of course, you can leave out the 'order' option.

In the action:

$this-set(
'ports',
$this-paginate('Port')
);


Search for you can define more than one set of pagination defaults
on this page:
http://book.cakephp.org/view/165/Controller-Setup

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Class 'AppController' not found.

2010-03-23 Thread cricket
Were you trying to access this controller directly? What was the URL
you used?

On Mar 22, 8:38 pm, Sean sean...@gmail.com wrote:
 Hey, guys.  I'm a newbie here.  I encountered this problem when trying
 to run a simple controller starting with the following lines:

 class UsersController extends AppController {
         var $name = 'Users';
         var $scarffold;
         var $helpers = array('Html', 'Form', 'Session');
         var $components = array('Auth');
         ...

 And the debugger said Fatal error: Class 'AppController' not found in
 C:\xampp\htdocs\cakephp\app\controllers\users_controller.php on line
 2

 Would you please advise me what kind of mistake could I have made?
 And how can I solve it?
 Thanks a lot.

 - Sean

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: XML

2010-03-23 Thread cricket
There is no serialize() method in the Xml class. You want to use the
XmlHelper. In that case, add it to your $helpers array and there's no
need to import().

http://api.cakephp.org/class/xml
http://api.cakephp.org/class/xml-helper


On Mar 23, 8:05 am, Carachi carach...@gmail.com wrote:
 Hello, I would to ask how can I create a file .xml with the xml cake
 Helper:
 I followed Cake book (7.12); but I can't see my xml page, because
 there is this Fatal Error: Call to undefined method Xml::serialize()
 in var/www

 Here is the function:
 function create_xml(){
     App::import('Core',array('xml'));

     $xml = new XML();
     $xml-__construct();

     $settings[a][b]=Hello;
     $xml-serialize($settings);

 }

 thanks.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: MySQL error on field update

2010-03-23 Thread WhyNotSmile
Thanks everyone!

It turned out that the db field wasn't set to auto-increment.  I
thought it was, but must have forgotten to tick the box and not
noticed!  Once I changed that, it worked fine.

Thanks again for the help.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Mod Rewrite?

2010-03-23 Thread thankyou
Hello,
I have a website where both website.com/MyDirectory/xxx and
website.com/mydirectory/xxx

point to the same location. The only difference is the capitals.  To
help optimize the website for SEO, I would want to do a 301 redirect
from /MyDirectory/ to /mydirectory/

Is this possible?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: cakephp doesn't support template?

2010-03-23 Thread LunarDraco
Definition from home page of phpframeworks says:
Templates: Indicates whether the framework has an inbuilt template
engine.

On Mar 22, 12:03 pm, Bryan Lim ytbr...@gmail.com wrote:
 Hi all,

 I wonder what does it mean by cakephp doesn't have template ?
 refer:http://www.phpframeworks.com/php-frameworks/index.php?id=2

 Thanks,
 Bryan

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


How Use Rest Web Service

2010-03-23 Thread Jets
Hi, i wanna know that how use rest web service in cake. Can u give any
example for this.

Thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Flatten Array

2010-03-23 Thread gianpaulo
I would be using the data to a non-cakephp platform (java) and it
would be much easier if the data looks like that.

On Mar 23, 5:22 pm, WebbedIT p...@webbedit.co.uk wrote:
 Can I ask why you want to flatten it as that would be a non-cake-like
 data array then which would break a lot of automagic?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


baking and postgresql

2010-03-23 Thread nimbusgb
although my basic installation can see and connect to my postgres
database when I try to bake anything or even just run the basic cake
command to check things out I get the following which appears to be a
bit off since I am trying to use postgres...


r...@servern:/var/www/tangofour/cake/cake/console# ./cake
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/
perl5/auto/DBD/mysql/curl.so' - /usr/lib/perl5/auto/DBD/mysql/curl.so:
cannot open shared object file: No such file or directory in Unknown
on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/
perl5/auto/DBD/mysql/gd.so' - /usr/lib/perl5/auto/DBD/mysql/gd.so:
cannot open shared object file: No such file or directory in Unknown
on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/
perl5/auto/DBD/mysql/mysql.so' - /usr/lib/perl5/auto/DBD/mysql/
mysql.so: undefined symbol: PL_memory_wrap in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/
perl5/auto/DBD/mysql/mysqli.so' - /usr/lib/perl5/auto/DBD/mysql/
mysqli.so: cannot open shared object file: No such file or directory
in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/
perl5/auto/DBD/mysql/pdo.so' - /usr/lib/perl5/auto/DBD/mysql/pdo.so:
cannot open shared object file: No such file or directory in Unknown
on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/
perl5/auto/DBD/mysql/pdo_mysql.so' - /usr/lib/perl5/auto/DBD/mysql/
pdo_mysql.so: cannot open shared object file: No such file or
directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/
perl5/auto/DBD/mysql/pdo_pgsql.so' - /usr/lib/perl5/auto/DBD/mysql/
pdo_pgsql.so: cannot open shared object file: No such file or
directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/
perl5/auto/DBD/mysql/pgsql.so' - /usr/lib/perl5/auto/DBD/mysql/
pgsql.so: cannot open shared object file: No such file or directory in
Unknown on line 0

Welcome to CakePHP v1.3.0-RC2 Console
---
Current Paths:
 -app: app
 -working: /var/www/tangofour/cake/app
 -root: /var/www/tangofour/cake
 -core: /var/www/tangofour/cake

Changing Paths:
your working path should be the same as your application path
to change your path use the '-app' param.
Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp

Available Shells:
 acl [CORE]bake [CORE]   i18n
[CORE]   testsuite [CORE]
 api [CORE]console [CORE]schema
[CORE]



Can anyone throw some light on this?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Flatten Array

2010-03-23 Thread euromark
usually you would then just convert them to json or some other more
appropriate intermediate format
you cant use your phparray anyway...


On 23 Mrz., 16:06, gianpaulo gcbasa...@gmail.com wrote:
 I would be using the data to a non-cakephp platform (java) and it
 would be much easier if the data looks like that.

 On Mar 23, 5:22 pm, WebbedIT p...@webbedit.co.uk wrote:

  Can I ask why you want to flatten it as that would be a non-cake-like
  data array then which would break a lot of automagic?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: baking and postgresql

2010-03-23 Thread nimbusgb
Ok folks never mind. It appears my php.ini file was wrong.



Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


RE: Weird Validation Question

2010-03-23 Thread Dave
I agree 2 emails is confusing. My problem is the users Profile email has to
be visible in my setup as its how to contact the person so no option to hide
it. But since its published I don’t want that email to be the same login
email since people can easily copy the Profile email, click forgot password
and send off and email to the actual user. Sure nothing will happen since it
wont go to anyone but the user but that might be annoying or scary for the
user who sees people trying to access their account. Make sense? So User
email is login / forget  password / or for any site to acct holder contact.
Profile email is public, no option to hide but different than User.

I was also thinking just drop an extra field in User table and set primary
or secondary emails and just pull 1 for the profile and one for user only. I
thnk that’s  better idea, yes no? Easier to compare if same that way and
since User - Profile are related its no big issue to pull the data at any
point

Dave

-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of cricket
Sent: March-23-10 12:39 AM
To: CakePHP
Subject: Re: Weird Validation Question

Use a single email address in users table and add a display_email field in
Profile to allow the users to specify whether it will be displayed publicly.
Having 2 email fields will only confuse people.

On Mar 22, 2:21 pm, Dave make.cake.b...@gmail.com wrote:
 User hasOne Profile belongsTo User
 But I think im just going to put 2 email fields in the user table and 
 just do it that way rather than 1  in user and 1 in profile.

 Thanks for your suggestions guys.

 dave

 -Original Message-
 From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On 
 Behalf

 Of John Andersen
 Sent: March-22-10 4:33 AM
 To: CakePHP
 Subject: Re: Weird Validation Question

 Are your User and Profile models not associated/related to each other
 - User hasOne/belongsTo Profile?
 If you have that relationship, then just query for the Profile with 
 user_id equal the Auth-user('id') :) Enjoy,
    John

 On Mar 22, 2:39 am, Dave make.cake.b...@gmail.com wrote:
  This might be odd but i have user email and profile email.
  User email is not published on the site (used for account, login, 
  forgot stuff like that) profile email is published on the site so 
  for security i figured that its best to use a separate email.

  So when a user wants to edit either of the emails i need to make 
  sure they are not the same so both cant be myn...@somewhere.com.

  How would i validate 1 field based on 2 different models using
  Auth-id since the email is directly related to the logged in user?

  I figured query the opposite table to see if this users email is the 
  same as this profile email (or vice versa depending onwhichis being
  changed) but how do i use the auth id in this?

  validation rule:
  array(
      'rule' = array('notSameAsUser', 'email'),
      'message' = 'Your public email address can not be the same as 
  your account email.',
      'last' = true)

  function:

  function notSameAsUser( $data ) {

    $valid = false;

    $params = array(
     'conditions' = array('Profile.id' = $id),//how do i get the id 
  from Auth in the model?
     'fields' = array('User.email')
     'contain' = array(
      'User' = array(
       'fields' = array(
        'User.email';

    $data $this-find('first', $params);

          if (  $data['User']['email'] !=  $data['Profile']['email'] ) 
  {
                  $valid = true;

          }

          return $valid;

  }

  Dave

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help 
 others with their CakePHP related questions.

 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 
 cake-php+group athttp://groups.google.com/group/cake-php?hl=en

 To unsubscribe from this group, send email to
 cake-php+unsubscribegooglegroups.com or reply to this email with the 
 cake-php+words
 REMOVE ME as the subject.



Check out the new CakePHP Questions site http://cakeqs.org and help others
with their CakePHP related questions.

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 
cake-php+at http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to
cake-php+unsubscribegooglegroups.com or reply to this email with the words
REMOVE ME as the subject.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP 

Re: Weird Validation Question

2010-03-23 Thread cricket
On Mar 23, 12:26 pm, Dave make.cake.b...@gmail.com wrote:
 I agree 2 emails is confusing. My problem is the users Profile email has to
 be visible in my setup as its how to contact the person so no option to hide
 it.

In the admin views, don't even bother checking the display_email
field. It'll only be admins who see it.

 But since its published I don’t want that email to be the same login
 email since people can easily copy the Profile email, click forgot password
 and send off and email to the actual user. Sure nothing will happen since it
 wont go to anyone but the user but that might be annoying or scary for the
 user who sees people trying to access their account. Make sense?

I usually put something along the lines of, If you did not request a
new password please contact us. at the bottom of my new_password
view.

 So User
 email is login / forget  password / or for any site to acct holder contact.
 Profile email is public, no option to hide but different than User.

I smell user confusion. And with a setup like that, you're forcing the
user to reveal at least one email address.

Besides, I have enough trouble ensuring that all users have even a
single email address. That may not be an issue with this app but I've
developed several sites with a userbase that includes some people that
aren't particularly up to speed on the online thing.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Form with two levels of associated models

2010-03-23 Thread Gillian
Ah, I see how it works now.  Thank you!

On Mar 22, 8:00 pm, cricket zijn.digi...@gmail.com wrote:
 A form can only post to a single URL. What you want to do is ensure
 that a Model-read() grabs the associated data. Then specify the
 fields as Company.whatever  Contact.whatever. In the controller, use
 either saveAll($this-data) or save to each model separately.

 On Mar 22, 5:09 pm, Gillian gillian@gmail.com wrote:

  Hi.  I've got a form here with two levels of associated models.
  Basically, it goes like this:

  Company
  -Company information tables
  -Contact table
  --Contact information tables

  Getting the form to post to the models that belong directly to the
  company was simple enough.  What I can't figure out how to do is how
  to get it to post to the models that belong to the contact model (that
  belongs to the company model).  It all needs to be done in a single
  form, so splitting it up isn't really an option.  Can anyone give me
  any pointers?  Thank you!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Themes and Languages

2010-03-23 Thread Zaky Katalan-Ezra
If all you need is language support and the layout is identical use gettext.
See the following thread
http://groups.google.com/group/cake-php/browse_thread/thread/f8c98544bd6352ee/8e43b549197028ee?hl=enlnk=gstq=zaky+po#8e43b549197028ee


On Mon, Mar 22, 2010 at 10:20 PM, Kareem Sabri kareemsj...@gmail.com wrote:
 Hello,

 I have multiple languages on my site (right now just English and
 French). English is the default layouts and views. French is a theme
 called 'french'. Sometimes I apply other themes for clients, so I
 create themes and just override the views I want. The problem is, for
 a french language site, if a themed view file doesn't exist it
 defaults back to English. I want the French sites (identified by a
 language_id field in the database) to default to the 'french' theme if
 the theme file isn't found.

 I've considered a couple of ways to do this:

 1.

 Put in my app_controller - where themes are applied:

 if (file_exists('/views/themed/theme_name/'.$this-
params['action'].'.ctp') {
        $this-theme = 'theme_name';
 } else {
       if ($language_id==2) {
                 $this-theme = 'french'
       }
 }

 This solution is ok, but I'm not crazy about it as I'm probably
 duplicating functionality from cakes core classes.

 2.

 Ditch themes for languages and create multi-language view files
 (English and French are identical except for text being translated -
 same stylesheets). Also not crazy about this, I like my clean view
 files with very little PHP in them.

 Does the community have any better suggestions to handle Language
 switching?

 Thanks in advance.

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

 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

 To unsubscribe from this group, send email to 
 cake-php+unsubscribegooglegroups.com or reply to this email with the words 
 REMOVE ME as the subject.


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Basic ACL question; Why have all users in the ARO?

2010-03-23 Thread xtraorange
It's entirely possible that I may have misread or misunderstood that
example.. but it seemed to me like all the users were again in the ARO
table.  Did I not read that right?

What I should really do is rephrase my question:
Is there a tutorial that would guide me on use the ACL without adding
every one of my users (which there will be a ton of) into the ARO
table needlessly?
Instead I'd like to just add the ones that need special permissions
that exceed group permissions (if there are any at all).
Is this possible and where could I find a guide on it?  :)

Thanks,
James

On Mar 23, 2:57 am, Martin Duris mato.du...@gmail.com wrote:
 try this :http://book.cakephp.org/view/465/Understanding-How-ACL-Works
 sometimes, maybe you will need to create groups for users but in those
 groups there will must be some users, who have special - premium acces
 ...

 2010/3/23 xtraorange xtraora...@gmail.com:

  Howdy all,

  Maybe someone can explain this to me, because I'm just having trouble
  understanding:
  In the tutorial (http://book.cakephp.org/view/641/Simple-Acl-
  controlled-Application) the author seems to be suggesting that all
  users should be listed in the ARO table (and their group updated as
  needed).  The thing that I don't understand about this is why?

  Wouldn't it make more sense to just list the users that need special
  permission, and for everyone else just check what their group_id is in
  the user table, and use said for their permission levels?  I doubt
  I'll even have one user that will need a different set of permissions
  other than what the groups will be set to... so is it really necessary
  to list all my users in that table?  What's the advantage there?

  Thanks!
  James

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
  with their CakePHP related questions.

  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 
  athttp://groups.google.com/group/cake-php?hl=en

  To unsubscribe from this group, send email to 
  cake-php+unsubscribegooglegroups.com or reply to this email with the words 
  REMOVE ME as the subject.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Multi-level form

2010-03-23 Thread Gianni Valenti
Hi all,
I tried to search among the past discussions and in the tutorials for
sub-forms or multi-level forms but I didn't find any helpful post.

I'm trying to decide whether to switch from my own php class set
towards CakePHP framework and I would like to unserstand if CakePHP
can help me building multi-level forms to insert datas in tables like
the following ones:

Companies (`id`, `name`, etc...)
- CompanyPhoneNumbers (`id`, `company_id`, `number`, etc...)
- CompanyEmailAddresses (`id`, `company_id`, `address`, etc...)
- BankAccounts (`id`, `company_id`, etc...)
- Contacts (`id`, `company_id`, `first_name`, `second_name`, etc...)
- - ContactPhoneNumbers (`id`, `contact_id`, `number`, etc...)
- - ContactEmailAddresses (`id`, `contact_id`, `address`, etc...)

I need to build a single form - maybe with ajax tabbed subsections -
to insert these data for each company.

Is CakePHP able to manage such type of structured data or should I
build the php code on my own?

Thanks a lot,
Gianni

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Multi-level form

2010-03-23 Thread Jeremy Burns
Yes, this is totally possible - see this section: 
http://book.cakephp.org/view/1031/Saving-Your-Data. The secret is in getting 
your $this-data array into the right shape, then using either saveAll or save 
each model at a time.

Jeremy Burns
jeremybu...@me.com
On 23 Mar 2010, at 18:13, Gianni Valenti wrote:

 Hi all,
 I tried to search among the past discussions and in the tutorials for
 sub-forms or multi-level forms but I didn't find any helpful post.
 
 I'm trying to decide whether to switch from my own php class set
 towards CakePHP framework and I would like to unserstand if CakePHP
 can help me building multi-level forms to insert datas in tables like
 the following ones:
 
 Companies (`id`, `name`, etc...)
 - CompanyPhoneNumbers (`id`, `company_id`, `number`, etc...)
 - CompanyEmailAddresses (`id`, `company_id`, `address`, etc...)
 - BankAccounts (`id`, `company_id`, etc...)
 - Contacts (`id`, `company_id`, `first_name`, `second_name`, etc...)
 - - ContactPhoneNumbers (`id`, `contact_id`, `number`, etc...)
 - - ContactEmailAddresses (`id`, `contact_id`, `address`, etc...)
 
 I need to build a single form - maybe with ajax tabbed subsections -
 to insert these data for each company.
 
 Is CakePHP able to manage such type of structured data or should I
 build the php code on my own?
 
 Thanks a lot,
 Gianni
 
 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.
 
 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
 
 To unsubscribe from this group, send email to 
 cake-php+unsubscribegooglegroups.com or reply to this email with the words 
 REMOVE ME as the subject.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Mod Rewrite?

2010-03-23 Thread Lucca Mordente
Despite this is not a Cake question:

Here you can find the Apache mod_rewrite documentation:
  http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html

Remember that Google is your best friend:
http://tinyurl.com/ylhr2pu

Lucca Mordente

On 23 mar, 09:48, thankyou gregbo...@gmail.com wrote:
 Hello,
 I have a website where both website.com/MyDirectory/xxx and
 website.com/mydirectory/xxx

 point to the same location. The only difference is the capitals.  To
 help optimize the website for SEO, I would want to do a 301 redirect
 from /MyDirectory/ to /mydirectory/

 Is this possible?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Data validation rule (between) never returns true

2010-03-23 Thread timstermatic
Hi all,

Here is part of a validate array I have in a model:

  'username' = array(

'loginRule-1'=array('rule'='alphaNumeric','message'='Username
must be alphanumeric - no spaces.' ),
'loginRule-2'=array('rule' = 
array('between',5,15),'message'
= 'Username must be between 5 and 15 characters.'),
),
'email' = array('rule' = 'email','required' = true),
'password' = array(

'passwordRule-1'=array('rule'='alphaNumeric','message'='Password
must be alphanumeric - no spaces.' ),
'passwordRule-2' = array('rule' = array('between', 5,
15),'message' = 'Password must be between 5 to 15 characters' )
)

The final rule in the array passwordRule-2 always fails and returns
the message Password must be between 5 to 15 characters..

Does anyone have any pointers as to why this is happening.

TIA

Tim

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Auth or Facebook login

2010-03-23 Thread Sergey Zarovski
Hey guys,
I have following trouble - I need to let users to login using their
facebook account, but these users are going to be admins. Site was
build using Cake and all stuff mainly works like this - user(admin)
logs and script catches id and uses it to show different content (site
is like multiuser-CMS, but have global admin). So I can`t change ids
to facebook ids.

I have facebook field in db relative to each user. So my idea as to
check when user logs using their facebook login if their facebook_id
exists in 'users' table and then if yes set user as logged and use id
that is relative for id.

I`m stuck on that. Any help will be appreciated.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Auth or Facebook login

2010-03-23 Thread Sergey Zarovski
So do we have ability to *set* users?
*
*
On Tue, Mar 23, 2010 at 2:58 PM, Sergey Zarovski zorro1...@gmail.comwrote:

 Hey guys,
 I have following trouble - I need to let users to login using their
 facebook account, but these users are going to be admins. Site was
 build using Cake and all stuff mainly works like this - user(admin)
 logs and script catches id and uses it to show different content (site
 is like multiuser-CMS, but have global admin). So I can`t change ids
 to facebook ids.

 I have facebook field in db relative to each user. So my idea as to
 check when user logs using their facebook login if their facebook_id
 exists in 'users' table and then if yes set user as logged and use id
 that is relative for id.

 I`m stuck on that. Any help will be appreciated.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Auth or Facebook login

2010-03-23 Thread nurvzy
I'm not 100% sure I know what you're asking.  You do or don't want
your facebook user's to be admins?  I'm assuming don't but your app is
forcing them into an admin role because you base who's admin and who
isn't off the user id?  Am I getting that right?

So short answer; yes, you can do whatever you want with CakePHP.  I
would first suggest not tying your admin roles to a specific user
id's.  Rather create an admin group that users belongTo.  That way
you'd be able to add/remove users/facebook-users as admins as you see
fit.

Shameless plug: if you're looking for a full featured Facebook plugin
(with Facebook connect), I've written one here;
http://www.webtechnick.com/blogs/view/229/CakePHP_Facebook_Plugin_Auth_Facebook_and_more

Hope That Helps,
Nick

On Mar 23, 12:58 pm, Sergey Zarovski zorro1...@gmail.com wrote:
 Hey guys,
 I have following trouble - I need to let users to login using their
 facebook account, but these users are going to be admins. Site was
 build using Cake and all stuff mainly works like this - user(admin)
 logs and script catches id and uses it to show different content (site
 is like multiuser-CMS, but have global admin). So I can`t change ids
 to facebook ids.

 I have facebook field in db relative to each user. So my idea as to
 check when user logs using their facebook login if their facebook_id
 exists in 'users' table and then if yes set user as logged and use id
 that is relative for id.

 I`m stuck on that. Any help will be appreciated.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


repeatedly call controller action through ajax

2010-03-23 Thread alex bailey
Hi guys,

I'm having a problem with my project where I could freak out about.
The situation is the following:

I have a controller foo which has an action bar.

Now the thing i want to get going: have the bar action running all the
time while your on the page by a fixed interval with a condition if a
certain entry is made in the database.

I got it to work by using ajax and the remoteTimer method. But now I
have the following problem:

I can't figure out how I can have a dynamic condition  like: Only
run the ajax event if a certain field in database is set to 0 or 1

I know I can control the execution by the condition param and using a
javascript If() (Like: 'condition' = '10 == 90' which will prevent it
from running) in there but is it possible to populate this condition
dynamically from the database or is there even a better way to handle
this whole situation?

Big thanks in advance.

Regards

Alex

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Dynamic Form Data

2010-03-23 Thread Ed Propsner
Okay, I managed to get things worked out. It's like anything else I suppose
... it just takes lots of experimenting, trial and error, and a whole lot of
getting used to before that little light comes on and things finally click.
Some things are finally making more sense to me now.

The documentation for Cake is a little vague in areas but that's nothing
new, it seems to be a common theme shared by anything actually worth using.
It gets better with time I suppose.

Thanks for the help. I'm sure I'll have plenty more questions as I try to
get situated with Cake.

On Tue, Mar 23, 2010 at 7:10 AM, Ed Propsner crotchf...@gmail.com wrote:

 I actually ended up creating a .js file to hold my functions and initiated
 my Ajax with 'onChange' = someFunction(); I pulled the field value into the
 script and passed that into the controller action as a named param. etc.
 etc. etc. (the entire process seemed a bit unnecessary and long-winded) The
 bottom line is that it worked (for the field that was NOT created
 dynamically). I repeated the process for the newly generated form field
 which in turn did not work. No matter what I try I just can't retrieve any
 data from form fields that get generated dynamically and thus the query
 fails.

 I'll take another wack at it using the suggestions you made and see how I
 make out.

 Yes, there are separate tables for country, state, and city. I believe I
 have the associations set up correctly but who knows, I've been managing to
 make a mess of everything else ;) Region and country are my foreign keys
 however they are RegionID and CountryID in the db ... I'll change them to
 region_id and country_id. The naming conventions in Cake take a little
 getting used to.

 On Tue, Mar 23, 2010 at 6:39 AM, WebbedIT p...@webbedit.co.uk wrote:

 To make things easier, lets strip this back to the core requirements
 then you can add in your specific formatting afterwards

 $form-input('User.country_id', array('empty' = '-- Select --'));
 echo $ajax-observeField('UserCountryId', array('url' =
 'countrySelect', 'update' = 'countryAction'));

 This should trigger an ajax call to /app/users/countrySelect which
 sets a $regions array and renders /app/view/users/country_select.ctp
 using the ajax layout (you've obviously managed to get this far).  /
 app/view/users/country_select.ctp view could look as simple as

 $form-input('User.region_id', array('empty' = '-- Select --'));
 echo $ajax-observeField('UserRegionId', array('url' =
 'regionSelect', 'update' = 'regionAction'));

 I have switched everything back to using cake's conventions, as it's
 much easier to learn cake that way.

 I imagine both the country and region fields are foreign_keys linking
 to tables containing the Countries and Regions which are in turn
 related to allow you to know which regions to show for which country
 etc.  All foreign keys should have _id after them and form-input will
 automagically look for a countries array if a field is called
 country_id and a regions array for the field region_id.

 HTH

 Paul.

 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

 To unsubscribe from this group, send email to cake-php+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.




Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Change __() default behavior

2010-03-23 Thread nurvzy
Hmmm.. Take a look at this:

http://www.php.net/manual/en/function.override-function.php

Maybe you could use that in your boostrap.php ;)

Nick

On Mar 23, 3:48 am, djogo djogopat...@gmail.com wrote:
 Hello

 I asked the same thing some time ago, in this thread (couldn't find
 googlegroups link, sorry)

 http://www.mail-archive.com/cake-php@googlegroups.com/msg79031.html

 Somebody said it was in the developer's plans, but still...

 I thought about creating ___(), but it's a lot of keystrokes. Also,
 I'm not sure whether the string extraction script would work that way,
 and that's one of the good things about _() or __().

 Is it possible to undefine __() [ or maybe _() ] and redefine it in
 boostrap.php (pun intended) ? I think it would be better.

 On Mar 23, 12:52 am, xtraorange xtraora...@gmail.com wrote:



  Thanks!  :)

  (I liked boostrap.php better, but I followed what you were
  saying.  :P)

  On Mar 22, 10:23 pm, nurvzy nur...@gmail.com wrote:

   Whops... boostrap.php = bootstrap.php

   Just incase you were confused. lol

   Nick

   On Mar 22, 9:21 pm, nurvzy nur...@gmail.com wrote:

Put it in app/config/boostrap.php

You'll have access to it throughout your app.
Nick

On Mar 22, 8:06 pm, xtraorange xtraora...@gmail.com wrote:

 That's actually exactly what I was just thinking of doing, lol.
 Thanks!

 The only thing I can't find... where am I supposed to place a function
 that I want available both on the control and view levels?

 On Mar 22, 8:59 pm, Gonzalo Servat gser...@gmail.com wrote:

  On Tue, Mar 23, 2010 at 12:44 PM, xtraorange xtraora...@gmail.com 
  wrote:
   Howdy all,

   This should be a quick one:
   Is there any way, without editing the cake core (so that upgrades 
   are
   easy), to switch the default behavior of __() from by default 
   echoing,
   to by default returning?  I find that 99% of the time, I don't 
   want it
   to echo, and it's annoying to add the true parameter in there 
   every
   single time.

  What about creating a new function like ___() that calls __() with 
  the true
  parameter?

  Regards
  Gonzalo

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


What's __() function?

2010-03-23 Thread saidbakr
Hello,
This is an example:
[CODE]
$this-Session-setFlash(__('Post is not found.', true));
[/CODE]

What is the function __(), where I got its documentation and of course
what is the difference between writing the previous code without __()
function such as:

[CODE]
$this-Session-setFlash('Post is not found.');
[/CODE]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: What's __() function?

2010-03-23 Thread Miles J
__() is used for translation. It matches a slug with the correct mo/po
file within the correct language/region.

Its for localization.

On Mar 23, 5:11 pm, saidbakr said@gmail.com wrote:
 Hello,
 This is an example:
 [CODE]
 $this-Session-setFlash(__('Post is not found.', true));
 [/CODE]

 What is the function __(), where I got its documentation and of course
 what is the difference between writing the previous code without __()
 function such as:

 [CODE]
 $this-Session-setFlash('Post is not found.');
 [/CODE]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: What's __() function?

2010-03-23 Thread saidbakr
Well,
So, What is about the true parameter?

On Mar 24, 2:30 am, Miles J mileswjohn...@gmail.com wrote:
 __() is used for translation. It matches a slug with the correct mo/po
 file within the correct language/region.

 Its for localization.

 On Mar 23, 5:11 pm, saidbakr said@gmail.com wrote:

  Hello,
  This is an example:
  [CODE]
  $this-Session-setFlash(__('Post is not found.', true));
  [/CODE]

  What is the function __(), where I got its documentation and of course
  what is the difference between writing the previous code without __()
  function such as:

  [CODE]
  $this-Session-setFlash('Post is not found.');
  [/CODE]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: What's __() function?

2010-03-23 Thread cricket
On Mar 23, 8:50 pm, saidbakr said@gmail.com wrote:
 Well,
 So, What is about the true parameter?

The true parameter is an example of the Cake devs once again making
the wrong decision about default function parameter values. IMHO, of
course.

More specifically, the function will return either the translated
string or echo it. See basics.php.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: What's __() function?

2010-03-23 Thread nurvzy
I happen to agree that __() shouldn't echo by default.  In fact, I'd
argue it shouldn't echo at all.

Taking a queue from CakePHP1.3 The SessionHelper no longer auto echos
(it was the only Helper that echo'd its results).  I think that's a
good philosophy to follow going forward.

However I disagree that CakePHP devs make the wrong decision about
default parameters.  Other than this, I can't think of any other
default parameter I don't normally use more often than not; that's a
pretty good default decision rate in my book. =)

Nick
On Mar 23, 7:54 pm, cricket zijn.digi...@gmail.com wrote:
 On Mar 23, 8:50 pm, saidbakr said@gmail.com wrote:

  Well,
  So, What is about the true parameter?

 The true parameter is an example of the Cake devs once again making
 the wrong decision about default function parameter values. IMHO, of
 course.

 More specifically, the function will return either the translated
 string or echo it. See basics.php.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Ckeditor + CkFinder How to

2010-03-23 Thread #2Will
Hi Rafael

Ive done something similar with corefive's  open source filemanager.

http://www.asecondsystem.com/2009/09/14/integrating-ck-editor-with-cakephp/
http://www.asecondsystem.com/2010/01/19/integrating-a-file-browser-into-ckeditor-cakephp/

It all worked out quite simple once the pieces have been put
together.

Will



On Mar 23, 2:54 pm, Rafael Gomes rafaelgomes@gmail.com wrote:
 Well guys,

 I was trying many hours how to configure this two apps on cake.

 Let's my explanation.

 If don't you know about then go to 
 :http://ckeditor.com/andhttp://ckfinder.com/

 Let's go.

 1 - First you have to download the ckeditor and ckfinder.

 2 - Unzip then on webroot

 like this:

 webroot
     = js
     = ckfinder
     = ckeditor

 3 - go to your controller that you wanna activate and write on the
 class, out of the method.
 var $helpers = array('Html', 'Form', 'Javascript');  -  this enables
 the helpers

 4 - If you put on the webroot, just past this on your view and you
 have to name an id of a textare to 'editor';

 ?php $javascript-codeBlock(window.onload = function()
 {
         CKEDITOR.replace( 'editor',
         {
                 filebrowserBrowseUrl : 
 '.$html-url('/ckfinder/ckfinder.html').',
                 filebrowserImageBrowseUrl : 
 '.$html-url('/ckfinder/ckfinder.html?
 type=Images').',
                 filebrowserFlashBrowseUrl : 
 '.$html-url('/ckfinder/ckfinder.html?
 type=Flash').',
                 filebrowserUploadUrl : 
 '.$html-url('/ckfinder/core/connector/php/
 connector.php?command=QuickUploadtype=FilescurrentFolder=/upload/
 image/').',
                 filebrowserImageUploadUrl : 
 '.$html-url('/ckfinder/core/connector/
 php/connector.php?command=QuickUploadtype=ImagescurrentFolder=/
 upload/flash/').',
                 filebrowserFlashUploadUrl : 
 '.$html-url('/ckfinder/core/connector/
 php/connector.php?command=QuickUploadtype=Flash').',
                 filebrowserWindowWidth : '1000',
                 filebrowserWindowHeight : '700'
         }
         );

 }, array('inline' = false)); ?

 This will activate you ckeditor and almost ckfinder.

 but you have to put the textare like I said. something like this.
 ?php echo $form-input('Model.field', array('type' = 'textarea',
 'id' = 'editor', 'label' = 'Tex:br /', 'value' = '')); ?

 5 - put this on your config.php inside the ckdinder directory ---
 this break the security
 function CheckAuthentication()
 {
          return true;

 }

 If anyone have the right way to do that, please send. But this works.

 6 - modify your urlBase on your config.php on your ckfinder directory
 $baseUrl = '/website/app/webroot/upload/';
 This set the directory of upload to webroot

 Make sure that you have permission on the directory.

 That's it ... any doubts just ask :)

 I'm learning too...and this was hard to me..

 Ahhh.. sorry about my english :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Helpers

2010-03-23 Thread Ed Propsner
Can someone get me straightened out with helpers?

I created a new file called Button.php and placed it in views\helpers.

class ButtonHelper extends AppHelper
{

function makeButton($button_stuff)
{
return $this-output( // make button code );
}

}
 ---

 users_controller.php

var $helpers = array('Button');

-

 /users/register

echo makeButton( button stuff );


I keep getting the error for undefined function makeButton() on page
/users/register.

I had it all working just fine until I tried to add an additional helper and
then I started getting the errors.

I've since removed all traces of the old helper but the errors still
persist.

It seemed pretty cut and dry but I'm obviously not doing something right.

I tried it in app_controller as well but it didn't work. What defines what
goes in app_controller and what goes elsewhere?
Helpers in app_controller are able to be used in other controller without
having to call them individually into that controller ??

- ED

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Data validation rule (between) never returns true

2010-03-23 Thread Dr. Loboto
If you use Auth password field is already hashed so it's length more
then 15 symbols.

On Mar 24, 1:39 am, timstermatic timsterma...@gmail.com wrote:
 Hi all,

 Here is part of a validate array I have in a model:

               'username' = array(
                     
 'loginRule-1'=array('rule'='alphaNumeric','message'='Username
 must be alphanumeric - no spaces.' ),
                     'loginRule-2'=array('rule' = 
 array('between',5,15),'message'
 = 'Username must be between 5 and 15 characters.'),
                 ),
                 'email' = array('rule' = 'email','required' = true),
                 'password' = array(
                         
 'passwordRule-1'=array('rule'='alphaNumeric','message'='Password
 must be alphanumeric - no spaces.' ),
                         'passwordRule-2' = array('rule' = array('between', 
 5,
 15),'message' = 'Password must be between 5 to 15 characters' )
                 )

 The final rule in the array passwordRule-2 always fails and returns
 the message Password must be between 5 to 15 characters..

 Does anyone have any pointers as to why this is happening.

 TIA

 Tim

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


try/catch action

2010-03-23 Thread Josh
Hello

I would like to somehow apply a try catch statement to all Actions as
a backstop for any uncaught exceptions.

I think this would be particularly helpful for Ajax Actions, because
the catch statement could send back a default 4xx status code.
Prototype's onFailure() function could then do the client-side error
handling.

How can I do this without wrapping the Action call with a try/catch in
the cake dispatcher ($controller-dispatchMethod($params['action'],
$params['pass']);)

Does anybody have a suggestion or another workable strategy for
gaining this functionality?

Josh

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Helpers

2010-03-23 Thread nurvzy
$button-makeButton(); not just make makeButton();

Nick

On Mar 23, 9:49 pm, Ed Propsner crotchf...@gmail.com wrote:
 Can someone get me straightened out with helpers?

 I created a new file called Button.php and placed it in views\helpers.

 class ButtonHelper extends AppHelper
 {

 function makeButton($button_stuff)
 {
 return $this-output( // make button code );

 }
 }

      ---

  users_controller.php

 var $helpers = array('Button');

     -

  /users/register

 echo makeButton( button stuff );

 I keep getting the error for undefined function makeButton() on page
 /users/register.

 I had it all working just fine until I tried to add an additional helper and
 then I started getting the errors.

 I've since removed all traces of the old helper but the errors still
 persist.

 It seemed pretty cut and dry but I'm obviously not doing something right.

 I tried it in app_controller as well but it didn't work. What defines what
 goes in app_controller and what goes elsewhere?
 Helpers in app_controller are able to be used in other controller without
 having to call them individually into that controller ??

 - ED

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Helpers

2010-03-23 Thread Ed Propsner
I knew I was screwing something up ;) Boy, this is going to be a long road.

Thank you.

Ed

On Wed, Mar 24, 2010 at 1:13 AM, nurvzy nur...@gmail.com wrote:

 $button-makeButton(); not just make makeButton();

 Nick

 On Mar 23, 9:49 pm, Ed Propsner crotchf...@gmail.com wrote:
  Can someone get me straightened out with helpers?
 
  I created a new file called Button.php and placed it in views\helpers.
 
  class ButtonHelper extends AppHelper
  {
 
  function makeButton($button_stuff)
  {
  return $this-output( // make button code );
 
  }
  }
 
   ---
 
   users_controller.php
 
  var $helpers = array('Button');
 
  -
 
   /users/register
 
  echo makeButton( button stuff );
 
  I keep getting the error for undefined function makeButton() on page
  /users/register.
 
  I had it all working just fine until I tried to add an additional helper
 and
  then I started getting the errors.
 
  I've since removed all traces of the old helper but the errors still
  persist.
 
  It seemed pretty cut and dry but I'm obviously not doing something right.
 
  I tried it in app_controller as well but it didn't work. What defines
 what
  goes in app_controller and what goes elsewhere?
  Helpers in app_controller are able to be used in other controller without
  having to call them individually into that controller ??
 
  - ED

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

 To unsubscribe from this group, send email to cake-php+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.