Re: the essential mix of cakephp tips (community edition)

2009-11-29 Thread teknoid
Thank you... and that's it? ... I was honestly hoping for a little more enthusiasm. C'mon people I know you got 'em ;) On Nov 29, 7:02 am, robustsolution wrote: > Hi teknoid, > > "DO NOT HACK THE CORE AT ANY RATE, AND THIS IS FOR FORWARD > COMPATIBILITY / MIGRATI

the essential mix of cakephp tips (community edition)

2009-11-28 Thread teknoid
Hello Dear Bakers, I am looking to put together the next collection of the latest, greatest and coolest cakephp tips (for 1.2 & 1.3 builds). Supplied by everyone and anyone in this great community. The article will be published on the bakery with all proper credits given where they are due. Been

Re: CakeFest IV - America - Help us pick a location!

2009-11-16 Thread teknoid
I have to pick Miami, as we'd be willing to help sponsor it here ;) On Nov 15, 8:23 am, WidgetMan wrote: > When looking to organize a successful IT conference, I tend to create > a matrix that would rank each suggested location into decisive > categories. The categories I use are 'City Accessibil

Re: requestAction Alternative, whats the better way?

2009-10-09 Thread teknoid
use saveAll()... but why would you want to create a blank profile in the first place? On Oct 9, 9:34 am, toneee wrote: > Hi, > > I have 2 controllers so far a users and profiles > > They have the usual Index, add, edit and delete functionality. > Basically the problem i have run into is that whe

Re: Just curious question

2009-09-26 Thread teknoid
... haven't tested, but something like this should work: In the model: $this->myFields = array('field_one, 'field_two', 'and_some_other'); public function modifyRequiredFields($additionalFields) { array_push($this->myFields, $additionalFields); return $this->myFields; } In the controller: $t

Re: if ($loggedIn == 0){

2009-06-08 Thread teknoid
use $session->check(), which returns true/false if the given key exists. On Jun 8, 4:58 pm, cakephp_rocks wrote: >             [Auth] => Array >                 ( >                     [User] => Array >                         ( >                             [id] => 15 >                        

Re: cakeError

2009-02-07 Thread teknoid
add boiler plate code in all the places they > occur (sending an email for example). > > I realize that there are ways to implement this type of functionality > with the tools that cakephp offers its just that i thought that this > was part of the error handling mechanism. > >

Re: cakeError

2009-02-06 Thread teknoid
What errors do you want to display to the user, while running in production mode? That being asked, you might take a look here on how to handle this situation: http://teknoid.wordpress.com/2008/08/29/dealing-with-errors-in-cakephp/ On Feb 6, 11:54 am, maxmil wrote: > I have found the same pro

Re: CakePHP, data sanitization and methods params

2009-02-04 Thread teknoid
ind dbo source drivers, there is a value() method, which... if you take a peek at the source will say that it: "Prepares a value, or an array of values for database queries by quoting and escaping them." On Feb 4, 6:01 pm, Mee wrote: > Hello, > > Just a little question, if I get a parameter in a

Re: need Help on Internationalization in CakePHP

2009-02-04 Thread teknoid
Hopefully this will shed some light on the things that are not covered in the manual: http://teknoid.wordpress.com/2008/11/28/cakephp-url-based-language-switching-for-i18n-and-l10n-internationalization-and-localization/ On Feb 4, 9:50 am, Elianora wrote: > Hi ! > > I'm new with Cake and with ge

Re: Top 10 Framework

2009-02-02 Thread teknoid
Top 10 this, top 10 That... you know that 87% of all statics are misleading :) Use the one that makes sense for your project and the one that you like working with... There is no fair comparison of any framework that would be equally great for any application. (Well, besides cake of course ;))

Re: Created & Modified no longer set

2009-01-29 Thread teknoid
Any defaults set in the DB? Cleared the model cache? On Jan 29, 9:17 pm, Chad Casselman wrote: > I just updated one of my apps with the latest of cakephp (just replaced the > cake folder) and now when items are insert the created and modified dates > are set to all 0s. > > Any thoughts on this?

Re: Twitter - component / model / datasource

2009-01-29 Thread teknoid
Your feeling is correct. Here's what Felix did for Google Analytics: http://debuggable.com/posts/new-google-analytics-api:480f4dd6-c59c-445f-8ce0-4202cbdd56cb It should serve as a nice blue print for building a Twitter datasource... On Jan 29, 10:28 am, hellfish wrote: > I've seen the component

Re: svn or git?

2009-01-29 Thread teknoid
Using Git is cool. Don't you wanna be cool? :) All the kids are using it, you should try it too... On Jan 29, 10:07 am, leo wrote: > @martin - yep I agree. I've tried them both and Cornerstone is great. > I don't like paying for stuff like that though. The kind of things > that are almost alway

Re: Set::combine (or maybe merge and a couple extracts)

2009-01-29 Thread teknoid
to avoid looping over the > resultset, this little nugget might be very handy in AppModel, as you > suggest. Thanks! > > On Thu, Jan 29, 2009 at 2:03 AM, teknoid wrote: > > > Not a one-liner, but perhaps it'll be helpful... > > >http://teknoid.wordpress.com/2008/09/2

Re: isUnique case-sensitivity off ??

2009-01-28 Thread teknoid
override isUnique in your model and use something strtolower() when searching for a given field or comparing the value. On Jan 29, 1:52 am, forrestgump wrote: > Hey guys, >   Need help with this... > i have validation rules defined as thus: > var $validate = array( >                         'city

Re: Set::combine (or maybe merge and a couple extracts)

2009-01-28 Thread teknoid
Not a one-liner, but perhaps it'll be helpful... http://teknoid.wordpress.com/2008/09/29/dealing-with-calculated-fields-in-cakephps-find/ On Jan 29, 1:50 am, brian wrote: > Paging grigri ... ;-) > > I have some data that is the result of a stored procedure call that > I'm struggling to re-shape

Re: Question about unnecessary files in cake app - will it cause slow response

2009-01-20 Thread teknoid
Have you noticed any difference? I don't think this is the case any longer, as it was with some vendor files in the early 1.2 releases. On Jan 20, 1:40 pm, escape wrote: > I read the thread about "slow response" some weeks ago and I've had > this nagging thought. > > In that thread it was menti

Re: Solution for static page with no "pages" in URL

2009-01-20 Thread teknoid
This is a simple solution, that I prefer. I ensure that all links to static pages point to .html file So our link: www.example.com/pages/about_us Becomes: www.example.com/about_us.html (i.e. echo $thml->link('About Us', '/ about_us.html'); ) Then a single route takes care of the rest (for

Re: How do I access a HABTM relationship from another model?

2009-01-16 Thread teknoid
That's not a good idea, because since your models are related they are already loaded. Actually, using $uses is rearely a good idea. The only time you might consider it, is when you need an absolutely unrelated model... Even still... within your action you can load the model just when you need i

Re: parameters with /

2009-01-16 Thread teknoid
> can't get around my problem some other way :) > > In my current project I actually have a few but in those cases doing > without it is too complicated for my taste and in only one instance is > the processing overhead an issue. > > /Martin > > On Jan 15, 3:05 pm,

Re: Save flow behaviour ..

2009-01-15 Thread teknoid
sounds like your model isn't found, so cake uses an instance of AppModel, which of course doesn't have beforeSave() defined. make sure the file is named correctly. On Jan 15, 7:22 am, "Marcelo Iwata" wrote: > At cakePHP documentation, it's clear that beforeSave have to return true to > continue

Re: Validate date from model

2009-01-14 Thread teknoid
You'll need to write a custom function to compare two dates. How to do that is explained in the manual. As far the actual function, there are tons of examples if you search for something like "php date compare" on google. On Jan 14, 3:56 am, Mike wrote: > Hi everyone, > > I'm a new user of CakeP

Re: Tabs in Layout... Help Please.

2009-01-14 Thread teknoid
If I understand this right, you are looking to set an "active" tab, based on the view you are currently in... It can be done easily from the view itself, i.e. in view_one.ctp: $this->set('tabOne', true); (which is now going to be available in your layout). Therefore, in the layout you could do:

Re: parameters with /

2009-01-14 Thread teknoid
Any params can be passed like: /controller/action/param1/param2/param3 Or as named params: /controller/action/name:bob/city:paris/ account:active to see the params in your controller pr($this->params) p.s. It is almost always a bad idea to use requestAction() ;) On Jan 14, 9:55 am, Mario Cesar

Re: really simple authentication

2009-01-08 Thread teknoid
If you need a singe password for basic Auth, the Security component allows you to handle that very easily: http://book.cakephp.org/view/473/Basic-HTTP-Authentication On Jan 8, 4:19 pm, fain182 wrote: > hello, > I need to protect a whole cakephp site under one password, i don't > need user, gro

Re: Save() not updating rows

2009-01-08 Thread teknoid
seems like you are only changing one field, probably saveField() is a better approach in this case On Jan 8, 5:12 pm, Miles J wrote: > This is usually called in a loop. And the docs said to use create() in > loops, so I guess you don't need create() for updating rows then? > > Ill test what you

Re: Auth and Session Variables

2009-01-08 Thread teknoid
$this->Auth->user(); or pr($this->Session->read()); to see what you have available. ... it's all in the manual by the way. On Jan 8, 5:21 pm, "Chad Casselman" wrote: > I have the basic Auth working, but there isn't any information in the Session. > > I was trying to use the code I found to acc

Re: is this bug

2009-01-08 Thread teknoid
If the debug is set to 0, you'll always get a 404 page regardless of what the actual problem is. So it sounds like some issue in your code. On Jan 8, 4:24 pm, "mohammad al-ani" wrote: > ok I was on the high level security but I tried it with the medium and low > level and the problem still appea

Re: how to get the find result more convenience?

2009-01-07 Thread teknoid
In most cases you should not be using query()... you are not utilizing the framework in the best way. Please look at the manual, there are plenty of example showing how to do a find() to get what you need. Not to mention the Containable behavior and other goodies provided by the community. On Jan

Re: How to upgrade to a new release?

2009-01-07 Thread teknoid
docs, or vendors? (I'm haven't changed anything in docs or > vendors). > > On Jan 6, 9:40 pm, teknoid wrote: > > > All you have to do is replace your 'cake' core dir. > > There aren't any major changes between RC3 and RC4. > > ... All that being sa

Re: new benchmarks of PHP frameworks

2009-01-07 Thread teknoid
It's been said before, but I'll say it again index.html is the fastest framework of them all when it comes to outputting "hello world". If you've optimized the SQL, enabled caching on all tiers of your application and made sure you've followed the rules (i.e. no requestAction() or aggressive

Re: How to upgrade to a new release?

2009-01-06 Thread teknoid
All you have to do is replace your 'cake' core dir. There aren't any major changes between RC3 and RC4. ... All that being said you should upgrade (again by simply replacing the cake dir) from RC3 directly to 1.2 Final, without any problems. On Jan 6, 7:05 pm, Brenda wrote: > I'm working on my

Re: how to get the find result more convenience?

2009-01-06 Thread teknoid
why are you using $this->query() and not $this->find()? On Jan 6, 8:38 pm, Rimoe wrote: > hi,everyone! > > I'm a newbie. > > I have saw In the bake view, If you want to use the resultset, > only use the $form->input('mail'), > > but the find result () > In the controller > $unreadcounts==$this->

Aptana users, make your voice heard!

2009-01-06 Thread teknoid
Let's vote for CakePHP integration (or any PHP framework, for that matter) into this excellent IDE! http://www.aptana.com/roadmap/2009/survey1 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To pos

Re: the Gift of 1.2 Final

2008-12-26 Thread teknoid
Congrats, guys! Really proud of all of your accomplishments. And of course a big THANK YOU for making my life... oh... just a "little bit" easier ;) On Dec 25, 7:51 pm, Gwoo wrote: > //Warning: this message is long and full of goodies. > > History does not happen, it is made. > > Today, the his

Re: find conditions problem (tables don't join)

2008-12-26 Thread teknoid
there's the hard part... understanding how find() works! I think > > > I'm pretty close to understanding it, but for what I was doing I > > > simply ran out of time and could not justify struggling with find() > > > anymore. I read so many articles on Google, read

Re: custom SQL query - all values IN() bust be AND

2008-12-23 Thread teknoid
I have a weird feeling that this post might be related to what you are trying to accomplish: http://teknoid.wordpress.com/2008/08/06/habtm-and-join-trickery-with-cakephp/ Well, hopefully it does help somehow ;) On Dec 22, 11:21 am, dev wrote: > i'm building custom SQl query and need a little he

Re: Thoughts on this blog post?

2008-12-23 Thread teknoid
poorly written post, by someone who lacks any serious knowledge of the framework. imo, it would be advisable to understand the framework before making such "educational" posts. How about this? "Although I know very little about Zend, here are my X reasons to hate it..." Would you take a post wit

Re: find conditions problem (tables don't join)

2008-12-19 Thread teknoid
query() is not a recommended practice... besides a few points you've mentioned (and don't think that portability is not important, you'd be surprised what happens when oracle invests $1M into your company, but now you gotta switch DB's ;)), i've outlined a few more here: http://teknoid.wordpress.

Re: A newbie question (I'm unable to find it answered)

2008-12-19 Thread teknoid
" it seems natural to me to define afterFind() to make > sure the boolean flag is always printed out like "Yes" and not "1". > > Thanks > > On 19 Dic, 00:18, teknoid wrote: > > > helpers are not meant to be used in the models, they are only to be >

Re: Sanitize Question

2008-12-19 Thread teknoid
Doesn't seem like it would be necessary... The only data that's "dangerous" for your DB is any sort of SQL exploit, which you are already protected from by the core. (i.e. the values are escaped before insertion or selection from DB). On the other hand, you do need to make your data safe in the v

Re: find conditions problem (tables don't join)

2008-12-19 Thread teknoid
here's more info on it: http://rafaelbandeira3.wordpress.com/2008/11/16/linkable-behavior-taking-it-easy-in-your-db/ On Dec 19, 12:31 pm, teknoid wrote: > Here's another thing you can > try:http://github.com/rafaelbandeira3/cakephp-plugins/tree/master/plugins... > &g

Re: find conditions problem (tables don't join)

2008-12-19 Thread teknoid
Here's another thing you can try: http://github.com/rafaelbandeira3/cakephp-plugins/tree/master/plugins/linkable_behavior/models/behaviors/linkable.php This is a very nice behavior that will construct JOINs for you... There is a small example of usage in the comments of the code, in a way it is s

Re: A newbie question (I'm unable to find it answered)

2008-12-18 Thread teknoid
helpers are not meant to be used in the models, they are only to be used in views. if you need something similar to what a helper method does, you could just take a look at the code and re-create a method to be used in your model or app model. On Dec 18, 5:05 pm, ark0n3 wrote: > I'm experimenti

Re: Newbie-question: Store multiple model-objects with just one form

2008-12-17 Thread teknoid
That's exactly what saveAll() is for... http://teknoid.wordpress.com/2008/08/01/practical-use-of-saveall-part-1-working-with-multiple-models/ There are a few other posts regarding this topic on my blog... Also, it is covered in the manual ;) On Dec 17, 4:38 pm, volka wrote: > Hi there, > I'd li

Re: Is CakePHP 1.2 fully backwards compatible with 1.1.16?

2008-12-12 Thread teknoid
No, you'll need to do quite a few adjustments to make it work exactly right. Then there is a switch to 1.2 features... i.e. even though things may work as is, there has been a number of improvements that you should take into account and modify your app to follow the latest recommended practices...

Re: $form->input() helper question

2008-12-11 Thread teknoid
You can pass a CSS class specifically to your label element. i.e. $form->input('MyModel.my_field', array('label'=>array ('text'=>'Please enter something here', 'class'=>'class-for-this- label'))); On Dec 10, 6:43 pm, maytawn wrote: > I have an instance where I need to increase the width and st

Re: Problem with foreignKey in cake PHP

2008-12-08 Thread teknoid
t;[EMAIL PROTECTED]> wrote: > It's common with a lot of databases. Again, the workaround is to add > an ID column. > > On Sat, Dec 6, 2008 at 12:33 PM,  <[EMAIL PROTECTED]> wrote: > > But this case is common in MSSQL, and I need use it. -.-! > > > 2008/12/5

Re: Custom queries/sql in models/behaviors

2008-12-05 Thread teknoid
> I am not a big fan of the model system because its very limiting if you have > advanced queries. How did you come to that conclusion? ... If you properly created your models and associations, a simple find ('all') will give you: Team, Roster, Game and League models with all the relevant info

Re: Problem with foreignKey in cake PHP

2008-12-05 Thread teknoid
There is no support for composite keys in CakePHP. Add an 'id' column to your table. On Dec 5, 3:34 pm, Sabinas <[EMAIL PROTECTED]> wrote: > Hi, I dont speak englis very well but I will try. Mi problem is: > > I have a table but this table have a primary key with two columns, an > example: > > su

Re: Id missing when saving extra fields in the join table (for HABTM models)

2008-12-02 Thread teknoid
Does your join table have a primary key? If using MySQL are your tables InnoDB? (MyISAM tables do not support transactions, so it might look like it's working, but you'll run into problems). On Dec 2, 12:12 am, jsmale <[EMAIL PROTECTED]> wrote: > Hi, > > After extensive reading, I've followed te

Re: Validation Question/Form Question

2008-11-25 Thread teknoid
first you need allowEmpty => true for your radio buttons then, you simply need a custom validation rule for the 'other' field 'other => array('rule'=>array('checkOther')); function checkOther() { if(///check if radio buttons are empty && 'other' is not decimal///) { return false; } re

Re: How should I associate these tables?

2008-11-25 Thread teknoid
I assume in that case you'll need to create a model for your join table (which is otherwise created for you)... and specify which schema (db) it uses. Otherwise, if you can, move them all to the same schema. On Nov 25, 7:55 am, Antônio Marco <[EMAIL PROTECTED]> wrote: > Thanks, te

Re: NotContain?

2008-11-24 Thread teknoid
If you find yourself doing the same conditions/contain key over and over define some default in the model, i.e. var $containment = array(...); You can then use it like $this->SomeModel->find('all', array ('contain'=>$this->SomeModel->containment)); On Nov 24, 2:58 pm, thatsgreat2345 <[EMAIL PRO

Re: How should I associate these tables?

2008-11-24 Thread teknoid
This is a basic HABTM (hasAndBelongsToMany) relationship. Read up on it in the manual... you should also rename the join table (if you'd like to keep consistent with conventions). On Nov 24, 2:40 pm, Antônio Marco <[EMAIL PROTECTED]> wrote: > Hi folks! > > I created 3 tables as shown bellow: > >

Re: several database settings

2008-11-21 Thread teknoid
why not have two config files? one for production and one for test? On Nov 21, 5:45 pm, "Ricardo Valfreixo" <[EMAIL PROTECTED]> wrote: > Hello once more. I'm a real pain, I know.. > > I have two database settings. one $default and one $production. How can I > make the code sensitive to the url? I

Re: regarding scaffolding

2008-11-21 Thread teknoid
on/off On Nov 21, 12:29 pm, "Ricardo Valfreixo" <[EMAIL PROTECTED]> wrote: > When I use the var $scaffold; I can still write functions and overwrite > scaffolding defaults? Like the new/edit/delete functions? Or scaffolding is > a on/off feature? > > Zen --~--~-~--~~~-

Re: After database update, using only scaffolding, successful query shows - but no page

2008-11-21 Thread teknoid
everything looks perfectly fine for me... On Nov 21, 11:59 am, XefNed <[EMAIL PROTECTED]> wrote: > This is a crazy one, I hope someone can help me figure this out > because I'm at the banging-my-head-against-the-wall stage. > > CakePHP works fine for a couple of days - then suddenly stops > redir

Re: Model::find returns different results under different debug settings (possible bug?)

2008-11-21 Thread teknoid
Possibly using cached model with debug set to 0. Otherwise there should be no difference. You can still monitor the generated queries with something like: http://mtop.sourceforge.net/ On Nov 21, 11:39 am, RyOnLife <[EMAIL PROTECTED]> wrote: > Hello, I have encountered a strange problem. With deb

Re: Append some php code to every view

2008-11-21 Thread teknoid
add it to your layout. On Nov 21, 11:23 am, Ernesto <[EMAIL PROTECTED]> wrote: > Hello. > > i have a routine that builds a menu based on some arrays defined in > every view. > this routine uses a pair of helpers. > > is there any way to include this buch of PHP lines at the end of every > view? (

Re: Model::save() not executing

2008-11-20 Thread teknoid
But if your save isn't even attempted, chance are on of the models is failing validation On Nov 20, 2:53 pm, RyOnLife <[EMAIL PROTECTED]> wrote: > Array is fine. I think it might be a model problem. > > On Nov 20, 4:30 am, ravindranathbe <[EMAIL PROTECTED]> wrote: > > > With respect to the array

Re: Model::save() not executing

2008-11-20 Thread teknoid
If you know both models id's you should be saving directly into the join table. $data['JoinTableModel']['label_id'] = 1; $data['JoinTableModel']['item_id'] = 2; $this->SomeModel->JoinTableModel->save($data); (the join table model is auto created for you, read up in the manual) On Nov 20, 2:53 

Re: isHashed Custom Validation

2008-11-20 Thread teknoid
1. app model is fine... or make it a behavior. On Nov 20, 12:24 pm, bingo <[EMAIL PROTECTED]> wrote: > Hi bakers, > > I am trying to write a custom validation function that checks if a > string is already hashed or not. I want to make sure that password > filed are hashed and if not then hash the

Re: Best practice MVC Drop Down

2008-11-19 Thread teknoid
use find('list'); ... it's covered in the manual On Nov 19, 5:34 pm, pkclarke <[EMAIL PROTECTED]> wrote: > What is the best way to populate a Drop Down list from data stored in > the database?  Assuming that only selected fields are required and the > data needs to be filtered to returns selected

Re: How to add colour to product? [Models associations/relations, habtm?]

2008-11-19 Thread teknoid
If you have both id's you should just save directly in to the join table. $data['ColoursProduct']['product_id'] = 1; $data['ColoursProduct']['colour_id'] = 2; $this->Product->ColoursProduct->save($data); Note, the join table model is auto-created for you... I have a few other posts that describ

Re: difference in model and controller name

2008-11-17 Thread teknoid
Either you are using some really really old release of cake, or you did something incorrectly. Cake will look for 'categories' table for a Category model by default. On Nov 17, 4:35 pm, introvert <[EMAIL PROTECTED]> wrote: > Hey, > > Its CategorIES instead of CategorYS. > > The error I get: > >

Re: Manage App's CSS/Scripts

2008-11-17 Thread teknoid
> - Having the ability to add view-specific CSS or Javascript That's what $scripts_for_layout is for. You use it in conjunction, with the false param for CSS and Javascript. So, for example, from your view: $html->css('my_css_file', 'stylesheet', array("media"=>"all" ), false); $javascript->link

Re: I don't like the html that the form-helper outputs

2008-11-17 Thread teknoid
As others have pointed out, making this kind of change is not going to fly... nor does it make a lot of sense. Besides extending the helpers, or making your own (to suit your specific needs), the included helper has a lot of flexibility. 1. You don't have to use $form->input(), you can use $form-

Re: validation rule help

2008-11-17 Thread teknoid
probably allowEmpty=>true, so when the field has no value it doesn't trigger validation On Nov 17, 10:33 am, ♫ killerBird <[EMAIL PROTECTED]> wrote: > Hi  All, > > I am stuck with the problem bellow : > > there is one drop down which let users select different type of > submition e.g : weburl , b

Re: .htaccess - Can't access subdirectory

2008-11-14 Thread teknoid
dir as in directory... wherever the webroot happens to be On Nov 14, 6:43 pm, "Xavier Mathews" <[EMAIL PROTECTED]> wrote: > dir as in directory root? > > On 11/14/2008, teknoid <[EMAIL PROTECTED]> wrote: > > > > > > > place your forum in the

Re: .htaccess - Can't access subdirectory

2008-11-14 Thread teknoid
place your forum in the webroot dir of your cakephp install. On Nov 14, 10:46 am, I Wayan Saryada <[EMAIL PROTECTED]> wrote: > Hello, > > I am currently installing CakePHP on the root of my web hosting. > CakePHP run well. On this domain I am also installing a phpBB forum in > the domain.com/foru

Re: accessing other model

2008-11-13 Thread teknoid
t() internally. On Nov 13, 11:16 am, validkeys <[EMAIL PROTECTED]> wrote: > hey Teknoid, > > what are the benefits of using $myModel = ClassRegistry::init > ('ModelName');  vs. App::Import('Model','ModelName')? > Also, > > rrd108, the problem

Re: Handy trick for forms that down offer all fields from model.

2008-11-13 Thread teknoid
will help you to avoid any trickery (unless you truly do not trust the source from which the data is coming). On Nov 13, 11:16 am, teknoid <[EMAIL PROTECTED]> wrote: > I assume you had 'required'=>true as part of the validation rules. > Seems like, yet another, misunde

Re: Handy trick for forms that down offer all fields from model.

2008-11-13 Thread teknoid
I assume you had 'required'=>true as part of the validation rules. Seems like, yet another, misunderstanding :) http://teknoid.wordpress.com/2008/11/04/requiredtrue-the-source-of-major-confusion/ On Nov 13, 9:02 am, Josey <[EMAIL PROTECTED]> wrote: > As a relatively new baker and programmer, for

Re: accessing other model

2008-11-13 Thread teknoid
In post you've done something wrong, if you include both models in the $uses array, they are easily accessible as: $this->M1->someMethod(); or $this-M2->someMethod(); Otherwise it's best to include the model, when you need it by using $myModel = ClassRegistry::init('ModelName'); $myModel->someMet

Re: created / modified fields necessary

2008-11-11 Thread teknoid
the only reason to include those fields, is if you need that information. On Nov 11, 6:10 pm, Zoltan <[EMAIL PROTECTED]> wrote: > Just wondering about if there's any performance or other reasons to > include created / modified fields in tables that probably don't change > much? > > I have a table

Re: Pass Session From NON Cakesite to Cakesite

2008-11-11 Thread teknoid
ensure that cookie session name is the same for both apps. see core.php On Nov 11, 1:17 pm, MDB <[EMAIL PROTECTED]> wrote: > Hello all,  I have a site named portal.mysite.com and a site called > cakephp.mysite.com.  My users log into portal.mysite.com so I wanted > them to be able to go directly

Re: Multiple exclusive BelongsTo relation

2008-11-11 Thread teknoid
Strange, my previous post didn't post, but just in case here it is again: Sounds like you need polymorphic behavior: http://bakery.cakephp.org/articles/view/polymorphic-behavior On Nov 11, 10:37 am, ThierryDD <[EMAIL PROTECTED]> wrote: > Currently, I define my BelongsTo relations as: > >   var $

Re: Integrating PHP and CakePHP

2008-11-11 Thread teknoid
That's a wrong approach. You either use a framework and follow its methodology (which means you have to rewrite what you had) or you just use good ol' PHP. "Integrating" is not really going to work. On Nov 10, 10:28 pm, TimA1116 <[EMAIL PROTECTED]> wrote: > I would like to integrate a 6 page for

Re: Where to place code for writing a file in order to respect MVC?

2008-11-11 Thread teknoid
If you want to get really fancy, you can make an iCal datasource or behavior, and make a separate model to handle interaction with this data format. On Nov 11, 9:20 am, fred <[EMAIL PROTECTED]> wrote: > > That would be true, if data was meant to be displayed to the user. > > If you are writing da

Re: Editing HABTM using Text input not Select input

2008-11-11 Thread teknoid
(which I > think would something like Facebook user search autocomplete), the user > can't add his own tag(s). > > Okto.Silaban.Net > > On Tue, Nov 11, 2008 at 3:54 AM, teknoid <[EMAIL PROTECTED]> wrote: > > > Look into some sort of auto-complete solution. > &

Re: set global var from DB

2008-11-10 Thread teknoid
Your code sets the var for the view, and I'm not really sure why. If you need a var in the session use $this->Session->write(); then you can easily access it from all your views and controllers. On Nov 10, 3:56 pm, brian <[EMAIL PROTECTED]> wrote: > On Mon, Nov 10, 2008

Re: Editing HABTM using Text input not Select input

2008-11-10 Thread teknoid
Look into some sort of auto-complete solution. jQuery has a few nice ones. You'll need to parse and properly format the data for saving yourself. On Nov 10, 3:31 pm, "Okto Silaban" <[EMAIL PROTECTED]> wrote: > Hi, > > I have this table relation : > > Post HABTM Tag > Tag HABTM Post > > Since may

Re: set global var from DB

2008-11-10 Thread teknoid
Write the ID to session. On Nov 10, 3:03 pm, brian <[EMAIL PROTECTED]> wrote: > I'm having some difficulty figuring out how to set a variable that I'd like > to retrieve from the DB and to make available application-wide. > > The site is an online journal and I need to have the latest edition ID

Re: Where to place code for writing a file in order to respect MVC?

2008-11-10 Thread teknoid
That would be true, if data was meant to be displayed to the user. If you are writing data to a file, cache or different data source, it can be handled at the model layer. On Nov 10, 1:11 pm, Rob <[EMAIL PROTECTED]> wrote: > In the MVC paradigm, data all goes through all three, and while you > ca

Re: Where to place code for writing a file in order to respect MVC?

2008-11-10 Thread teknoid
if you just need to write some data to the file system, you can do it right in the model. ...and in controller you could call it, like: $this->ModelName->exportAsiCal(); On Nov 10, 12:05 pm, fred <[EMAIL PROTECTED]> wrote: > Hello, > > I am new to CakePHP and MVC. I have created models to access

Re: Dilemma over choosing right model table structure

2008-11-10 Thread teknoid
Are you using GUID's id's and foregin_keys? If not, you could set yourself for some serious trouble down the road. Also, take a look at the polymorphic behavior, I think it might be some help here. On Nov 8, 6:43 am, Marcus Silva <[EMAIL PROTECTED]> wrote: > I think your solution is very good, b

Re: RC3 vs. SVN Checkout

2008-11-10 Thread teknoid
If you want the latest bug fixes, get the HEAD (branch) version. Of course there is a minor risk in getting something problematic (i.e. accidentally wrong commit), but in my experience that hasn't happened yet. I usually update once-twice a week. On Nov 10, 10:52 am, validkeys <[EMAIL PROTECTED]>

Re: Dilemma over choosing right model table structure

2008-11-07 Thread teknoid
if it's always going to be the same data, then you should go with a single table, and designate media_type column... on the other hand i see that you have a column hasThumb (or has_thumb)... that obviously cannot apply to audio. On Nov 7, 12:06 pm, Marcus Silva <[EMAIL PROTECTED]> wrote: > Hi fol

Re: Linking back to the CakePHP site ...

2008-11-07 Thread teknoid
This is not official, but I don't think there is any specific way you should link. You can grab a high-rez logo right off the list of files here, and use that if you'd like. Providing a link back to the cake site is a plus, which is not even expected, so as long as it's reasonably well done, ther

Re: Can CakePHP do what I need...

2008-11-07 Thread teknoid
You could make a separate element for each question. Each element would be rendered depending on where you are in the steps. You could do it with ajax, as well as what martin suggested and even the way you had it planned. In short, cakephp can certainly do what you need... the implementation is

Re: How to write a test case ?

2008-11-07 Thread teknoid
Just look at the existing test cases: http://api.cakephp.org/tests/ It shouldn't bee too hard to figure out. On Nov 7, 10:21 am, Rob <[EMAIL PROTECTED]> wrote: > Any pointers on learning about writing a test case for a bug ? > > I ran into an issue with Acl, and it was suggested I provide a test

Re: Finds: Contain vs. Unbind-on-the-fly

2008-11-06 Thread teknoid
ountry` WHERE `Country`.`id` = 2 > > SELECT `State`.`id`, `State`.`name`, `State`.`country_id`, > `State`.`created`, `State`.`created_by`, `State`.`modified`, > `State`.`modified_by` FROM `states` AS `State` WHERE `State`.`id` = 2 > > I'm hoping to have some time tonight to rea

Re: Inconsistency between displaying validation errors and validating with model.saveAll()

2008-11-06 Thread teknoid
There is nothing stopping you from naming your fields as: $form->input('Model.1.fieldname'); As a matter of fact, if you read about saveAll() in the manual, you'll see an example that uses that exact format. Regarding the 'fieldname.1' notation as in the form helper example, it clearly states th

Re: Finds: Contain vs. Unbind-on-the-fly

2008-11-06 Thread teknoid
                                            'Country', >                                                                   'State', >                                                                   > 'PrintSize'; > > On Nov 6, 2:18 pm, teknoid <[EMAIL PROTECTED]> wrote: > > > what's the relation between

Re: Finds: Contain vs. Unbind-on-the-fly

2008-11-06 Thread teknoid
gt;                                                                           > 'State', >                                                                           > 'PrintSize' => array('PhotographersPrintSize'); > > I still run into the i

Re: what can I do to speed up bootstrap > beforeFilter ?

2008-11-06 Thread teknoid
results are more often down around 0.06 and debug 1 is more > often around 0.08 or maybe up to 0.1 at times. > > On Nov 6, 8:42 pm, teknoid <[EMAIL PROTECTED]> wrote: > > > You have debug at 0, I presume? > > > On Nov 6, 2:35 pm, "[EMAIL PROTECTED]" >

Re: what can I do to speed up bootstrap > beforeFilter ?

2008-11-06 Thread teknoid
either way actually. > debug 0 results are more often down around 0.06 and debug 1 is more > often around 0.08 or maybe up to 0.1 at times. > > On Nov 6, 8:42 pm, teknoid <[EMAIL PROTECTED]> wrote: > > > You have debug at 0, I presume? > > > On Nov 6, 2:35 pm, "

Re: what can I do to speed up bootstrap > beforeFilter ?

2008-11-06 Thread teknoid
You have debug at 0, I presume? On Nov 6, 2:35 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > I have been migrating an application to 1.2 and partly because of some > threads about performance and benchmarking I have done my own > comparisons. Loading up a simple login form for my app

  1   2   3   >