Re: How to $model-find for any controller

2009-10-02 Thread DatacenterHellas
First of all I like to thank all of you for your responses ! ! ! ! :) Finaly I used the requestAction and it is perfect for my solution :) Kind Regards Merianos Nikos --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Access Classes In Layout Help??

2009-10-02 Thread Bert Van den Brande
Well, you should test it out, but from what I can see in the source code the controller's view is rendered first and then passed on to the layout $content_for_layout. During this process it merges $this-viewVars , so I would presume that every information you made available for the controller's

Re: How to $model-find for any controller

2009-10-02 Thread Bert Van den Brande
Glad to help. Just beware of the fact that requestAction adds some performance penalty to the rendering time, especially when used multiple times in a view ... On Fri, Oct 2, 2009 at 8:06 AM, DatacenterHellas merianosni...@gmail.comwrote: First of all I like to thank all of you for your

Can I control the order in which Behaviors run?

2009-10-02 Thread Wrk2bike
Hi geniuses, Is there a way to control the order in which Behaviors run? I am using the Tree behavior, and I am writing a custom behavior that takes certain actions depending on the Tree structure. I'd like to run my behavior after Tree has completed, so I can handle any new Tree structure.

Quicktime screen cast not working for me... Anybody have it in another form?

2009-10-02 Thread mumbojumbo
I tried it on all browsers and It just comes up with a screen with the CakePHP logo and doesn't do anything else.I'm specifically trying to watch the one on Baking as to further understand this concept. The link is below: http://cakephp.org/screencasts/view/6

Help with Multiple Models + Single View required

2009-10-02 Thread ashok.b
Hi everyone, I'm new to this group and to cakephp. I'm enjoying writing code with cakephp, and most of times I'm getting help from the bakery, community and googling. But am at a roadblock now, and seems like I can't find what I am looking for. My problem is as follows: Table1: tbl_messages id -

Re: Geocoding, Distance, Paginate...

2009-10-02 Thread AD7six
On 2 oct, 01:16, Andras Kende and...@kende.com wrote: Basically just overwrite paginate function, something like: http://book.cakephp.org/view/249/Custom-Query-Pagination Why is that thought to be necessary. paginate and find all have slightly different usage but the same paramters.

Re: Can I control the order in which Behaviors run?

2009-10-02 Thread AD7six
On 1 oct, 18:20, Wrk2bike seankelleyp...@gmail.com wrote: Hi geniuses, Is there a way to control the order in which Behaviors run?  I am using the Tree behavior, and I am writing a custom behavior that takes certain actions depending on the Tree structure. I'd like to run my behavior after

Re: AD7six's MiMedia plugin

2009-10-02 Thread AD7six
On 1 oct, 07:03, Clare little.miss.miracle.g...@gmail.com wrote: Hi, I'm trying to use AD7six's MiMedia plugin that I found here:http://www.assembla.com/wiki/show/mifor uploading images. Does anyone know how to use it or where I can find documentation? Thanks, Claire MiMedia isn't

Re: Geocoding, Distance, Paginate...

2009-10-02 Thread AD7six
On 2 oct, 09:17, AD7six andydawso...@gmail.com wrote: On 2 oct, 01:16, Andras Kende and...@kende.com wrote: Basically just overwrite paginate function, something like: http://book.cakephp.org/view/249/Custom-Query-Pagination Why is that thought to be necessary. paginate and find all

Re: Password field is automatically hashed, how to change this?

2009-10-02 Thread Mukhamad Ikhsan
and how to set new name a form field but different with database fieldname, but still mapping automatically? in my case, password is a field on users table, if i change the code in view $this-input('passwordkey'); that form field is not mapping with password field on users table, how to still

Re: Access Classes In Layout Help??

2009-10-02 Thread hahmadi82
I'm not sure I follow. How do I pass the information into the layout file? Miles J wrote: Just put ?php echo $content_for_layout; ? in your layout file, and then Cake will render your controllers view within that variables location. On Oct 1, 3:05 pm, hahmadi82 hahmad...@gmail.com

Re: How use ACL in a particular situation

2009-10-02 Thread Stinkbug
Users belonging to multiple groups is a pretty common question. There are already some good discussions on how to do it. Here is one where I give my take on how we did it. http://groups.google.com/group/cake-php/browse_thread/thread/b3b646023e97c1f3/5a2d623896424a56?hl=enlnk=st On Sep 29,

paginator, containable - what $key for sort()

2009-10-02 Thread Melanie Sommer
Hello, I am using containable behaviour in paginate() in my controller namend E. In my view I can use sort('title of cell in table E') to sort the results. But I did not find a way to sort by any fields not belonging to table E. I tried sort('D.cell name') - but the syntax seems to be wrong.

Re: neighbors sort

2009-10-02 Thread Jon Bennett
I think I'll have to write my own function as well. kind of put this on the back burner for now and will come back to it once I've finished coding the rest of the app. Thanks for the reply. I struggled with this, but solved it, after re-reading the API/docs. Have a look at

Re: Access Classes In Layout Help??

2009-10-02 Thread Bert Van den Brande
Calling $this-set('someInformation', 'someValue') in the controller will make the var $someInformation available in both the view and the layout ... I think :) On Fri, Oct 2, 2009 at 10:08 AM, hahmadi82 hahmad...@gmail.com wrote: I'm not sure I follow. How do I pass the information into the

Re: Password field is automatically hashed, how to change this?

2009-10-02 Thread Bert Van den Brande
Automatic mapping will not be possible. You need to copy for example 'password1' to 'password' in the model data before saving it. (Don't forget to hash it using Auth) On Fri, Oct 2, 2009 at 9:50 AM, Mukhamad Ikhsan ikhsan.o...@gmail.comwrote: and how to set new name a form field but

Re: Help with Multiple Models + Single View required

2009-10-02 Thread Bert Van den Brande
My idea is ... that's a lot of text ! Ok j/k, what exactly are you asking for ? On Thu, Oct 1, 2009 at 9:28 PM, ashok.b email2...@gmail.com wrote: Hi everyone, I'm new to this group and to cakephp. I'm enjoying writing code with cakephp, and most of times I'm getting help from the bakery,

db connection pooling

2009-10-02 Thread Houcem Berrayana
Hi bakers, I was looking for a solution that could help me to make persistent connection to mysql database. When googling I found that it's possible to make persistent connections (pooling) by using mysql_pconnect(). I was thinking that cakephp will use this function when setting 'persistent' =

Re: Javascript libraries with images/css inside Cake Plugins

2009-10-02 Thread womble
I'm pretty sure its not the 'prefacing' etc. But I may be wrong. I basically had the same problem with ext-js. I didn't ever find a good solution. But there has to be somewhere to change the Cake settings. My problem was that the library css was referencing relative urls of images, but the

Re: Auth component loop redirect

2009-10-02 Thread mathaios
Brian you nailed it...I was having a small navigation element in the layout thank you! On 1 Ott, 17:57, brian bally.z...@gmail.com wrote: Do you have an requestAction() code? If so, try adding this in AppController::beforeFilter() if (isset($this-params['requested']))

Re: paginator, containable - what $key for sort()

2009-10-02 Thread brian
On Fri, Oct 2, 2009 at 5:49 AM, Melanie Sommer melanie-som...@mailinator.com wrote: Hello, I am using containable behaviour in paginate() in my controller namend E. In my view I can use sort('title of cell in table E') to sort the results. But I did not find a way to sort by any fields

Re: Auth component loop redirect

2009-10-02 Thread brian
On Fri, Oct 2, 2009 at 9:36 AM, mathaios mathaio...@gmail.com wrote: Brian you nailed it...I was having a small navigation element in the layout thank you! Yeah, that one was driving me nuts once. I was so happy to find that post! --~--~-~--~~~---~--~~ You

Re: Geocoding, Distance, Paginate...

2009-10-02 Thread Mariano Iglesias
You may want to try: http://github.com/mariano/geocode Includes stuff like: $this-Address-find('near', array('distance' = 5)); AD7six wrote: On 2 oct, 01:16, Andras Kende and...@kende.com wrote: Basically just overwrite paginate function, something like:

Re: Where request comes from?

2009-10-02 Thread Martin Westin
You CAN... but it is painful to say the least. Since you can't have your cake and eat it ;) your best bet is to look inside the Security Component to see what parts you want to use and then put that into your own component, extend the core component or something like that. You can also look at

Re: cakePHP with FatCow hosting provider - mod_rewrite issue?

2009-10-02 Thread Matias_castro
Hi, I had exactly the same problem. I asked my hosting provider if I could load the module (rewrite_module) but he told me that it wasn't possible. I read the blog tutorial section 10.1.5 and there it said: If you don't want or can't get mod_rewrite (or some other compatible module) up and

Re: paginator, containable - what $key for sort()

2009-10-02 Thread Melanie Sommer
Hello Brian, $paginator-sort('text in link', 'D.cell name', array('title' = 'title attribute of link')) this works - but only for models which are directly related to the actual model. Cakephp does not recognize Models which belong to a Model that belongs to the actual model (A belongsTo C, C

Validator message not showing

2009-10-02 Thread Cristian Cassina
Hi everyone, I'm dealing with a little problem that I can't simply get rid of. I have these validation rules in the required model: var $validate = array( 'name' = array( 'rule' = 'notEmpty', 'message' = 'Il campo codice non può essere

Re: Where request comes from?

2009-10-02 Thread Miles J
Well you can use my ajax handler, it wraps the security component so it works with AJAX calls. http://www.milesj.me/resources/script/ajax-handler-component On Oct 2, 7:12 am, Martin Westin martin.westin...@gmail.com wrote: You CAN... but it is painful to say the least. Since you can't have

Re: Password field is automatically hashed, how to change this?

2009-10-02 Thread Miles J
Just do this in your action, before you do a save. $this-data['User']['password'] = $this-Auth-password($this-data ['User']['passwordkey']); On Oct 2, 12:50 am, Mukhamad Ikhsan ikhsan.o...@gmail.com wrote: and how to set new name a form field but different with database fieldname, but still

Re: Access Classes In Layout Help??

2009-10-02 Thread Miles J
Perhaps you should read the documentation before proceeding any further. http://book.cakephp.org/view/57/Controller-Methods On Oct 2, 4:11 am, Bert Van den Brande cyr...@gmail.com wrote: Calling $this-set('someInformation', 'someValue') in the controller will make the var $someInformation

locking down components under Apache

2009-10-02 Thread llyn.g...@gmail.com
It's easy to lock down an entire cake application by specifying a AuthUserFile for the directory that contains the .htaccess for your cake application. But, I'd like to lock down a particular component (particularly all it's views). Any attempt to lock it down either by adding an .htaccess file

How to do ...

2009-10-02 Thread Veoempleo
Hi, I'd like to have a personal link for everyuser, for example: http://mysite.com/presentation/user_xx How Could I do that? Do I have to create presentation controller? params doesn't catch user_xx whitout : symbol, how Could I get user_xx from controller? Thank you very much

Re: How to do ...

2009-10-02 Thread robust solution
Dear Veoempleo, All you have to do is to define a custom routes in the routes.php file in the app/config folder but be aware so that this new custom route dosent overwite any of the the 7 default routes of the core and the custom routes that are already in the routes.php file I recommend you to

Re: locking down components under Apache

2009-10-02 Thread zaboo
Checkout the security component. http://api.cakephp.org/class/security-component#method-SecurityComponentrequireLogin Htpasswd/htaccess will not work normally due to the mod_rewrites On Oct 2, 11:36 am, llyn.g...@gmail.com llyn.g...@gmail.com wrote: It's easy to lock down an entire cake

Re: Access Classes In Layout Help??

2009-10-02 Thread hahmadi82
My issue with the cake site is it never gives a thorough description on anything. It's why I'm always on nabble asking silly questions :P From what I read from the link you provided, it seems I need to do something with the $this-render function. The set variables I've already defined do not

Re: Access Classes In Layout Help??

2009-10-02 Thread Miles J
No yours till doing it wrong. You do not need to call render() unless you want to call a different .ctp file that does not associate with the current action. To set/pass data to the view just use the set() method. $this-set('v', $var); Then in your view just use it: echo $v;

Still sort array help

2009-10-02 Thread Dave Maharaj :: WidePixels.com
No matter what i try I still cant sort an array. $merged = array_merge ($new_skills, $selected); debug($merged); Array ( [0] = Tree [1] = Zoo [2] = Hello [3] = Test [4] = Cool [5] = 3 Doors Down [6] = Yellow ) $sorted = natcasesort($merged);

Re: Access Classes In Layout Help??

2009-10-02 Thread hahmadi82
I'm not talking about passing variables to the view for that controller. All my views are set up perfectly for every controller. For my cars class I have a car controller and a views/cars/index.ctp etc which utilizes all the set variables from car_controller.php actions. This is not an

RE: Where request comes from?

2009-10-02 Thread Dave Maharaj :: WidePixels.com
Cool will def check it out. I cant use the security component with AJAX calls if I read the docs correct. But with your component I can include the security component and it will play nice with AJAX? Add the tokens and so on to the forms? Dave -Original Message- From: Miles J

learning by example: twitter?

2009-10-02 Thread Christian
I have a form on my site, that after it submits.. I want to sends off some data to some model, but stay on the page and reveals a new div/ form below. Without an entire page refresh if possible. I compare this to something like the twitter main page when you're logged in. You write up a post,

Re: Access Classes In Layout Help??

2009-10-02 Thread Miles J
Thats what layouts are far. They are the wrappers/containers of all your views. The layouts should include the headers/footers or your HTML as well as the HTML html, head and body tags. Your view should be generated within the body of your layout. Any data passed to the view will be accessible

Re: learning by example: twitter?

2009-10-02 Thread Miles J
You would use AJAX. AJAX sends requests to the server and the server responds back with data, without having to refresh the page. So you would set up your AJAX to request data from a controller/action and the action will respond back with the data. Once the data is received, you can then have it

Re: Still sort array help

2009-10-02 Thread brian
natcasesort() returns a boolean, not an array. debug(natcasesort($merged)); On Fri, Oct 2, 2009 at 6:07 PM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: No matter what i try I still cant sort an array. $merged = array_merge ($new_skills, $selected);    debug($merged); Array

Re: learning by example: twitter?

2009-10-02 Thread brian
If you're using jQuery, have a look at the form plugin. It'll allow you to painlessly have a form submit through an AJAX call. Ad you can set up a callback function to take care of changing the display, handling data sent back from the server, etc. But, if you're brand new to Cake (or jQuery)

RE: Still sort array help

2009-10-02 Thread Dave Maharaj :: WidePixels.com
Got it! Thanks. Dave -Original Message- From: brian [mailto:bally.z...@gmail.com] Sent: October-02-09 10:27 PM To: cake-php@googlegroups.com Subject: Re: Still sort array help natcasesort() returns a boolean, not an array. debug(natcasesort($merged)); On Fri, Oct 2, 2009 at 6:07

Re: Access Classes In Layout Help??

2009-10-02 Thread hahmadi82
Ok so I actually didn't create a layout for each view from my controllers. Instead, all the views use the same layout, which is the default.ctp. Is that incorrect? From my understanding, the default layout is loaded by every view and that's why I have my navigation bar in it. It seems that I

Using a page outside of CakePHP

2009-10-02 Thread Josh K
Is it possible to use a page outside of a CakePHP application? All but two pages of my Cake app require authentication. I have two public forms that submit data to the application. Is it possible to do an include of these pages outside of the application elsewhere on my server? If so, are there

Re: Using a page outside of CakePHP

2009-10-02 Thread Gonzalo Servat
On Sat, Oct 3, 2009 at 1:01 PM, Josh K joshkrae...@gmail.com wrote: Is it possible to use a page outside of a CakePHP application? All but two pages of my Cake app require authentication. I have two public forms that submit data to the application. You could stick the pages in your

Re: Access Classes In Layout Help??

2009-10-02 Thread brian
On Fri, Oct 2, 2009 at 10:55 PM, hahmadi82 hahmad...@gmail.com wrote: Ok so I actually didn't create a layout for each view from my controllers. Instead, all the views use the same layout, which is the default.ctp. Is that incorrect? From my understanding, the default layout is loaded by

Re: Using a page outside of CakePHP

2009-10-02 Thread brian
On Fri, Oct 2, 2009 at 11:09 PM, Gonzalo Servat gser...@gmail.com wrote: On Sat, Oct 3, 2009 at 1:01 PM, Josh K joshkrae...@gmail.com wrote: Is it possible to use a page outside of a CakePHP application? All but two pages of my Cake app require authentication. I have two public forms that