Testing controllers with SimpleTest revisited

2006-08-22 Thread Sonic Baker
I know the issue of testing controllers with SimpleTest has come up before but unfortunately has gone unanswered. I'm hoping that in the time that has passed it has been figured out. Testing models works fine but controllers on the other hand is a hazy area. The first problem is actually

Re: Testing controllers with SimpleTest revisited

2006-08-22 Thread [EMAIL PROTECTED]
loadmodels? http://api.cakephp.org/basics_8php-source.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this

Re: Let user submit multiple records

2006-08-22 Thread mutabor
Hi Vanchuck! Thanks for useful info. Basicaly, I just wanted to confirm that HTML helper really can't help me processing multiple set of inputs and I need to code around to make it working instead of having simple way to view it, save it and validate it. Mutabor

Re: Testing controllers with SimpleTest revisited

2006-08-22 Thread Sonic Baker
Hi Dieter, Thanks for the reply. Unfortunately adding loadModel('Blog') to the after the laodController gives a redeclaration error: Fatal error: Cannot redeclare class blog in /path/to/cake/app/models/blog.php on line 142 Any more ideas? Cheers, Sonic

Re: Testing controllers with SimpleTest revisited

2006-08-22 Thread [EMAIL PROTECTED]
if it says that you are redeclaring it, you are probably loading it twice eg trying to load it manually while it's already loaded automatically. are you sure you need to load it manually? --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Testing controllers with SimpleTest revisited

2006-08-22 Thread Felix Geisendörfer
Hi Sonic, Testing Controllers is a very important topic to me right now as well. I've been talking about it on my blog lately and I've also put some of the code I use to make testing controllers easier in the cakebin. However, that's not really what you are looking for, since I'm not using

Re: Testing controllers with SimpleTest revisited

2006-08-22 Thread teemow
hey sonic, there is a test helper which creates mock objects for all the models of a controller. http://cakephp.org/pastes/show/8803bd09150cb65cc7da63f92cdbc828 felix' post: http://www.thinkingphp.org/2006/08/17/agility-divide-and-conquer-what/ cheers, timo

cakePHP

2006-08-22 Thread Andrew Morrell
Title: cakePHP I'm a recruitment consultant and I have a client who needs a contractor in the UK with Cake PHP skills. Would anyone be interested or know someone who might be? Kind Regards Andy Morrell Contract Services Senitor Associates Ltd. Tel: 0207 379 9955 Wilmslow: 01625 540

Re: cake dojo (generally external libraries)

2006-08-22 Thread Matt2012
Has anyone got some code they can share which allows dojo widgets in cake views I cant get this to work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: How to test for the current model?

2006-08-22 Thread Simplerules
Well, I have the component 'Logins' and the model 'Users'. I need to access a function in 'Users' model. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: How to test for the current model?

2006-08-22 Thread AD7six
Hi Simplerules try something like the following in your component: $User = new User; $result = $User-mySpecialFuction($MyParams); Cheers, AD7six --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group.

Re: How to test for the current model?

2006-08-22 Thread Simplerules
Thanks :) That worked. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED]

Use Component in Model

2006-08-22 Thread Simplerules
How do I use a component in a model? Even addingvar $components = array('Cookies', 'Logins'); doesn't load it. *Screwed up the last thread, confusing lingo. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake

How to register a user?

2006-08-22 Thread blackberry
I have a page to register user. in DB,there are 2 tabels.:users, profiles. users table has below fields: id, email, password. profiles table has: id, user_id, last_name, ... here user_id is the id in Users table. In the registration page, email, password, last_name etc, fields need to input.

Re: Use Component in Model

2006-08-22 Thread nate
If you have a component called Logins, for example, the class name would be LoginsComponent, and you would store it in app/controllers/components/logins.php. If you have all that right, it should be available in your controller as $this-Logins.

Re: Use Component in Model

2006-08-22 Thread Simplerules
But how can I use it in a model? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL

Re: Use Component in Model

2006-08-22 Thread mouth
Simplerules wrote: But how can I use it in a model? To be perfectly exact: try to rethink Your application structure, please. If You want Your model will co-operate with some component, drive this behaviour from controller or from this component - Your component can implement method

Re: View subdirectories names ... problem

2006-08-22 Thread purepear
Ahhh... the mistake was mine sorry to bother... my var $Name should've been in plural : ProductCats...feel stuppid. But no debug info shows that i guess.. or not... i got to read some info on the debugging process.. Anyway Thanks very much for the support guys.

Re: Testing controllers with SimpleTest revisited

2006-08-22 Thread Sonic Baker
Hi guys, Thanks for your responses, much appreciated. Thanks v much for the links, very interesting. @Felix, I'm definitely one of those people in your divide and conquer blog. I'm also trying my best to become agile. I can't believe I didn't think to mock the Models when in the controller,

Re: How to register a user?

2006-08-22 Thread mouth
You never heard about model associations, did You? ;-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group,

Re: Use Component in Model

2006-08-22 Thread nate
Actually, Model Behaviors already exist in 1.2 and are largely functional. Documentation on how to use them will be forthcoming, but for the time being, here's a little rundown. Let's say you have a behavior called List. you would create a class ListBehavior that extends ModelBehavior, and

Re: Help me with my logic please

2006-08-22 Thread [EMAIL PROTECTED]
So I should write first the common logic in the classified controller and then the unique methids in appropriate controllers that uses common logic from the classified? In non MVC applications I would use a classified class and then a cars and other classes that would extend the classifieds

Bugs with DBO_Postgres ?

2006-08-22 Thread Guy
First, I must admit I'm a rookie with CakePHP. I started using it last month with 1.1.6, and as the subject says it, I'm using a PostgreSQL database. I like CakePHP, and I would be glad to help improve it. I'm using CakePHP_1.1.7.3363, PostgreSQL 7.4.7, PHP 4.3.10, on a Debian/Sarge. Well I have

Re: How to register a user?

2006-08-22 Thread blackberry
Thanks, I try it! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For

FCKeditor CakePHP: howto enable opera without having fckeditor.js

2006-08-22 Thread [EMAIL PROTECTED]
Hello, on the wiki, there are 2 tutorials covering fckeditor: http://wiki.cakephp.org/tutorials:beginners_only?s=fckeditor#step_7rich_text_editing_with_fckeditor and: http://wiki.cakephp.org/tutorials:online_editor-fckeditor both of them tell you the same when it comes to copying files from the

Re: Bugs with DBO_Postgres ?

2006-08-22 Thread nate
Yeah, there's currently a ticket open on the issue that I've been working on and off on for the past couple days, and I expect to have it resolved shortly. If you have any interest in being a tester or maintainer of our PostgreSQL driver, get in touch with me at nate at cakephp d0t org.

Re: How to register a user?

2006-08-22 Thread mouth
hasOne? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more

Re: FCKeditor CakePHP: howto enable opera without having fckeditor.js

2006-08-22 Thread [EMAIL PROTECTED]
oh and for the record, i tried passing EnableOpera everywhere i could before altering the code. (in the view, after creating the object and before rendering it, in the constructorcode of the class, in the config.js ...) all to no avail. I also i forgot to mention that opera does show the

Re: Bugs with DBO_Postgres ?

2006-08-22 Thread Guy
Wow, how quick ! Well, I have replaced the 'DEFAULT' string with the 'NULL' string in the value() function... I don't know yet whether it's correct but at least there are no more warning (so I suppose it's not worse) ;-) . I will investigate more on the del() function. Thank you.

Re: Testing controllers with SimpleTest revisited

2006-08-22 Thread Sonic Baker
Hi Felix, Thanks for your reply. I haven't really played around with Mocks that much myself but everything I've read about them is positive in the sense that when using Mocks with TDD, you are forced to think more in terms of interactions between objects, which leads to a better design with less

Re: Bugs with DBO_Postgres ?

2006-08-22 Thread nate
It might cause you some issues when you use the model to save data (that's why the DEFAULT thing was added). At worst, you could hack some special rules into your copy of DboPostgres until I get this fix finished. --~--~-~--~~~---~--~~ You received this message

A Cool Link

2006-08-22 Thread Mohsin Khan
Hello Friends Just click on this link and download new games, movies, new software and much much more. Visit this site and enjoy. http://vip.netsurf.ru/browse/?r=215390 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: othAuth: logging in as other user + warning when permissions not sufficient

2006-08-22 Thread CraZyLeGs
1) you need two hashkeys, by default in the version in the snippet it's not possible to kill the old login and login with a different one, it will say you're already logged in. 2) in the new version that's comming normally this week, you can specify a no_access page where the user is redirected

Configuration Table

2006-08-22 Thread Simplerules
I want to create a component that will access a configuration table I created. How would I let the component access a MySQL table that does not belong to a controller? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: dateTimeOptionTag fields

2006-08-22 Thread Samuel DeVore
ok here's your home work read the http://api.cakephp.org/ (hint you need to do this in the controller so that is a good place to start, you are looking to do something with 'fields' so look for that. have fun fishing On 8/22/06, Geoff [EMAIL PROTECTED] wrote: I was wondering if there is any

Re: dateTimeOptionTag fields

2006-08-22 Thread Geoff
i'm guessing that i should manually convert the the _day etc into a date in a beforefilter (with mkdate). in fact i was going to do it in beforesave in the model... am i being silly or is there a better way --~--~-~--~~~---~--~~ You received this message because

Re: [spam] Re: How to test for the current model?

2006-08-22 Thread Bernard Grosperrin
Mikee $this-controller so you can check for the controller name if ($this-controller-name == 'Blahs') { display } or for the modelClass if ($this-controller-modelClass == 'Blah') { display } Cool, thanks, it help! Bernard

Re: Configuration Table

2006-08-22 Thread AD7six
Er.. create a model for it and read previous posts? http://groups.google.com/group/cake-php/browse_thread/thread/cebf2f5728fac410/163a45cd882614c6?lnk=gstq=AD7sixrnum=1#163a45cd882614c6 Cheers, AD7six --~--~-~--~~~---~--~~ You received this message because you

Re: dateTimeOptionTag fields

2006-08-22 Thread AD7six
Try this page, and looking for the word controller :) http://api.cakephp.org/search.php?query=datetime Cheers, AD7six --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send

Re: dateTimeOptionTag fields

2006-08-22 Thread Geoff Smith
ahh i see, thanks guys :)On 22/08/06, AD7six [EMAIL PROTECTED] wrote: Try this page, and looking for the word controller :)http://api.cakephp.org/search.php?query=datetimeCheers,AD7six --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Configuration Table

2006-08-22 Thread AD7six
We are edging into vampire teritory here ;). No. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send

Re: cake dojo (generally external libraries)

2006-08-22 Thread bwaters
You can have my headhelper component. http://www.cakephp.org/pastes/show/7e55bff7e509597a6a004600af895bcf The widget syntax is so html like that I havn't bothered to create a helper for it and just write it straight into my views. --~--~-~--~~~---~--~~ You

Re: Configuration Table

2006-08-22 Thread Simplerules
Right I have that done, now I need to get the data into a cleaner assoc array. Its coming out like this: Array ( [0] = Array ( [Configuration] = Array ( [key] = sc_countries [value] = US,CA [group] = language_control [description] = Countries for which content will be provided, content

Re: 's' vs. 'ies' plural for table names

2006-08-22 Thread Zoltan
John David Anderson (_psychic_) wrote: On Aug 21, 2006, at 9:33 AM, Zoltan wrote: Yes, I tried it and it seemed to work at first, then got some errors about missing controllers. This was about a week ago, but going from memory I used something like: class City extends AppModel {

Re: Configuration Table

2006-08-22 Thread RosSoft
function transform($data) { $config=array(); foreach ($data as $row) $config[$row['key']]=$row; return $config; } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: Re: 's' vs. 'ies' plural for table names

2006-08-22 Thread Samuel DeVore
So I usually have a .thtml page in my views/pages that looks like http://cakephp.org/pastes/show/ebb93d95243037fcca3d73ae04c69b72 This lets me test my assumptions about how things are going to work. Sam D --~--~-~--~~~---~--~~ You received this message because

validation with 2 fields

2006-08-22 Thread Ámon Tamás
Hello, How can I validate 2 fields? for example I have a username and a password, and I like to validate this two filelds are not the same? -- Tamas Amon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP

Re: 's' vs. 'ies' plural for table names

2006-08-22 Thread [EMAIL PROTECTED]
thanks mate :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more

Re: Re: 's' vs. 'ies' plural for table names

2006-08-22 Thread Samuel DeVore
I really need to start a page of the 'old fart's oven o' baking hints' On 8/22/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: thanks mate :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To

getting started.

2006-08-22 Thread [EMAIL PROTECTED]
Hi. I started to use cake a week ago - so far everything has been a bit overwhelming :/ I am trying to create a simple recipe page: Recipes have many ingredients. Ingredients take price and unit from raw_materials. I have used the baker script to create the basic pages. Right now the related

Models relations in nested tables and more...

2006-08-22 Thread [EMAIL PROTECTED]
Hi! I would like to make a scaffold on my cars table... What am I trying to do is the following: hierarchy of the cars is pretty simple: make-model-variant- so instead of having at least 3 tables I decided to make only one, but nested the fields are id, parentid, name, description,

Re: 's' vs. 'ies' plural for table names

2006-08-22 Thread [EMAIL PROTECTED]
then get cooking chef, i'm hungry ;-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to

Re: validation with 2 fields

2006-08-22 Thread Mikee Freedom
morning mate, As a starting point, have a look at this tutorial on the wiki: http://wiki.cakephp.org/tutorials:advanced_validation Fromhere I've been able to modify this validation method to my own devices. You can pretty much define multiple validation methods for each input and create the

Re: validation with 2 fields

2006-08-22 Thread Ámon Tamás
midnight mate :) (because in here in Budapest now is midnight) Mikee Freedom írta: morning mate, As a starting point, have a look at this tutorial on the wiki: http://wiki.cakephp.org/tutorials:advanced_validation Fromhere I've been able to modify this validation method to my own

Re: validation with 2 fields

2006-08-22 Thread Mikee Freedom
it's just gone 9am down here in NZ :) you can deinfe the functions in /app/app_model.php if you think they will be used by multiple models e.g. unique. or you can place them in the particular model that requires that validation method /app/models/example_model.php. i've changed the validation a

Post Page Function

2006-08-22 Thread Simplerules
Is there a way for me to set a function to run at the end of every page load? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To

Post Page Function

2006-08-22 Thread Simplerules
Is there a way for me to set a function to run at the end of every page load? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To

Re: Post Page Function

2006-08-22 Thread John David Anderson (_psychic_)
On Aug 22, 2006, at 3:32 PM, Simplerules wrote: Is there a way for me to set a function to run at the end of every page load? Controller::afterFilter(); You might implement it in your AppController if you want it site-wide: class AppController extends Controller { function

Re: Post Page Function

2006-08-22 Thread Mikee Freedom
$controller-afterFilter(); If you define a function called afterFilter in your app_controller (or any of your controllers) you can include whatever code you like in here and it will run after every action call of a controller. http://manual.cakephp.org/chapter/controllers

Re: Unwanted GET variable in URL

2006-08-22 Thread JRGould
Is there a way to disable passing session variables with GET when users have cookies? MJ Ray wrote: Chris Hartjes [EMAIL PROTECTED] That looks awfully like a session ID that is being sent via the URL instead of stored in a cookie. Which is good. No need to lock people out just because

Re: Unwanted GET variable in URL

2006-08-22 Thread John David Anderson (_psychic_)
On Aug 22, 2006, at 3:54 PM, JRGould wrote: Is there a way to disable passing session variables with GET when users have cookies? Yeah[1]: session.use_trans_sid boolean session.use_trans_sid whether transparent sid support is enabled or not. Defaults to 0 (disabled). Note: For PHP

how to enqueu ajax remote fonction ?

2006-08-22 Thread [EMAIL PROTECTED]
My primary objective is to update multiple div at once like but not like this exemple: // test.thtml code ?=$ajax-link('Update 2 Div\'s', '/controller/test', array('update' = array('first', 'second'))); ? ?=$ajax-div('first'); ? This is the first div, it has the current time:

Google Search Api.

2006-08-22 Thread salimk786
Hello, I'd like to use google api along with cakephp. I found an article online explaining how to do this. Can you tell me, if i was to download NUSoap, where would i place their lib folder so that my controller can easily call it. Thanks.

Re: Google Search Api.

2006-08-22 Thread John David Anderson (_psychic_)
On Aug 22, 2006, at 4:35 PM, salimk786 wrote: Hello, I'd like to use google api along with cakephp. I found an article online explaining how to do this. Can you tell me, if i was to download NUSoap, where would i place their lib folder so that my controller can easily call it.

Re: Google Search Api.

2006-08-22 Thread Mikee Freedom
Could you post the link to the article? that sounds like an interesting read. thanks mate, freedom On 23/08/06, John David Anderson (_psychic_) [EMAIL PROTECTED] wrote: On Aug 22, 2006, at 4:35 PM, salimk786 wrote: Hello, I'd like to use google api along with cakephp. I found an

Re: Google Search Api.

2006-08-22 Thread salimk786
Hello Mikee, Here is the article that shows you how to integrate the Google Api with php. http://www.dankarran.com/googleapi-phpsitesearch/ Salim. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group.

Re: Google Search Api.

2006-08-22 Thread salimk786
Hello Mikee, Here is the article that shows you how to integrate the Google Api with php. http://www.dankarran.com/googleapi-phpsitesearch/ Salim. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group.

tagErrorMsg not working since upgrade

2006-08-22 Thread ShepherdWeb
Perhaps it is coincidental. Since upgrading to v1.1.7.3363 tagErrorMsg in my application is no longer working. Is anyone else experiencing this with this version? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Google Search Api.

2006-08-22 Thread Mikee Freedom
thanks mate! On 23/08/06, salimk786 [EMAIL PROTECTED] wrote: Hello Mikee, Here is the article that shows you how to integrate the Google Api with php. http://www.dankarran.com/googleapi-phpsitesearch/ Salim. --~--~-~--~~~---~--~~ You received this

Keep getting Undefined index: campaign_page_id error

2006-08-22 Thread [EMAIL PROTECTED]
The page_id in pages table matches with campaign_page_id in the campaign table. TABLES: campaign: campaign_id INT, campaign_page_id INT pages: page_id INT, page_url VARCHAR MODELS: campaign.php class Campaign extends AppModel { var $name = 'Campaign'; var $useTable = 'campaign';

Can't get basic example to work.

2006-08-22 Thread [EMAIL PROTECTED]
This should be easy but its killing me so I just have to ask. I can't get a basic example MVC to work. I use xampp to run mySql and apache on my pc (windows) It's installed here. (DocumentRoot) C:\Program Files\xampp\xampp\htdocs Cake is installed here: C:\Program Files\xampp\xampp\htdocs\cake

POST UR JOB REQUIREMENTS/POWER_RESUMES FREE FREE FREE . . .

2006-08-22 Thread JOBS/POWER_RESUMES
Dear Employer/JobConsultant/JobSeeker, NEW GREAT OFFER BY US NOW ITS FREE TO SEARCH RESUME/JOB DATABASE AND CALL FOR INTERVIEW/APPLY INTERVIEW http://www.Net4Professionals.com (HERE YOU WILL GET FIVE TIMES MORE THAN EXPECTATION; FREE ...) FOR EMPLOYERS

cannot get Cake v1.1.7.3363 to work

2006-08-22 Thread eDevil
I've been working with cake 1.0.xx for a while now. I downloaded the new version last night and put it in a my htdocs but when I try to access it, it says : Server error! The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there

Re: multiple hasAndBelongsToMany ajax create/add form...

2006-08-22 Thread iceaxe
Well, no replies. I'm going to get rid of the many to many relationship and do it the easier way for now. Maybe someday someone will reply to this question. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake

Re: cannot get Cake v1.1.7.3363 to work

2006-08-22 Thread Ámon Tamás
eDevil írta: I've been working with cake 1.0.xx for a while now. I downloaded the new version last night and put it in a my htdocs but when I try to access it, it says : Server error! The server encountered an internal error and was unable to complete your request. Either the server is

Re: cannot get Cake v1.1.7.3363 to work

2006-08-22 Thread eDevil
nope. nothing logged on Apache error.log --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to

Re: multiple hasAndBelongsToMany ajax create/add form...

2006-08-22 Thread gwoo
Have you tested with scaffolding? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL