HABTM filtering on find()

2009-07-06 Thread centr0
I have a Book and Author model thats a many to many relationship. I was wondering if there was a way in the BooksController that i can filter out books by author name, and in the AuthorsController filter out authors by book title. --~--~-~--~~~---~--~~ You

Call ClassRegistry::init in bootstrap.php

2009-07-06 Thread matt
Hi there, Loving cakephp! I'm fiddling around with dynamic routes in CakePHP and was getting on fine until I realised that using App:import will allow me to use a model within bootstrap.php but breaks any attached behaviors that model may have for use in a controller. If it helps, bootstrap

Re: Containable + HABTM + conditions PROBLEM [urgent]

2009-07-06 Thread Andreas D.
Thanks, but it doesn't work. Gives me this query: SELECT `Module`.`id`, `Module`.`position`, `Module`.`name`, `Module`.`created`, `Module`.`modified` FROM `modules` AS `Module` WHERE `Version`.`name` = 'covermount' and this error: 1054: Unknown column 'Version.name' in 'where clause' On 3 Jul.,

Re: Containable + HABTM + conditions PROBLEM [urgent]

2009-07-06 Thread Andreas D.
Well, I think the quick tip from nate about ad.hoc joins ( http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-in-model-find ) is exactly what I need. I tried it like this: $checklist = $this-Checklist-Product-Module-find('matches', array (

Re: Call ClassRegistry::init in bootstrap.php

2009-07-06 Thread matt
To follow up my question, I found a work around by putting the following into my Post controller public function beforeFilter() { if(!$this-Post-Behaviors-enabled('Tree')) { $this-Post-Behaviors-attach('Tree', array('left' = 'left', 'right' = 'right'));

Re: How can I paginate this array?

2009-07-06 Thread number9
The answer was actually really simple, I will post here in case it helps anybody else. I was trying to over-complicate things and pass a string to the paginate conditions, when an array was needed. (Now I look back, a string made no sense at all - but at least I'm learning!) First step, is to

Re: how can i define a form by myself

2009-07-06 Thread Teh Treag
Zin, Although, you can create a form without the formHelper, I wouldn't recommend it for a beginner. You need to be familiar with the form element naming convention. If you plan to use the securityComponent, you must use the formHelper. The helper is there to help you. ;) -teh On Jul 4,

Re: HABTM filtering on find()

2009-07-06 Thread Teh Treag
centro, This is covered in the manual. http://book.cakephp.org/view/78/Associations-Linking-Models-Together#hasAndBelongsToMany-HABTM-83 Good luck. -teh On Jul 6, 2:01 am, centr0 centrosc...@gmail.com wrote: I have a Book and Author model thats a many to many relationship.  I was wondering

Using phpThumb to automatically generate thumbnail images of user input?

2009-07-06 Thread eMilk
I'm using the phpThumb helper to try and automatically generate thumbnail images of the input http://bakery.cakephp.org/articles/view/phpthumb-helper-2 In my views/posts/add.ctp I have this line: echo $form-input('picture'); I basically would like the system to grab the URL to the

Re: Count RS for element

2009-07-06 Thread Luke
Hi, I just had a look at the CounterCache, but seem to struggle on the implementation. I added another field to my maincategories table: recipes_count I suppose I have to add now 'counterCache'=true to my Maincategory model, my relationships are currently looking like this

Re: How can I paginate this array?

2009-07-06 Thread Teh Treag
number9, Slightly, unrelated... instead of the for-loop, you can use $child_array=Set::extract('/Category/id', $children); $child_array[]=$name['Category']['id']; -teh On Jul 6, 3:56 am, number9 xpozit...@gmail.com wrote: The answer was actually really simple, I will post here in case it

Re: broken image - no clue

2009-07-06 Thread tobi_one
Thanks Dan for your input! There were no error messages and debug was set to 0 though. But today I found out what was causing the problem. I had an extra whitespace in the new model file after the ? tag which resulted in a broken header! Cheers, tobi_one On 25 Jun., 01:57, Dan Bair

Final solution for Autocomplete In cake1.2

2009-07-06 Thread bhushan A
Hi all, i have read too many posts for Autocomplete In cake1.2 . Discussion was too long but problem remains unresolved. Can anyone tell me exact solution for this. I have gone through http://bakery.cakephp.org/ articles/view/autocomplete. But its for 1.1. I have added component in

Spider Crawler to get the information required from specified website

2009-07-06 Thread nag
hii i want to develop a Spider Crawler to get the information required from specified website please anyone help me to do thank u --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this

CakePHP and the new MS SQL 2005/2008 Driver for PHP

2009-07-06 Thread idx
Hello, http://groups.google.com/group/cake-php/browse_thread/thread/8babbaf13192822c/0b31b9bfc3801f18?lnk=gstq=sqlsrv#0b31b9bfc3801f18 Regarding this old thread, has anyone modified the mssql class appropriately to work with Microsoft's new sqlsrv driver within CakePHP? I'm on the fence on

Question about relationships

2009-07-06 Thread Alastair
Hi guys, Hopefully a fairly straight forward question. I have the following two models: Member, User. User hasOne Member, Member belongsTo User. In my application, I have a Members admin area, which lists all the Members. I need to allow the admin to create a corresponding User for a Member and

Containable and Pagination

2009-07-06 Thread marco.rizze...@gmail.com
Hi I have a containable model. I would apply the pagination on the results inside contain. Example: Models : Document hasMany User In documents_controller.php I have this: $document=$this-Document-find('first', array( 'fields' = array('Document.*'), 'conditions' =

Re: Accessing name of the current plugin from inside a model

2009-07-06 Thread Pixelastic
As I couldn't find a solution, I resorted to add an inner $pluginName var to my *Plugin*AppModel. On Jul 4, 8:03 pm, Pixelastic timcc.pe...@gmail.com wrote: Hello, I would have wanted to know if there is a way to find the name of the actual plugin being executed from inside a model method

Re: CakePHP and the new MS SQL 2005/2008 Driver for PHP

2009-07-06 Thread Ernesto
Hello. i recently developed a CakePHP app using MSSQL 2005 as DB. i updated ntwdblib.dll in apache/bin (and in php/bin also) directory and now cake's mssql driver is working fine :) On 6 Lug, 16:09, idx idxma...@gmail.com wrote: Hello,

Re: CakePHP and the new MS SQL 2005/2008 Driver for PHP

2009-07-06 Thread Robert Edeker
What dll version is that? The one I have is 2000.2.8.0 . Although I've read reports of the updated driver not being reliable. On Mon, Jul 6, 2009 at 10:51 AM, Ernesto e.fanz...@gmail.com wrote: Hello. i recently developed a CakePHP app using MSSQL 2005 as DB. i updated ntwdblib.dll in

One full-table query or many limit=1 queries?

2009-07-06 Thread Yura Linnyk
Hi all! I'll ask a question first and then I'll give a background to it for just in case that'd give any insight. Is it better to query MySQL table once for all posts (which may be thousands of rows) or about 30 - 50 queries with limit 1? The reason I ask is that I build a menu of categories

Re: One full-table query or many limit=1 queries?

2009-07-06 Thread Carlos Gonzalez Lavin
This might require a bit of tweaking, since I've never used the EXISTS operator with cakephp... but here it goes: *$categoriesForTree = $Category-find('all', * * **array('order' = 'lft ASC',* * **'conditions' = 'EXISTS (SELECT id FROM posts as Post WHERE Category.id = Post.category_id AND

Re: One full-table query or many limit=1 queries?

2009-07-06 Thread Carlos Gonzalez Lavin
As an extra.. as far as I know the best practice is to do the smallest amount of querys you can to the database (even if the resulting dataset is a bit bigger than needed).. since a big part of the overhead processing comes from preparing those data to be returned and having the application

Re: Final solution for Autocomplete In cake1.2

2009-07-06 Thread Marcelo Andrade
On Mon, Jul 6, 2009 at 10:57 AM, bhushan Abhushanahir...@gmail.com wrote: (..) controller.  and written test_auto() in controller function test_auto()        {        } and in view (test_auto.thtml) i have wriiten these lines: 1) Please, use the CakePHP version 1.2.x. 2) To a view

Re: One full-table query or many limit=1 queries?

2009-07-06 Thread Yura Linnyk
Carlos, thank you for two insightful comments. I wasn't aware of EXISTS subquery and will try it, then your second comment pretty much answers my question. Thanks! On Jul 6, 7:31 pm, Carlos Gonzalez Lavin carloslavi...@gmail.com wrote: As an extra.. as far as I know the best practice is to do

Re: Call ClassRegistry::init in bootstrap.php

2009-07-06 Thread gerhardsletten
Put the code you had in bootstrap in your main app_controller.php in the beforeFilter() function --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to

Modify bakes rendered code

2009-07-06 Thread MikeBates
Does anyone know what I need to edit in the console code to modify the default code that bake renders? As good as bake is I still find that I need to spend a lot of time going through all the code it creates for me making the same adjustments each time. Any hints on what needs to be done would

Using CakePHP to refactor an existing website

2009-07-06 Thread Vincent
Hi, I am considering refactoring a messy company intranet (written in plain PHP) using a web framework, and as you guessed, CakePHP caught my eye. My constraint is that I cannot rewrite it completely from scratch (hard to convince a manager on that), so I am thinking to gradually replace

Re: Using CakePHP to refactor an existing website

2009-07-06 Thread schneimi
Hi, I can just give you a hint to a book concerning this topic, maybe it helps you. http://littlehart.net/book/ Regards, Michael Vincent schrieb: Hi, I am considering refactoring a messy company intranet (written in plain PHP) using a web framework, and as you guessed, CakePHP caught

RE: Using CakePHP to refactor an existing website

2009-07-06 Thread David Coleman
Michael, What you propose is totally possible. The idea would be that you would include all of the original website in the app/wwwroot folder. This would allow it to be accessed as though it was never modified. The only restriction is you must use cake-php’s index.php file. You can get

Re: Containable and Pagination

2009-07-06 Thread Miles J
In the controller: var $paginate = array( 'Document' = array( 'fields' = array('Document.*'), 'contain'=array( 'User'=array( 'fields' = array('User.id','User.surname','User.name'), 'conditions' = array('User.active'=1) ) ) ) ) );

Integrating Microsoft ASP with CakePHP

2009-07-06 Thread simon...@gmail.com
Hi Everyone, I did a website using CakePHP. Now I need to do an e-store in this website using Microsoft ASP and Components. I need to use VISA Credit Card and VISA did sent me an example that use ASP and some Components. The Components are already on the server. What is the best way for me to

Re: Integrating Microsoft ASP with CakePHP

2009-07-06 Thread Miles J
ASP and PHP are both separate languages. On Jul 6, 1:27 pm, simon...@gmail.com simon...@gmail.com wrote: Hi Everyone, I did a website using CakePHP. Now I need to do an e-store in this website using Microsoft ASP and Components. I need to use VISA Credit Card and VISA did sent me an

Re: Containable and Pagination

2009-07-06 Thread byqsri
Sorry But I will get the pagination on the users In the view I must list all users that are in relation with Document with id=$id and I would ,if it is possible using the pagination for paginate the users. On 6 Lug, 21:56, Miles J mileswjohn...@gmail.com wrote: In the controller: var

Re: One full-table query or many limit=1 queries?

2009-07-06 Thread Carlos Gonzalez Lavin
Please let us know if it worked (and if you had to change any part of the code).. I think some people (myself included) would be interested in knowing if using EXISTS is as simple as that 2009/7/6 Yura Linnyk yur...@gmail.com Carlos, thank you for two insightful comments. I wasn't aware of

Re: jquery cakephp post data problem

2009-07-06 Thread stZen
Martin, Thanks for responding. That worked! (using GET) I have been reading up some and looks like its related to mod_rewrite. If you have any ideas on getting POST working, please let me know. On Jul 6, 12:39 am, Martin Radosta martinrado...@gmail.com wrote: On 07/06/2009 12:48 AM, stZen

Re: Integrating Microsoft ASP with CakePHP

2009-07-06 Thread Alastair
On Jul 6, 9:27 pm, simon...@gmail.com simon...@gmail.com wrote: Hi Everyone, I did a website using CakePHP. Now I need to do an e-store in this website using Microsoft ASP and Components. I need to use VISA Credit Card and VISA did sent me an example that use ASP and some Components. The

Alphabetical Pagination

2009-07-06 Thread cchaos
I am using Cake's PaginateHelper when showing a listing of bands on my site. So right now, at the bottom I have the page number 1|2|3... What I would like to do is have the page links turn into alphabetical ranges. I know I can get the Paginator to show the alphabet and sort by that, i.e.

Re: Modify bakes rendered code

2009-07-06 Thread Brendon Kozlowski (Realm)
http://book.cakephp.org/view/789/Modify-default-HTML-produced-by-baked-templates :) On Jul 6, 1:44 pm, MikeBates mba...@opskwan.com wrote: Does anyone know what I need to edit in the console code to modify the default code that bake renders? As good as bake is I still find that I need to spend

Re: Modify bakes rendered code

2009-07-06 Thread MikeBates
Thanks for the link, but it's not the views (HTML) I want to modify, it's the controller php code that bake creates. Brendon Kozlowski wrote: http://book.cakephp.org/view/789/Modify-default-HTML-produced-by-baked-templates :) On Jul 6, 1:44 pm, MikeBates mba...@opskwan.com wrote: Does

undefined index?

2009-07-06 Thread keanoppy
want to ask,i have table stages but seems that for this particular page,the index cannot be undefined other than the table and view,where else should i check? this is the code fragment of the table: the entire php echo for $stage got error ?php $i = 0; foreach ($stages as $stage): $class

RE: Modify bakes rendered code

2009-07-06 Thread Paul
Controller code is built in: \cake\console\libs\tasks\controller.php That’s where you need to make changes to bake custom controllers -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of MikeBates Sent: Tuesday, 7 July 2009 12:10 p.m. To:

Re: undefined index?

2009-07-06 Thread brian
Which index? What is the table definition? What is the controller code? What is the output from debug($stages)? On Mon, Jul 6, 2009 at 8:35 PM, keanoppykeano0...@gmail.com wrote: want to ask,i have table stages but seems that for this particular page,the index cannot be undefined other than

Re: undefined index?

2009-07-06 Thread keanoppy
all index from the stages table, the output for $stage['Phase']['id'] can be shown for the table stages,i have: id(pk),phase_id(fk),status,duration,stagesname_id (fk),p_date,a_date,remarks,created,modified which part of the controller code? the output from debug: include -

Cookie Component initialization incorrect (bug?)

2009-07-06 Thread Jorgepedret
Hi, This is a slightly complicated case related (I think) to the guts of CakePHP. This is what I have: 1. A controller (Users) that uses Cookie as a component 2. There is a method in Users that uses the Cookie component to write a cookie 3. Another controller (MyAccount) non related to the

Re: undefined index?

2009-07-06 Thread brian
On Mon, Jul 6, 2009 at 9:06 PM, keanoppykeano0...@gmail.com wrote: all index from the stages table, the output for $stage['Phase']['id'] can be shown If you're getting an undefined index error, what is the next word in the error message? It should tell you which index is undefined. for the

Re: Help debugging pseudocoder.com Asset Packer CakePHP Plugin

2009-07-06 Thread Hiero
I'm having the same issue. Nothing in the logs, and since debug is off I can't get error messages. Perms are set correctly on ccss cjs. CSS packs, but not JS. On Jun 11, 2:53 am, RyOnLife ryan.mckil...@gmail.com wrote: I'm tailing my logs and nothing suspicious is turning up. Re: the #3

Re: Cookie Component initialization incorrect (bug?)

2009-07-06 Thread brian
You might be able to get around this by creating a component to share between the 2 controllers and putting the cookie code in there. On Mon, Jul 6, 2009 at 11:09 PM, Jorgepedretjorgeped...@gmail.com wrote: Hi, This is a slightly complicated case related (I think) to the guts of CakePHP.

Re: Help debugging pseudocoder.com Asset Packer CakePHP Plugin

2009-07-06 Thread Hiero
To follow up: CSS is packing fine, its JS that's causing all kinds of problems for Asset Packer. Jquery.1.3.2.min seems to crash the whole operation. Same for another obfuscated JS file. On Jul 6, 11:23 pm, Hiero v25me...@gmail.com wrote: I'm having the same issue. Nothing in the logs, and

Re: Help debugging pseudocoder.com Asset Packer CakePHP Plugin

2009-07-06 Thread Miles J
Well if its obfuscated/minified ALREADY then it will probably break. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from

Postgresql update query not working

2009-07-06 Thread Aneesh S
Hello, I had trouble when my perfectly working cake project(with mysql) was forced into postgresql, but later got that cleared, now i cant get the update query working. This is the error that i am getting - Warning (2): pg_query() [function.pg-query]: Query failed: ERROR: column Menuitem of