Re: How do I make a Behavior?

2007-07-30 Thread Dr. Tarique Sani
On 7/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > If I have debugging on, I get an error with one query with output > 'test'. What is the thing I'm doing wrong? What is the error? T -- = Cheesecake-Photoblog: http://cheesec

Re: which IDE is better for cakephp develop

2007-07-30 Thread Samuel DeVore
see http://groups.google.com/group/cake-php/web/frequent-discussions or search the group at http://groups.google.com/group/cake-php this has been asked and answered. Thanks Sam D ps. the short answer is all of them, or which ever one the person who answers uses On 7/30/07, Wimg <[EMAIL PROTE

which IDE is better for cakephp develop

2007-07-30 Thread Wimg
i am doing a project using cakephp,, try to find a better ide. thx --~--~-~--~~~---~--~~ 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

Re: A little (and maybe silly) problem

2007-07-30 Thread Rafael Barbosa
By testing a little further I discovered that cake is setting: $this->webroot to "\/" when it should be just "/". I don't know what can be causing that though, rnning in Zend Debugger shows everything running normally. Could someone bring some light into this? On Jul 30, 9:00 pm, Rafael Barbosa

Re: Calling functions in a Controller

2007-07-30 Thread Grant Cox
I would recommend learning the basics of PHP before getting into CakePHP. Many people already experienced with PHP find a steep learning curve. When you want to call another function from inside the same object, use $this->function_name(), not $this->function function_name(); eg: $this->build_r

Re: Home Page?

2007-07-30 Thread Baz
Live example: http://www.3hndesigns.com/about_us.htm -- Baz L Day In The Life of Baz http://www.LifeOfBaz.com On 7/30/07, Baz <[EMAIL PROTECTED]> wrote: > > With the Pages controller I find that routes don't really help me the way > I want. This is what I usually have to do: > > RewriteRule ^(.*)

Re: Home Page?

2007-07-30 Thread Baz
With the Pages controller I find that routes don't really help me the way I want. This is what I usually have to do: RewriteRule ^(.*)htm$ pages/$1 [L] so that I can then access pages like: example.com/about_us.htm -> example.com/pages/about_us/ Works like a dream, if you don't have any other

Re: Reducing prototype?

2007-07-30 Thread Brad Daily
I'd also recommend implementing gzip[1] where possible. When I use AssetPackager to combine Prototype, Scriptaculous and my other custom javascripts, then tell my web server to gzip any javascript documents, it results in about 52k for that single file. [1] http://developer.yahoo.com/performance/

Calling functions in a Controller

2007-07-30 Thread peterhf
CakePHP 1.13.4450, PHP 4.4.4 Controller A includes multiple functions, two of which are function build_resume() { . . . } and later in the code, function move_up($sequence) { . . . $this->function build_resume(); } When move_up is called from a view, a notice that "sequence" is

Re: Home Page?

2007-07-30 Thread housebolt
http://manual.cakephp.org/chapter/configuration - See section 3 "Routes Configuration" Also checkout the "pages" folder in /app/views/pages/. Anything you put in there can be accessed from the browser at /pages/your_page/ (which is equal to /app/views/pages/your_page.thtml [or .ctp]) and anythi

Re: Reducing prototype?

2007-07-30 Thread housebolt
I'd also recommend taking a look at the jQuery library. http://jquery.com You can't use Cake's helpers, but the ajax is basically all the same. I haven't used jquery yet, but I've looked at the documentation and it's very impressive, and it's just as easy to use as scriptaculous (maybe even easi

Re: Model::saveField not updating

2007-07-30 Thread peterhf
Well, Grant, you tip is the solution and it worked perfectly! Thanks a million!! On Jul 30, 4:16 pm, Grant Cox <[EMAIL PROTECTED]> wrote: > If "recordID" is your primary key in the database table (not "id"), > then you should have > > var $primaryKey = 'recordID'; > > in your model file. Then yo

A little (and maybe silly) problem

2007-07-30 Thread Rafael Barbosa
Hey guys, I'm a happy user of cake 1.1 and I'm going to get used to 1.2 now, but I ran into a little problem and hope you can help me out. When I checkout the 1.1.x.x branch and test the cake installation everything runs as it should. But when I checkout the 1.2.x.x branch in the default/welcome

Re: Is this not a security issue?

2007-07-30 Thread housebolt
Oh, hehe I get it now. Sorry, I was assuming you were trying to add a value that you actually did want to add/change in your database. Larry's right (as usual), you can limit the fields can get changed by the third param in $this->Model->save(). On Jul 30, 3:24 pm, morecakepls <[EMAIL PROTECTED

Re: Newbie Introduction Book ... reviews anyone?

2007-07-30 Thread Farez
Way to go Dave... you certainly have a good writing style. This would be very useful to all. Farez On Jul 27, 7:14 pm, Dave <[EMAIL PROTECTED]> wrote: > I'm working on a Newbie's Introduction to CakePHP book and would like > to invite anyone who would like to review it for errors or > considerat

Re: Model::saveField not updating

2007-07-30 Thread Grant Cox
If "recordID" is your primary key in the database table (not "id"), then you should have var $primaryKey = 'recordID'; in your model file. Then you can have $this->ResumeCredit->id = $recordIDofPrevious; $this->ResumeCredit->saveField( ... ); The ->id attribute always means "the models primar

Re: Best Practice for Views

2007-07-30 Thread Grant Cox
Are you talking about several different "skins", but really the same data and presentation? Or are you talking about some non-trivial data calculation, then you want to show the result in several independent areas of your site? I'm just not sure of the reason for the several views on a single ac

Reducing prototype?

2007-07-30 Thread Howard Glynn
Brad's recent post ( http://tinyurl.com/3bxj9s ) on asset packager has helped a lot, but I'm still struggling with response time on a large intranet app. Before I get jumped on, even though my database relationships are fairly complex, I don't believe the (cake)php page is the problem. Crude measur

Best Practice for Views

2007-07-30 Thread [EMAIL PROTECTED]
I'm curious to know what you all would do in this situation. I have some data that needs to be in several different views but it only has one controller action. What would you do? Right now I have a switch statement in my view and in my controller action I set the variable $var['View'] to whate

Re: Model::saveField not updating

2007-07-30 Thread rtconner
> > Per a posting on this group, '$this->ResumeCredit->id = > $recordIDofPrevious; Well then try it again, you did something wrong. All you need is to set Model->id to a non empty value. --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Re: Model::saveField not updating

2007-07-30 Thread gwoo
it would be $this->ResumeCredit->id and if there is no record found then saveField will do an insert. --~--~-~--~~~---~--~~ 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@g

Re: AssetPackager for CakePHP

2007-07-30 Thread gwoo
I would suggest using the console as I have it setup in the screencasts. This allows you to do everything from the current working directory, which in most cases is the app. From there you can figure out relative paths. --~--~-~--~~~---~--~~ You received this mess

Re: Home Page?

2007-07-30 Thread Geoff Ford
YOu need to set a default Route in app/config/routes.php Geoff -- http://lemoncake.wordpress.com On Jul 31, 8:13 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Quick question that I can't seem to find an answer for. The home page > of my site needs to have a lot of dynamic content generat

Re: Reducing prototype?

2007-07-30 Thread John David Anderson (_psychic_)
On Jul 30, 2007, at 4:13 PM, Howard Glynn wrote: > > Before I go diving into the prototype src components tomorrow, has > anyone got any > advice / experience / downloads on thinning out a recent up to date > prototype for > use with cake [1.2] and ajaxhelper?? I use these: http://www.ste

Re: Is this not a security issue?

2007-07-30 Thread morecakepls
Thanks, that answered my question! Perfect On Jul 30, 10:48 pm, "Larry E. Masters aka PhpNut" <[EMAIL PROTECTED]> wrote: > No it is not... > > http://api.cakephp.org/class_model.html#ebe42ae387be89985b5a35dd428f5c81 > > The third param in the save method is what you are looking for in 1.1 same >

Home Page?

2007-07-30 Thread [EMAIL PROTECTED]
Quick question that I can't seem to find an answer for. The home page of my site needs to have a lot of dynamic content generated on it. Is there a way to generate this content in some kind of controller? Or is there a way to redirect users to the index of another controller/ view from the home

Model::saveField not updating

2007-07-30 Thread peterhf
Using cakePHP 1.1.13.4450 and PHP 4.4.4 This code snippet: $recordIDofPrevious = 1; $sequence = 2; $this->ResumeCredit->recordID = $recordIDofPrevious; $this->ResumeCredit->saveField('sequence', $sequence, false); produces a SQL INSERT instead of an UPDATE; a new record is cre

Re: Cake PHP running dead slow

2007-07-30 Thread gwoo
There are two reasons to avoid $uses and loadModel in your code. 1. performance: Extra memory will be consummed if you have var $uses and the association in your model. loadModel simply checks if the class exists and includes it if it does not, so the overhead here is minimal. But then you need t

Re: Is this not a security issue?

2007-07-30 Thread housebolt
Hmm... well usually what you'd want to do is put the secret value into a session variable, $this->Session->write('secretvalue', 'whateverthesecretvalueis'); Once the person has posted the value from the hidden input tag, you can then check it against the secret value to make sure that they're th

Re: Cake PHP running dead slow

2007-07-30 Thread housebolt
I've read discussions from people in the cake core group to this affect, and I've seen it in my own work as well, especially with many large models, which is usually the case for me since I try to keep my controllers as lite as possible. It may not be as large an issue since 1.11 (i think that's w

Re: Cake PHP running dead slow

2007-07-30 Thread housebolt
Well, sort of, if your model is set up like this: You should be able to use the model "Profile" in your controller like this: if($this->User->save($this->data['User'])) { $this->User->Profile->save($this->data['Profile']); } But you can use bindModel for this as well. Same concept, just

Re: Is this not a security issue?

2007-07-30 Thread Larry E. Masters aka PhpNut
No it is not... http://api.cakephp.org/class_model.html#ebe42ae387be89985b5a35dd428f5c81 The third param in the save method is what you are looking for in 1.1 same goes for 1.2 but version 1.2 also has the security class that does a little more magic. -- /** * @author Larry E. Masters * @var st

Is this not a security issue?

2007-07-30 Thread morecakepls
Hi What if my table is named User and there are three fields called Username, Password, Secretvalue. I present the user a form to change the username and password and use the $this->User->save($this->data) function in the controller to save the form data to the database. I managed to use firefox

Re: AssetPackager for CakePHP

2007-07-30 Thread Brad Daily
Good catch Howard. I just realized that since we store the cake directory in a non-standard location in our application, I had gotten my wires crossed when setting up those paths. I've just updated the package with the fix and a few others I found this morning. If you store cake in a non-standard

Re: Idea about bin

2007-07-30 Thread Chris Hartjes
On 7/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > so maybe cake team can add option to code's comment in > http://bin.cakephp.org/saved/20450 > Perhaps there is a language barrier here, but I don't quite understand the question? As far as I can tell the bin is only for temporary code

Idea about bin

2007-07-30 Thread [EMAIL PROTECTED]
so maybe cake team can add option to code's comment in http://bin.cakephp.org/saved/20450 --~--~-~--~~~---~--~~ 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.

Paginating results of custom queries?

2007-07-30 Thread kionae
Is there any way to just pass an array into 1.2's paginate function and have it paginate the data? Essentially, I have an array that is a set of search results returned by some custom queries and a bit of manipulation. I couldn't generate the results I needed by going through $this->paginate bec

Re: Using models in app controller for default.thtml ???

2007-07-30 Thread Geoff Ford
If you need the component in your default layout put it in the app_controller.php Helpers are for pure presentation logic, such as looping an array and creating a tree. A component is used whenever there may be business logic, such as if this is the main cat then these are the subcats. You proba

Re: AssetPackager for CakePHP

2007-07-30 Thread Howard Glynn
Brad I've got this up and running, it appears to work well and does what it say!! However on the current download linked from the bakery, i think there is a superfluous 'app' string. In vendors/shells/asset_packager, lines 49 and 54 you construct the path as APP . 'app' and when I use the cake co

Re: Updating Div with ajax

2007-07-30 Thread madmike210
Thanks for the help, and suggestions. --~--~-~--~~~---~--~~ 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 [E

How do I make a Behavior?

2007-07-30 Thread [EMAIL PROTECTED]
I'm trying to make a behavior for my site, but I can not make it work. I'm using cakePHP 1.2 This is what I have so far: Model: // apple.php settings[$model->name] = $settings; } function test(&$model) { return "test"; } } ?> And in the controller, wher

Re: visit counter

2007-07-30 Thread starkey
I would suggest the footer of your layout (cake/app/views/layouts). Have fun. On Jul 30, 3:06 pm, Oscar Burgos <[EMAIL PROTECTED]> wrote: > any sugestion about the best place to embed to code for visit counter > like google analytics or something like that? > > thank you > > Óscar --~--~-

visit counter

2007-07-30 Thread Oscar Burgos
any sugestion about the best place to embed to code for visit counter like google analytics or something like that? thank you Óscar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this

Help with project design

2007-07-30 Thread nagarjuna
Hello, I am designing a database to hold scientific observations of animals in the field. The database will be used for several different projects. The basic unit for all projects is the observation, and observations across projects will store the same basic information (and use the same logic),

Re: Newbie Introduction Book ... reviews anyone?

2007-07-30 Thread Dave
Hey all-- This thread is getting a little packed with all the requests. Wonderful! However, we don't want to cram up this thread with requests and all relating to the book. I'm therefore urging you to visit me directly at my forum thread dedicated to the book: http://www.davidgoldingdesign.com/f

Re: Use finderQuery in HABTM associations

2007-07-30 Thread rtconner
You could try to look aroudn a bit first. http://groups.google.com/group/cake-php/browse_thread/thread/5ac2bdec0cc6115b/f008cdcaf77a5c80#f008cdcaf77a5c80 On Jul 30, 8:28 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > HI > I 'm newbie of cake. > I would ask a help. > Can someone make me an e

Re: ACL needs modification for Oracle

2007-07-30 Thread John David Anderson (_psychic_)
On Jul 30, 2007, at 11:58 AM, starkey wrote: > > Just a note for future generations... ACL in cake_1.1 uses table > column names starting with an underscore. Oracle does not allow > columns starting with '_' so you will need to modify the classes. > When I'm done testing I'll append them to th

ACL needs modification for Oracle

2007-07-30 Thread starkey
Just a note for future generations... ACL in cake_1.1 uses table column names starting with an underscore. Oracle does not allow columns starting with '_' so you will need to modify the classes. When I'm done testing I'll append them to this post (or somewhere more appropriate?). Regards, Shawn

Re: Reusing view code

2007-07-30 Thread rtconner
Are you trying to use more one view for an action? That kid of goes against the MVC concept. You might want to rethink how you handle your view. On Jul 30, 7:19 am, safl <[EMAIL PROTECTED]> wrote: > This seems like the thing to do. > > I have one issue... only the first $this->render(...,'ajax');

Usinf DATE_FORMAT Expression in findAll()

2007-07-30 Thread keys71
Hi folks, maybe somone can help me. I want to convert a date field (mySql) in german date format. The mysql query would be: ...DATE_FORMAT(validity_date, '%d.%m.%Y') as formatted_date I tried the following as test without formatting inside the controller and index() - function $this->set(

Re: Updating Div with ajax

2007-07-30 Thread francky06l
You can also integrate the component 'RequestHandler' in your controller, that should handle the ajax layout automatically :-) On Jul 30, 5:51 pm, "John David Anderson (_psychic_)" <[EMAIL PROTECTED]> wrote: > On Jul 30, 2007, at 9:36 AM, madmike210 wrote: > > > > > > > In a view, I would like t

Re: Updating Div with ajax

2007-07-30 Thread John David Anderson (_psychic_)
On Jul 30, 2007, at 9:36 AM, madmike210 wrote: > > In a view, I would like to be able to click on a button and have the > index displayed in a div. I accomplish this by doing the following in > a view: > > GROUP VIEW > USER VIEW > > div('main_div'); ?> > divEnd('main_div'); ?> > > However, the

Updating Div with ajax

2007-07-30 Thread madmike210
In a view, I would like to be able to click on a button and have the index displayed in a div. I accomplish this by doing the following in a view: GROUP VIEW USER VIEW div('main_div'); ?> divEnd('main_div'); ?> However, the index.thtml is displayed in the div with the information generated by

Re: AssetPackager for CakePHP

2007-07-30 Thread Brad Daily
Looks like the Bakery article is live: http://bakery.cakephp.org/articles/view/assetpackager-for-cakephp Brad --- Brad Daily Developer, SlideShowPro Director [EMAIL PROTECTED] On Jul 30, 2:52 am, Brad Daily <[EMAIL PROTECTED]> wrote: > On Jul 30, 12

Re: $this->action = images ??

2007-07-30 Thread starkey
THANK YOU! On Jul 30, 12:08 am, Grant Cox <[EMAIL PROTECTED]> wrote: > Or, are you referring to any images in your view that have a relative > path (and you aren't using the HTML helper image() function)? > > If you view localhost/users/index, and there is a relative image > "images/yourimage.j

Use finderQuery in HABTM associations

2007-07-30 Thread [EMAIL PROTECTED]
HI I 'm newbie of cake. I would ask a help. Can someone make me an example of the use of the finderQuery in a HABTM association? Many Thanks Marco --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To

Re: Using models in app controller for default.thtml ???

2007-07-30 Thread [EMAIL PROTECTED]
Thanks Ford, should i add var $components = array("MyComponent"); in the app_controller.php ? Also instead of creating component what u think of creating an helper ? I think it can be used as component ? Please let me know. Thanks On Jul 30, 4:58 pm, "Geoff Ford" <[EMAIL PROTECTED]> wrote: >

Re: inserting controller view into another view

2007-07-30 Thread Chowsapal
How about request action (http://api.cakephp.org/ class_object.html#c40a38b60a3748b9cf75215b92ee3db1). There's a parameter that specifies if an action is being called by another page (though it's name escapes me at the moment). You could use that to send a different layout when it's inside anoth

Re: Reusing view code

2007-07-30 Thread safl
This seems like the thing to do. I have one issue... only the first $this->render(...,'ajax'); Is actually rendered, the rest arent? In my controller i got for each action: ... if ($this->RequestHandler->isAjax()) $this->RequestHandler->renderAs($this, 'aj

Re: Using models in app controller for default.thtml ???

2007-07-30 Thread Geoff Ford
Components are loaded with var $components = array("MyComponent"); and used similar to models i.e. $this->MyComponent->function(); See http://manual.cakephp.org/chapter/components for more details. Geoff On 7/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Thanks for you replies friend

Re: So many queries for a belongsTo association...

2007-07-30 Thread Saymons
Why ? It is just a BelongsTo association, Cake joins this on other cases... On 26 juil, 20:27, majna <[EMAIL PROTECTED]> wrote: > cake cant join this. try with raw query. > > On Jul 26, 7:14 pm, Saymons <[EMAIL PROTECTED]> wrote: > > > Thanks for your answer, but that's not my problem, I need $t

Re: So many queries for a belongsTo association...

2007-07-30 Thread Saymons
I found someone who has quite the same problem : http://groups.google.com/group/cake-php/browse_thread/thread/b97c38e4c36fc781/5ec8f3b72282ce69?lnk=gst&q=queries&rnum=3#5ec8f3b72282ce69 https://trac.cakephp.org/ticket/2448 But in my case, there are not join at all, that makes me unhappy because i

Re: Newbie Introduction Book ... reviews anyone?

2007-07-30 Thread Feris Thia
On 7/28/07, Dave <[EMAIL PROTECTED]> wrote: > > I'm working on a Newbie's Introduction to CakePHP book and would like > to invite anyone who would like to review it for errors or > considerations I may have overlooked. Let me know, and I'll send you a > PDF copy of the current edition. Hi Dave, I

Re: inserting controller view into another view

2007-07-30 Thread rtanz
i see, is there some documentation somewhere so i can read more about this? On Jul 30, 5:13 am, Grant Cox <[EMAIL PROTECTED]> wrote: > Using AJAX, quite easily - just populate an area of your page with the > remote index action. If you can't use AJAX, not so easily (but more > efficiently). You

Re: Cake PHP running dead slow

2007-07-30 Thread phpjoy
i think that he ment to use the bindmodel() instead of loading a new model.. user->profile->func(); instead of loadModel('user'); loadModel('profile'); i wondered what's the performance difference. On Jul 30, 1:30 am, Grant Cox <[EMAIL PROTECTED]> wrote: > On Jul 29, 4:45 pm, housebolt <[EMAIL

Re: Newbie Introduction Book ... reviews anyone?

2007-07-30 Thread luke BAKING barker
sorry I see you did briefly mention CocoaMYsql and also I see the excellent HeidiSQL later on, apologies! luke On Jul 30, 10:51 am, luke BAKING barker <[EMAIL PROTECTED]> wrote: > Hi David, looks good just flicking through it quickly now. > > I develop on a Mac - you should mention XAMPP (MAMPP)

Re: Newbie Introduction Book ... reviews anyone?

2007-07-30 Thread luke BAKING barker
Hi David, looks good just flicking through it quickly now. I develop on a Mac - you should mention XAMPP (MAMPP) which is also free and is easy enough to install. Also the free Mac-only CocoaMySQL is my new love with CakePHP designing - so much better than using PHPMyadmin. Also TextMate is ideal

Re: Newbie Introduction Book ... reviews anyone?

2007-07-30 Thread Daniel Hofstetter
Looks great! As the books grows it would be useful to have a table of content. Another point I think is missing are the naming conventions (e.g. that table names are plural by convention). HTH -- Daniel Hofstetter http://cakebaker.42dh.com --~--~-~--~~~---~--~

Re: Using models in app controller for default.thtml ???

2007-07-30 Thread [EMAIL PROTECTED]
Thanks for you replies friends, i am new to cakephp can you tell me how can i load component in it. Also stil i have develop an component but i will try and create it and let u know. but pls tell me how can i load a compnent and how can i include it in the default.thtml. Thanks On Jul 30, 7:26

Re: Newbie Introduction Book ... reviews anyone?

2007-07-30 Thread nirmal
I would like to take a look. Please send a copy as soon as possible On Jul 27, 11:14 pm, Dave <[EMAIL PROTECTED]> wrote: > I'm working on a Newbie's Introduction to CakePHP book and would like > to invite anyone who would like to review it for errors or > considerations I may have overlooked. Let