Re: Darkauth failing on 1.2 RC1

2008-06-20 Thread uniacid
Well I'm trying Darkauth on an apache server now but having another issue under the newest nightly 1.2 Cake Warning (2): Cannot modify header information - headers already sent by (output started at cake\app\controllers\users_controller.php:1) [CORE\cake\libs\controller\controller.php, line 576]

Business logic in Controller or Model.

2008-06-20 Thread AhmadShahzad
Hello, Can anybody tell me that where should i put my business logic. In model or controller? What are the advantages and disadvantages of putting business logic in controller? Likewise what about putting business logic in models? What is the best practice? -- View this message in

inserting more layers into cake php

2008-06-20 Thread SajjadRaza
Hi i am novice to php and cake i have shifted from java and now in fix about lkayer distribution wher i ahev to put my businaess logic the suggested place is controller but by this my contrller becomes large can i put my logic in the model or some where else in the i want to work in the following

other example than the blog tutorial on the PHPCake site

2008-06-20 Thread SajjadRaza
can any one please tell me about any other large application tutorial other than blog tutorials example thanks zaidi --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send

Re: email headers visible in content of message?

2008-06-20 Thread Marcin Domanski
Hey, Can't really help but i wanted to note that i created a SwiftEmailComponent that is srop-in replacement for EmailComponent (extends it). It should work (works here;) with the existing code. It support different authorization methods (tls, ssl) and is faster than the build in one (at least

Re: other example than the blog tutorial on the PHPCake site

2008-06-20 Thread uniacid
There is a nice organized list here: http://www.pseudocoder.com/archives/2008/02/10/cakephp-tutorials/ Soon enough I'll put up my own blog with more resources, happy baking! On Jun 20, 1:50 am, SajjadRaza [EMAIL PROTECTED] wrote: can any one please tell me about any other large application

simple noob problem with database fetching

2008-06-20 Thread Turnquist, Jonah
Ok, I have a scripts table, a categories table and a users table. The scripts table $belongsTo = array('Category', 'User'); The categories table $hasMany = array('Script'); I have not made a modal or page for the users yet. I have a index page for the categories. This page shows all of the

Re: HABTM on multiple DB

2008-06-20 Thread [EMAIL PROTECTED]
The problem is a little more complex. My problem is like :http://groups.google.com/group/cake-php/ browse_thread/thread/b542cf436cc8622f/6e6857aa813dc601? lnk=gstq=querying+useDBconfig#6e6857aa813dc601 I try the solution of Grant Cox but I get the same error. I get error when Cake try to define

Re: database question

2008-06-20 Thread dr. Hannibal Lecter
What kind of app are we talking about here? If possible, you might as well allow the double file UUID but have your own regular UUID, so when someone searches for a file, you just give 'em both files (with additional details, like the size, time of upload etc.) and let them decide which one they

Re: Strange 404 Error

2008-06-20 Thread Abhimanyu Grover
Debug is already 2, and it seems like Cake is not even getting triggered. I think I'll check my apache's security settings now. On Jun 19, 10:08 pm, b logica [EMAIL PROTECTED] wrote: I think it's likely that there's an error somewhere. Try setting debug to 2. When it's set to 0 you'll get 404s

Re: how do I handle foreign keys??

2008-06-20 Thread dr. Hannibal Lecter
Try using $form-select('Entry.category_id', ...) http://manual.cakephp.org/view/182/form http://api.cakephp.org/class_form_helper.html#5171e675468c9665db0653c165b6c89c Any if you get stuck, read this one too:

Re: simple noob problem with database fetching

2008-06-20 Thread dr. Hannibal Lecter
$this-set('categories', $this-Category-find('all', array('recursive' = -1))); That should do it. ;-) http://api.cakephp.org/class_model.html#e60758f27fa8486a063b8cc424bad741 Always check the API and/or The Cookbook before asking here, it will make your development a lot faster an less painful.

Re: how do I handle foreign keys??

2008-06-20 Thread David C. Zentgraf
Make sure your associations aren't backwards. Read http://book.cakephp.org/view/66/models#associations-78 , compare foreignKey for hasOne and belongsTo. On 20 Jun 2008, at 09:34, Turnquist, Jonah wrote: I have a 'entries' table and a 'categories' table. I am creating an 'add' page to add a

Re: simple noob problem with database fetching

2008-06-20 Thread Turnquist, Jonah
It worked. But why? I did check the api, and it said this should do it: $this-set('categories', $this-Category-find('all', array(), null, -1)); The definition: Model::find ( $conditions = null, $ fields = array(), $ order = null,

Re: Help with changing a little piece of markup

2008-06-20 Thread gbk *
model: 'author_name' = array( 'required' = array( 'rule' = 'validateNotEmpty' ) ), view: ?php echo $form-error('author_name', array('required'=__('validation_required', true))) ? gbk On jún. 19, 20:03, Vlad [EMAIL PROTECTED] wrote: Thank you. Worked like a

Re: Business logic in Controller or Model.

2008-06-20 Thread the_woodsman
9 out of 10 times, the answer is in the Model - it's more reusable, easier to (Unit) test, and (imho) makes the controller code a lot simpler and clearer. Look up fat models, skinny controllers for more info... On Jun 20, 6:35 am, AhmadShahzad [EMAIL PROTECTED] wrote: Hello, Can

Re: Missing database table

2008-06-20 Thread leo
I guess if bake doesn't work, Cake can't see the tables. Make sure they are defined in the same database as users (!) Check your database config file in app/config - make sure that the stated user has access to the tables. Make sure that the model filenames are correct and correctly located

Re: 2 Applications shared/seperate databases.

2008-06-20 Thread Siebren Bakker
I've figured it out now. Instead of using $useDbConfig, I decided to use var $tablePrefix = 'beta_'; This way, I can pick and choose exactly which tables I keep, and which I separate. Upon doing this though, cake insisted that my beta_updates table did not exist, when it clearly did. To fix this

Re: inserting more layers into cake php

2008-06-20 Thread Siebren Bakker
Pretty much all of the business logic for a cake application is supposed to take place in the controller, as this is how MVC frameworks are designed to work. This puts all of your logical code in one location, where it can easily be found and modified. I've found that when adding new functions

Re: Missing database table

2008-06-20 Thread Siebren Bakker
I ran into a similar problem, and found an interesting solution that took care of it right away. Clear out the contents of your /app/tmp/cache/models folder, and then try again and it should recognize your database tables if they exist. In the name of Life, Liberty, and the pursuit of my sanity.

Containable with Plugin Models

2008-06-20 Thread Kjell Bublitz
Hi all I've found a possible Bug with ContainableBehaviour using associated Plugin Models within a find operation. code $data = $this-find('first', array( 'fields' = 'User.name, User.created', 'conditions' = array('User.name' = $name), 'contain' = array(

Re: complex findAll()

2008-06-20 Thread Fahad
i think my question was not clear. sorry for confusing you. i dont want to order the fields - its about ordering the records. = table (this is what i have for example) id, name 1, john 2, james 3, anthony 4, ben 5, jonathan = now i want to get the results

Re: simple noob problem with database fetching

2008-06-20 Thread dr. Hannibal Lecter
There are two styles of using find() if you look at the description of Model-find(): 1. Where you use all the params: find(array('name' = 'Thomas Anderson'), array('name', 'email'), 'field3 DESC', 2); 2. Where you can basically use just the first two: find('all', array('conditions' =

Re: complex findAll()

2008-06-20 Thread Dr. Tarique Sani
On Fri, Jun 20, 2008 at 2:15 PM, Fahad [EMAIL PROTECTED] wrote: findAll(), the record with ID 1 and 2 will added after ID 5. === output (starting from ID 2) 3, anthony 4, ben 5, jonathan 1, john 2, james === #1 use two queries and array_merge the results #2 Do

Re: Missing database table

2008-06-20 Thread leo
On 20 Juny, 10:33, Siebren Bakker [EMAIL PROTECTED] wrote: I ran into a similar problem, and found an interesting solution that took care of it right away. Clear out the contents of your /app/tmp/cache/models folder, and then try again and it should recognize your database tables if they

Cache problem ?

2008-06-20 Thread Marc MENDEZ
Hi, I'm a newbie and I have started last week studying CakePHP with the 1.1 release. Yesterday, I upgraded my tests to 1.2 RC1 (the latest 1.2 available on the website). Up to this morning, I used view templates generated with the previous version of bake (but just corrected to work with

Re: Cache problem ?

2008-06-20 Thread gbk *
view cache files are generated into /app/tmp/cache/views. check out the folder, if it's not empty the cache is working... gbk On jún. 20, 12:01, Marc MENDEZ [EMAIL PROTECTED] wrote: Hi, I'm a newbie and I have started last week studying CakePHP with the 1.1 release. Yesterday, I upgraded

Re: simple noob problem with database fetching

2008-06-20 Thread Turnquist, Jonah
So how would I use the first case (for future reference)? Why did the one below not work? Isn't the one below the first case? $this-set('categories', $this-Category-find('all', array(), null, -1)); Thanks On Jun 20, 1:50 am, dr. Hannibal Lecter [EMAIL PROTECTED] wrote: There are two styles

Re: complex findAll()

2008-06-20 Thread grigri
How: $results = $this-User-find('all', array( 'order' = (User.id=$userId) DESC, User.id ASC )); Why: For $userId = 3: 3, 4, 5 : (User.id=$userId) is 1 1, 2 : (User.id=$userId) is 0 So 3,4 and 5 are first (themselves ordered by ID so they appear in that order) Then 1, 2 (again, ordered

Re: simple noob problem with database fetching

2008-06-20 Thread dr. Hannibal Lecter
No, because in the first case, the first param is not supposed to be 'all': As you already know, the first param is $conditions, so in the first case, $conditions should simply be null as you _don't have_ any conditions. There are some examples in the cookbook:

Re: complex findAll()

2008-06-20 Thread Dr. Tarique Sani
On Fri, Jun 20, 2008 at 5:04 PM, grigri [EMAIL PROTECTED] wrote: How: $results = $this-User-find('all', array( 'order' = (User.id=$userId) DESC, User.id ASC )); neat trick T -- = Cheesecake-Photoblog:

Re: Cache problem ?

2008-06-20 Thread Marc MENDEZ
Yes, there are files : in models and persistents, but nothing in the view folder. I deleted everything, but I still have the same view gbk * a écrit : view cache files are generated into /app/tmp/cache/views. check out the folder, if it's not empty the cache is working... gbk On jún. 20,

Re: Cache problem ?

2008-06-20 Thread Marc MENDEZ
I did a few tests : Any changes to index.ctp is ignored... Even worst : I renamed the view folder corresponding to the model : it's still working ! But, if I edit the index.thtml fo an other model, it works !!! The only one difference : - The old template was generated by the previous bake

Re: inserting more layers into cake php

2008-06-20 Thread RichardAtHome
The standard practice as I understand it is Fat Models, Skinny Controllers. Your business logic should go in the model. The basic rational is that if you include that logic in your model, then you can re-use it in any controller that uses that model... On Jun 20, 9:36 am, Siebren Bakker [EMAIL

Re: Cache problem ?

2008-06-20 Thread gbk *
my tip is that this is not a cache issue. are you sure you are editing the correct file? On jún. 20, 14:20, Marc MENDEZ [EMAIL PROTECTED] wrote: I did a few tests : Any changes to index.ctp is ignored... Even worst : I renamed the view folder corresponding to the model : it's still working !

Re: Cache problem ?

2008-06-20 Thread Marc MENDEZ
gbk * a écrit : my tip is that this is not a cache issue. are you sure you are editing the correct file? My table is named essais. The only one page on all my hard disk (I checked it !) dealing with this table and containg references to $paginator is in app/views/essais/index.ctp. If I

Re: Cache problem ?

2008-06-20 Thread Marc MENDEZ
Next test : I deleted app/views/essais and run bake again. I watched the folder and found, again the 4 views files in a new essais folder. So, now, I'm sure it's the right files and the right folder. I edit the index.ctp and guess what . nothing , still the same problem !

Re: inserting more layers into cake php

2008-06-20 Thread Dardo Sordi Bogado
The standard practice as I understand it is Fat Models, Skinny Controllers. Your business logic should go in the model. The basic rational is that if you include that logic in your model, then you can re-use it in any controller that uses that model... I can't think of a better way of

Re: Share Common Code

2008-06-20 Thread RichardAtHome
or add the functions to app/config/bootstrap.php On Jun 20, 1:34 am, Ian Zepp [EMAIL PROTECTED] wrote: Pass an object to view that has the methods you need. Ketan Patel wrote: I am baffled right now with a simple question. I want some specific functions to be available in the controllers

Re: Cache problem ?

2008-06-20 Thread gbk *
i have no idea... maybe there is something useful in your log files. have you checked them (webserver error log, php error log, /tmp/logs/error.log, debug.log)? gbk On jún. 20, 14:45, Marc MENDEZ [EMAIL PROTECTED] wrote: Next test : I deleted app/views/essais and run bake again. I watched

Re: Cache problem ?

2008-06-20 Thread Chris Hartjes
On Fri, Jun 20, 2008 at 8:45 AM, Marc MENDEZ [EMAIL PROTECTED] wrote: Next test : I deleted app/views/essais and run bake again. I watched the folder and found, again the 4 views files in a new essais folder. So, now, I'm sure it's the right files and the right folder. I edit the index.ctp

Re: Cache problem ?

2008-06-20 Thread Dardo Sordi Bogado
Can you paste the controller code at http://bin.cakephp.org ? On Fri, Jun 20, 2008 at 10:05 AM, Chris Hartjes [EMAIL PROTECTED] wrote: On Fri, Jun 20, 2008 at 8:45 AM, Marc MENDEZ [EMAIL PROTECTED] wrote: Next test : I deleted app/views/essais and run bake again. I watched the folder and

Re: Cache problem ?

2008-06-20 Thread Marc MENDEZ
gbk * a écrit : i have no idea... maybe there is something useful in your log files. have you checked them (webserver error log, php error log, /tmp/logs/error.log, debug.log)? I should not work on the last day of the week When things are too obvious. Just one word :

Re: application design issues [modular structure with view caching]

2008-06-20 Thread gbk *
i rewrote the code of my boxes (searhbox, menu) to use session variables and this works well with view caching, but i'm still interested in alternative solutions, so if you have any idea please help me out. thanks, gbk On jún. 19, 16:18, gbk * [EMAIL PROTECTED] wrote: hi, and sorry for my bad

Re: Sub directories within Cake

2008-06-20 Thread Drew
It looks like either routing, or Admin Routing, or a combination of both. I will have to investigate these further. If anyone has examples, please feel free to share them! Thanks, Drew On Jun 20, 1:36 am, Daniel Hofstetter [EMAIL PROTECTED] wrote: Hi Drew, I think you are looking for

main views and sub views?

2008-06-20 Thread meximex
hi, i am trying to build a cakephp website. 1. where do i set up my main layout, the header of the page the menu etc. I want to have my views and the controller stuff inside a design. in normal(and very simple) php i would create a html and have an include a the position where the dynamic

return value from command line

2008-06-20 Thread da_student
hey, I used this tutorial: http://bakery.cakephp.org/articles/view/calling-controller-actions-from-cron-and-the-command-line to execute actions from the command line, which works fine. My problem: When executing (regular) php from command line like: php test.php and test.php echoes something,

Re: Missing database table

2008-06-20 Thread Marcelius
If you turn debug mode to 1, cache is refreshed so any changes in the database will be recognized :-) On 20 jun, 11:06, leo [EMAIL PROTECTED] wrote: On 20 Juny, 10:33, Siebren Bakker [EMAIL PROTECTED] wrote: I ran into a similar problem, and found an interesting solution that took care of

Re: email headers visible in content of message?

2008-06-20 Thread jsntv200
I won't mention the wasted hours I spent trying to resolve this one, so thought i'd save you some pain. Basically boils down to line breaks. The email component has them set as : $_newLine = \r\n; Setting it to '\n' seemed to fix it for me. $this-Email-_newLine = \n; I do an svn update most

Re: Sub directories within Cake

2008-06-20 Thread Ian Zepp
While I believe cake supports some form of plugins, this may be another option for you. My firm uses plugins in addition to controllers and actions to better group related operations. In addition, plugins help to namespace controllers so you may have two same-named controllers in different

Re: return value from command line

2008-06-20 Thread Dardo Sordi Bogado
Maybe you should look into cake shells http://cakebaker.42dh.com/2007/05/07/writing-a-custom-cakephp-console-script/ On Fri, Jun 20, 2008 at 9:51 AM, da_student [EMAIL PROTECTED] wrote: hey, I used this tutorial:

Re: complex findAll()

2008-06-20 Thread Ian Zepp
Please don't do that directly. SQL (even in a limited form) sprinkled throughout the app is never good. I do think that is a neat solution. However, the right way to implement it would be to define a custom model method called 'findAllSliced()' or something similar, so you can change the

Re: Share Common Code

2008-06-20 Thread Ian Zepp
The downsides of that: (a) It pollutes the global name space with misc functions. (b) It is a pain to manage if you continue the trend and move beyond a few functions. (c) It goes against the OO philosophy that Cake pushes. (d) You can't do supporting protected or private scope functions to

Re: inserting more layers into cake php

2008-06-20 Thread Ian Zepp
Unlike Zend (with uses an Action suffix to designate controller actions), Cake doesn't have any such thing and instead uses a blacklist of 'private' controller actions (defined in the dispatcher). As such, be aware that new methods defined in the controller could 'potentially' be called as an

content-based ACL

2008-06-20 Thread gripen
Hi all, I've spent a lot of time studying the ACL+auth, but I don't know how to implement a such thing: There will be several posts in section and I want to restrict access to those posts only for few chosen users. How sholud I set up ACL/auth to work this way?

Utah CakePHP Users - Join Up

2008-06-20 Thread John David Anderson
Bakers, Check out a new Utah-based user group for CakePHP users: http://groups.google.com/group/utahcakephp We're just getting started, but we're hoping to get together for meetings, lunch foosball. Hope to see you there, John --~--~-~--~~~---~--~~ You

password not hashed by edit user

2008-06-20 Thread leo
When I create a user, the password is hashed correctly and I can log in with that user. If I then edit the same user to change the password, the password isn't hashed, but stored as plain text so I can no longer login with that user (as the password I enter at the login is internally hashed).

Re: email headers visible in content of message?

2008-06-20 Thread Pierre MARTIN
Thank you very much jsntv200 !! It works perfectly ... Pierre On 20 juin, 15:56, jsntv200 [EMAIL PROTECTED] wrote: I won't mention the wasted hours I spent trying to resolve this one, so thought i'd save you some pain. Basically boils down to line breaks. The email component has them set

Re: content-based ACL

2008-06-20 Thread leo
I've spent a lot of time studying the ACL+auth, but I don't know how to implement a such thing: Me too. Eventually, I gave it up as to much to learn and over complicated. I wrote my own solution using existing auth in about 25 lines of code + 2 small tables that does everything I want,

Best way to filter output from find()

2008-06-20 Thread Drew
Hello, I am new to cake and this is definately turning into a much larger learning curve then what I would have liked!! :) I can already see a lot of potential out of it though. Currently the add/edit controllers have built in functionality (with the helpers) to clean the data displayed in the

Re: complex findAll()

2008-06-20 Thread grigri
Please don't do that directly. SQL (even in a limited form) sprinkled throughout the app is never good. I do think that is a neat solution. However, the right way to implement it would be to define a custom model method called 'findAllSliced()' or something similar, so you can change the

Re: Model::validates 'message' not being used when invalid and related issue

2008-06-20 Thread BrendonKoz
I forgot to mention that I am using CakePHP v1.2 RC1. My (current) call to saveAll is as follows: if ($this-Vote-saveAll($this-data['Vote'], array('atomic'=true, 'validate'='first'))) { I am doing validation on the `rating` field as it's the only field I'm showing within the view. All other

Re: Missing database table

2008-06-20 Thread Siebren Bakker
@Marsellus. Makes sense, I ran into this problem in the beta version of my site, which has debug set to 2 so I can see the SQL dump, and make sure that I'm not selecting more information than I need. findAll find in most situations, especially because of the recursive option. In the name of

Re: password not hashed by edit user

2008-06-20 Thread Siebren Bakker
Unfortunately, cake does not seem to hash the password automatically, at least as far as I've been able to find. This is of course for a User.password type field, which cake automatically sets as a password-text input, right? I've had to do all my hashing manually. If this functionality could be

Re: password not hashed by edit user

2008-06-20 Thread Chris Hartjes
On Fri, Jun 20, 2008 at 11:57 AM, Siebren Bakker [EMAIL PROTECTED] wrote: Unfortunately, cake does not seem to hash the password automatically, at least as far as I've been able to find. This is of course for a User.password type field, which cake automatically sets as a password-text input,

Re: main views and sub views?

2008-06-20 Thread Siebren Bakker
It's actually fairly simple to do. I won't re-type all of the information from the manual, but if you are using CakePHP 1.2.xx, layouts are explained in detail on this page: http://manual.cakephp.org/view/94/views#layouts-96. The way this works out, is that your layout is the background

Re: password not hashed by edit user

2008-06-20 Thread leo
@Chris Any reason why you're not using it (this is a trick question)? I am. If you use the Auth component, the password is automatically hashed when you create a new record in your User table. It works ticketyboo when inserting a _new_ record. It ticketydoesn't when you then edit that

Re: password not hashed by edit user

2008-06-20 Thread itsnotvalid
That sounds like a bug to me. Haven't checked the code yet. On Jun 21, 12:08 am, leo [EMAIL PROTECTED] wrote: @Chris Any reason why you're not using it (this is a trick question)? I am. If you use the Auth component, the password is automatically hashed when you create a new record in

Re: password not hashed by edit user

2008-06-20 Thread AD7six
On Jun 20, 6:08 pm, leo [EMAIL PROTECTED] wrote: @Chris Any reason why you're not using it (this is a trick question)? I am. If you use the Auth component, the password is automatically hashed when you create a new record in your User table. It works ticketyboo when inserting a

Re: password not hashed by edit user

2008-06-20 Thread leo
Well I got it working with sellotape, by forcing the hashing of the password: $this-data['User']['password'] = Security::hash(Configure::read('Security.salt').$this-data['User'] ['password1']); I'm not really happy about having to do this as I would have thought the hash would be integral to

Re: password not hashed by edit user

2008-06-20 Thread Chris Hartjes
On Fri, Jun 20, 2008 at 12:08 PM, leo [EMAIL PROTECTED] wrote: It works ticketyboo when inserting a _new_ record. It ticketydoesn't when you then edit that record. Interesting...I have some edit user functionality in an app, and I will test it out later to see this error for myself. --

Re: password not hashed by edit user

2008-06-20 Thread leo
@AD The auth component only hashes the password, if the username is in the form data too. Sounded promising, but no, that didn't do it either. I'll investigate further with username in a while but I have a meeting now --~--~-~--~~~---~--~~ You received this

validation is not working

2008-06-20 Thread cakebang
Hi guys, The validation framework is supposed to be fun and easy to use. However, it seems that I do not have the luck. class PhotosController extends AppController { var $validate = array( 'photoname' = array('rule' = array('minLength', 1)) ); ... } I have

Re: password not hashed by edit user

2008-06-20 Thread Reza Muhammad
Alternatively, you can also do it: $this-data['User']['[password'] = $this-Auth-password($this- data['User']['password']); On Jun 20, 2008, at 11:18 PM, leo wrote: Well I got it working with sellotape, by forcing the hashing of the password: $this-data['User']['password'] =

Re: password not hashed by edit user

2008-06-20 Thread leo
Alternatively, you can also do it: $this-data['User']['[password'] = $this-Auth-password($this- data['User']['password']); I tried that, but strangely it didn't work ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: validation is not working

2008-06-20 Thread Rich
I'm new to cake but am I right by saying that this should go into the model? All of the examples i've seen point to this. On Jun 20, 12:21 pm, cakebang [EMAIL PROTECTED] wrote: Hi guys, The validation framework is supposed to be fun and easy to use. However, it seems that I do not have the

Re: Darkauth failing on 1.2 RC1

2008-06-20 Thread uniacid
Figured out the warning issue, it did seem that there were extra characters unbeknown to me and the editor I was using at the time didn't even see them, Used a different IDE and found and corrected those issues, so Darkauth is working on my Apache server, I'll see if I can figure out anything

Re: password not hashed by edit user

2008-06-20 Thread dw
I posted the same issue a couple months ago, and just resigned myself to the fact that i would have to manually hash the password field for my edit method. Following AD7six's tip just now, I included the username as a hidden field in the edit form and the password was hashed correctly. When i

Re: Missing database table

2008-06-20 Thread Joel Perras
On Jun 20, 11:52 am, Siebren Bakker [EMAIL PROTECTED] wrote: I'm not selecting more information than I need. findAll find in most situations, especially because of the recursive option. Really? That's odd, because findAll() is nothing more than a (deprecated) wrapper for find('all').

Re: Which find to use on controller?

2008-06-20 Thread DaveMahon
Use caution with findAll. It is being deprecated in favor of just generic find. In 1.2 it will continue to work with a warning, but that functionality will go away, likely in Cake 2.0. On Jun 19, 11:45 pm, Louie Miranda [EMAIL PROTECTED] wrote: Thanks! I also tried this and it did work.

Re: Best way to filter output from find()

2008-06-20 Thread DaveMahon
Part of your problem is that you're trying to sanitize output in your controller. That is more appropriately done in the view, where you have already sorted out the array and are working with single elements at a time (presumably inside of a loop). This will also be helpful in the future when you

Re: simple noob problem with database fetching

2008-06-20 Thread Turnquist, Jonah
Ok, now I understand. You've helped me greatly! Jonah On Jun 20, 4:37 am, dr. Hannibal Lecter [EMAIL PROTECTED] wrote: No, because in the first case, the first param is not supposed to be 'all': As you already know, the first param is $conditions, so in the first case, $conditions should

Best folder to place Dojo and how to reference it

2008-06-20 Thread brownie
What is the best folder to place Dojo under CakePHP and the best method to cal it from views? -Thx. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to

internationalization - switching languages

2008-06-20 Thread deltawing
Help please I'm getting really desperate with this one. The problem is very typical of a multilingual site - the user needs to be able to switch between several languages. Following the CakePHP 1.2 Cookbook, I can a the language in the beforeFilter() and that seems to work. But I have no idea

Re: Best way to filter output from find()

2008-06-20 Thread Drew
Understandable then. I guess this way it isn't trying to filter the 'id' field, and 'date' field and other random items as well. So is it just as well to simply use htmlspecialchars() within the view? On Jun 20, 2:15 pm, DaveMahon [EMAIL PROTECTED] wrote: Part of your problem is that you're

Re: Best way to filter output from find()

2008-06-20 Thread Drew
Guys... I have to be missing something obvious here: function index() { uses('sanitize'); $sanitize = new Sanitize(); $find = $this-TemplateColor-findAll(); foreach ($find AS $key = $color)

Email Validation: Test Case Fails

2008-06-20 Thread J. Anderson
Before posting to Cake Trac and potentially wasting a developers time, maybe the group knows of this? Preliminaries: Version (from version.txt) 1.2.0.7125 RC1 PHP Version: 5.2.5 Platform: Apache 2.2.8 OS: Windows XP Begin Code (From Model) var $validate = array( 'email' = array(

Localization and Internationalization: Can't switch languages

2008-06-20 Thread deltawing
I followed the CakePHP 1.2 tutorial and was able to set the language in beforeFilter(). The problem is I want users to be able to switch the language at any time, by clicking on a link. How can I do that? I've tried many things but I still can't get it to work. Any takers? Thanks in advance.

Re: Localization and Internationalization: Can't switch languages

2008-06-20 Thread Chris Hartjes
On Fri, Jun 20, 2008 at 1:21 PM, deltawing [EMAIL PROTECTED] wrote: I followed the CakePHP 1.2 tutorial and was able to set the language in beforeFilter(). The problem is I want users to be able to switch the language at any time, by clicking on a link. How can I do that? I've tried many

Cross Database HABTM model recursion

2008-06-20 Thread n00bi5h
I have searched to no avail so my apologies if this is covered elsewhere. I have a HABTM relationship across databases. It appears the only way to achieve this is using a model for the joining table. So instead of Project - Contact, it's Project - ContactsProject - Contact, like the following:

email component utf-8 body

2008-06-20 Thread bujanga
I am finally trying to convert some older code over to the latest build of cake and thought I would use the Email Component. Read cookbook examples and did some searching as well. Still running into a problem. 1. Email is sent and received. 2. Subject is fine 3. PROBLEM - body is garbage Pretty

Re: Email Validation: Test Case Fails

2008-06-20 Thread bujanga
I won't presume to answer why but... If you change- 'rule' = array('email', true), to - 'rule' = array('email'), it works for me. Gary On Fri, Jun 20, 2008 at 12:53 PM, J. Anderson [EMAIL PROTECTED] wrote: Before posting to Cake Trac and potentially wasting a developers time, maybe the

Re: internationalization - switching languages

2008-06-20 Thread francky06l
There is something there that might help you : http://www.cakephpforum.net/index.php?showtopic=179 On Jun 20, 7:57 pm, deltawing [EMAIL PROTECTED] wrote: Help please I'm getting really desperate with this one. The problem is very typical of a multilingual site - the user needs to be able to

Bake Connect Problem

2008-06-20 Thread surf5502
I just got CakePHP installed (after deciding to try this before RoR) and I trying to figure out how to use the code generator. I have a MacBook Pro running MAMP (http://www.mamp.info). The server is set up fine and when I browse to http://localhost/ everything comes up green and good to go (it

Re: Best folder to place Dojo and how to reference it

2008-06-20 Thread Juan Francisco Giménez Silva
El Fri, 20 Jun 2008 12:14:53 -0700 (PDT) brownie [EMAIL PROTECTED] escribió: What is the best folder to place Dojo under CakePHP and the best method to cal it from views? -Thx. I think it's /webroot/js and call it with $javascript-link(blahblah.js). -- Juan F. Giménez Silva GTalk :

Re: Bake Connect Problem

2008-06-20 Thread Michael Gregoire
You need to set the port in the database.php config file like so: var $default = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'port' = '8889', 'login' = 'username',

Re: Bake Connect Problem

2008-06-20 Thread Samuel DeVore
it is likely that you are using the inbuilt php not the mamp version that has connection to mysql working, try typing which php in the terminal (I bet it points to something like '/usr/bin/php' you likely need to find the php executable in mamp folder and either add that to your path in your

Re: Bake Connect Problem

2008-06-20 Thread surf5502
still not working even after adding to the path and trying to modify the .bat and .php files to point to the MAMP copy of PHP. On Jun 20, 6:17 pm, surf5502 [EMAIL PROTECTED] wrote: I just got CakePHP installed (after deciding to try this before RoR) and I trying to figure out how to use the

Re: Localization and Internationalization: Can't switch languages

2008-06-20 Thread deltawing
Sorry, but it wasn't deliberate :) For some reason this post appeared like an hour after it was posted, making me think it failed to send. Could be caching I don't know. For people facing the same problem, refer to this link on internationalization:

Re: Using bootstrap to load app_controller

2008-06-20 Thread Corie
I opened a ticket https://trac.cakephp.org/ticket/4959 Supposedly it's as expected. -Corie On Jun 16, 5:33 pm, Corie [EMAIL PROTECTED] wrote: Perhaps I will. This works for now: $controllerPaths = array(CAKE_CORE_INCLUDE_PATH . DS . 'shares' . DS . 'controllers' . DS);

  1   2   >