Re: Fatal Error

2009-03-16 Thread Manisha P
Thank you for your suggestion :) I will take care of this. Actually I am using that code for country and state selectbox in Employee registration form Now I have modify that code to var $belongsTo = array('UserCountrie','UserState'); and in State model I have added var $BelongsTo = array('Us

Contains with Alias

2009-03-16 Thread mariacheu...@gmail.com
Hi all, I am using an alias before I do my find call, because I have a general search function and I want to parse the results with one chunk of code, regardless of the Model, so I use: $this->Model1->alias = 'Result'; This works fine, except for one Model, which contains another. In that case I

Re: containable and (left/inner) JOINS

2009-03-16 Thread joshua
Yeah, I replace $conditions['join'] with manual query in my application for the bad performance and some unreachable function when use cake join. [?] On Wed, Jan 21, 2009 at 8:04 AM, Mark (Germany) wrote: > > well, great idea :) > > i dont know the model things in cake all too well > so i have no

Re: Auth component not working in 1.2.1.8004

2009-03-16 Thread joshua
There was a time that the some issuein my application. The best way to get the real reason is digging into source code

Syntax for find()

2009-03-16 Thread Chris M
Can someone provide the syntax for the find if I want to accomplish this: select * from places order by account_status, name A very basic question, but I'm only a newbie Cheers :) Stay connected to the people that matter most with a smarter inbox. Take a look http://au.docs.yahoo.com/m

RE: User to User request

2009-03-16 Thread Dave Maharaj :: WidePixels.com
Thanks man! Perfect. Dave -Original Message- From: Miles J [mailto:mileswjohn...@gmail.com] Sent: March-16-09 9:02 PM To: CakePHP Subject: Re: User to User request Yeah message tables could be quite tricky. Heres the SQL that I use for my messaging system. user_id = User who sent th

Re: User to User request

2009-03-16 Thread Miles J
Yeah message tables could be quite tricky. Heres the SQL that I use for my messaging system. user_id = User who sent the message recipient_id = Use who receives it, of course CREATE TABLE IF NOT EXISTS `messages` ( `id` int(11) NOT NULL auto_increment, `user_id` int(10) unsigned NOT NULL def

Re: One model consists of three tables..

2009-03-16 Thread Miles J
Like I said, it cant be done using the built in model associations. Youd have to do extra logic, possibly in afterFind(), to get the results you want. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. T

Re: validationErrors from a view called from a different controller- cakephp1.2

2009-03-16 Thread calder0n
I found exactly what im looking for but unfortunately its for cakephp 1.1. http://bakery.cakephp.org/articles/view/validation-in-another-controller I've tried it and it doesnt work in cakephp1.2, any hints on what I need to change to port it? On Mar 16, 2:22 pm, calder0n wrote: > Hello everyone

Re: changing $useDbConfig 'on-the-fly' ?

2009-03-16 Thread Gwoo
http://api.cakephp.org/class/model#method-ModelsetDataSource --~--~-~--~~~---~--~~ 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 this gro

User to User request

2009-03-16 Thread Dave Maharaj :: WidePixels.com
How would you build a Table to handle messages from user to user? So user 27 wants to send a message to user 56... when user 56 logins in he can see his message from user 27. I cant quite figure out the from user_id to user_id in the database. Thanks, Dave --~--~-~--~~---

Re: One model consists of three tables..

2009-03-16 Thread Svel
trying to explain: Type hasOne [Object_Type1] or [Object_Type2] or [Object_Type3] --~--~-~--~~~---~--~~ 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 unsu

Re: One model consists of three tables..

2009-03-16 Thread Marcelo Andrade
On Mon, Mar 16, 2009 at 4:47 PM, Svel wrote: > > I have an "Object" which can be one of three types, and depending on > type, it has different fields. But logically it is just "Object". > So i have > 3 tables in my DB for each "Object" type > 1 table for types > > How i can create models / associ

Twist on multirecord forms.

2009-03-16 Thread gc1155
I've read up on multirecord forms and I think I have the basics down using Cake 1.2. However, what if I want to make one modification and have it apply to several records? For instance, given a "Task" model with a Day field. I'd like to be able to pick a day and submit the form. The day field

Re: Jake question: rewrite problem?

2009-03-16 Thread Robin
Thanks Brendon. Definitely appreciate your help. Maybe you can use the exact cake application I am using so that to reproduce what I am seeing right now. Here is the link: http://www.magnik.com/api/files/magnik%201.2.4.zip. It is a amazon script written in cakephp. I do think the version matters

Re: Performance different between cakephp 1.1 and 1.2

2009-03-16 Thread mark_story
Its output from the DebugKit. You can get it from http://thechaw.com/debug_kit. -Mark On Mar 16, 10:05 am, WyriHaximus wrote: > Just curious how did you create that report? > > On Mar 16, 4:49 am, namsouth wrote: > > > Miles, > >Thank for you advice, as your advice, I have been installed

Re: including CSS in the emails sent by CakePHP Email component

2009-03-16 Thread amfriedman
There's ways around the grueling task of manually converting CSS styles to inline styles. Try the script I wrote just for the purpose. It automatically converts your CSS to inline styles. http://vivwebsolutions.com/tools/css_to_inline/ On Mar 10, 2:20 pm, brian wrote: > On Tue, Mar 10, 2009 a

validationErrors from a view called from a different controller- cakephp1.2

2009-03-16 Thread calder0n
Hello everyone, Let's say I have a model called "Activity" and to each activity users may add reviews, so I've got a Review model with some validation rules. Now, I'm showing a form to add a review from one of my views of my ACtivity model. The form calls my add() method in my Review controller.

Re: One model consists of three tables..

2009-03-16 Thread Miles J
I have this for my "flagged" content table. I have a content_id and a contentType, the type could be a comment, user, etc, so its always changing. But there is no way I have found that you can setup relations, you would have to do an after find and do additional queries depending on the type of c

One model consists of three tables..

2009-03-16 Thread Svel
I have an "Object" which can be one of three types, and depending on type, it has different fields. But logically it is just "Object". So i have 3 tables in my DB for each "Object" type 1 table for types How i can create models / associations to implement this? --~--~-~--~~--

Re: Overloading AppModel constructor

2009-03-16 Thread AD7six
On Mar 16, 8:12 pm, yaman666 wrote: > Well, that's exactly what I have. However, how to populate that > property from database automatically during model creation without > overloading __construct() is what the question is. Show what you've got and why, and someone will probably point you in t

Re: Overloading AppModel constructor

2009-03-16 Thread Alfredo Quiroga-Villamil
I am not sure if there is an alternative; but to me overlading the constructor sounds perfectly fine. I would be interested in hearing reasons why not to. I did see the comment posted in the bug and I personally disagree with the comment: "2) Do not override model constructors." I would think th

Re: Overloading AppModel constructor

2009-03-16 Thread yaman666
Well, that's exactly what I have. However, how to populate that property from database automatically during model creation without overloading __construct() is what the question is. P.S. I actually figured out that the reason for exceptions was missing parameters in constructor, so now it works,

Re: Overloading AppModel constructor

2009-03-16 Thread Alfredo Quiroga-Villamil
I haven't tried this; but try it and see what happens. 1- Create app/models/app_model.php 2- In there you can have class AppModel extends Model { protected $sYourPropery = 'property'; } // End of AppModel{} All models that extend AppModel should now have access to $sYourProp

paginateCount and SELECT DISTINCT

2009-03-16 Thread Fibra
Hello everyone, how are you? If you ever had the misfortune of finding yourself in the need of using the $paginate variable with a DISTINCT operation, you must have found out that the returned amount of records is not correct! It returns the COUNT of all the records (ignoring the DISTINCT in the

Overloading AppModel constructor

2009-03-16 Thread yaman666
Most of my models have an additional property that I was trying to preload by overloading AppModel constructor. class AppModel extends Model public function __construct() { parent::__construct(); // Load custom property from database and unserialize value

Re: My first CakePHP website launched

2009-03-16 Thread Davy
Thanks Robin, this is fixed now! On Mar 16, 6:30 pm, MrSensitive wrote: > Hi Davy, > > nice site, Robin here.. Thank You for your help on the UltraGenda > Webserver ;) > > in your portfolio, the link on Davy Van Den Bremt (v2) points > towww.bartschepens.be > which is probably a typo.. --~--~-

Re: My first CakePHP website launched

2009-03-16 Thread MrSensitive
Hi Davy, nice site, Robin here.. Thank You for your help on the UltraGenda Webserver ;) in your portfolio, the link on Davy Van Den Bremt (v2) points to www.bartschepens.be which is probably a typo.. --~--~-~--~~~---~--~~ You received this message because you ar

Re: containable and (left/inner) JOINS

2009-03-16 Thread Frode Knutsen
I'm glad there are more than me getting frustrated about this behaviour. This is the first problem I ran into after fiddling around with CakePHP for the first time. I could not believe my eyes when looking through the query-debug after doing my first contain-test. I hope this gets fixed in the f

Missing Database Table in Test-Groups - but not in single Test-Case

2009-03-16 Thread den
Hi I have wrote some Test-Cases which run correctly if i run every Case by hand. But If i run it from a Test-Group i got "Missing Database Table" at different positions. I try this to reproduce the error: - Got the latest Brunch from SVN - Configured Database, Temp-Dir, ... - Baked a Model, a Co

Re: Ajax reload of an element.

2009-03-16 Thread brian
The idea is that you render the *element* not a view. You can do either $this->render('/elements/posts/view_posts'); or $this->viewPath('elements/posts'); $this->render('view_posts'); Both of those will tell Cake to render the element directly, without a view. On Mon, Mar 16, 2009 at 7:53 AM, b

RE: Users with ACL problem

2009-03-16 Thread Dave Maharaj :: WidePixels.com
Try to give you a better idea of my current set up in the DB TABLES USER TABLE: Id Name Password Group Email Confirmation Confirmed TEACHER TABLE: ID User_id Group_id =>3 (All teacher belong to group 3) general profile fields STUDENT TABLE: ID User_id Group_id =>4 (All students belong to gr

RE: Users with ACL problem

2009-03-16 Thread Dave Maharaj :: WidePixels.com
So I know this may be a stupid question as it is all new to me. In my setup I have: So in english to my understanding is that this links the USER to a GROUP, and based on user permissions says what the USER can , can not do? But not sure how to accomplish what you suggest in linking the TEACHER a

Re: Auth component not working in 1.2.1.8004

2009-03-16 Thread MalContented
On 2 Mar, 18:28, brian wrote: > On Mon, Mar 2, 2009 at 11:09 AM, Josh Prowse wrote: > > > HeyMal! > > > Are you talking about your local /app/config/routes.php file, or is > > there some other file that contains those Router::connect statements? > > I'm having the same problem as you guys, and

help with default.ctp

2009-03-16 Thread monirr444
this is my code for default.ctp at the bottom there is banner that i want to show in my new controller that i made recently but it wont show up it show in every other controller that i have but not this i'm confuesd can some one help me with this thank you is there something i need to put in my

help with default.ctp

2009-03-16 Thread monirr444
this is my code for default.ctp at the bottom there is banner that i want to show in my new controller that i made recently but it wont show up it show in every other controller that i have but not this i'm confuesd can some one help me with this thank you is there something i need to put in my

Re: Fatal Error

2009-03-16 Thread Martin Westin
Don't use empty strings for conditions. Use empty arrays. This might possibly cause your problem since it will find all records for you. At least it used to in the pre-release versions of 1.2. Also about recursive: recursive 0 loads belongsTo data. Setting recursive -1 will load only the primary

Re: My first CakePHP website launched

2009-03-16 Thread Martin Westin
The slightly nerdier, but fully dynamic way to check if you are on the home page (site root). if ( $html->url('/') == $this->here ) { // you are on the homepage } This will continue to work if you change your routing so that the index moves from say the posts controller to a brand new dashbo

Re: Jake question: rewrite problem?

2009-03-16 Thread Brendon Kozlowski
Whoops, Smelly Eddie is right. I think "below" as being outside the document root, not within. I'm back from my trip, I'll see if I can install Joomla with Jake support on a test server later tonight to see what the issue is. On Mar 15, 1:23 pm, Robin wrote: > I realized that this might be a c

Re: Performance different between cakephp 1.1 and 1.2

2009-03-16 Thread joshua
There is the same problem in my application. It takes >8 sec to load a page. The ACL authentication sql will take > 17 ms. 2009/3/16 WyriHaximus > > Just curious how did you create that report? > > On Mar 16, 4:49 am, namsouth wrote: > > Miles, > >Thank for you advice, as your advice, I hav

Re: Why there are so many 'DESCRIBE' when I enable debug model?

2009-03-16 Thread Martin Westin
Richard is right. Describe does just that... describes the tables so that Cake can know that Article should have a tltle field and that it contains up to 255 characters and so on and so on... As Richard also writes this is cached but when you are in debug-mode you are expected to alter the databas

Re: changing $useDbConfig 'on-the-fly' ?

2009-03-16 Thread Martin Westin
This is for only a single model? In that case you can put the if-clause in the constructor. function __construct($id = false, $table = null, $ds = null) { if ( should use special config ) { $this->useDbConfig = 'special_config'; } parent::__construct($id, $table, $ds); }

Re: Performance different between cakephp 1.1 and 1.2

2009-03-16 Thread WyriHaximus
Just curious how did you create that report? On Mar 16, 4:49 am, namsouth wrote: > Miles, >Thank for you advice, as your advice, I have been installed the > debug tools, try to find out which process cause the generate time is > so slow, > but I just cannot identify which module cause this p

Re: Where should I place xml files?

2009-03-16 Thread Martin Westin
I'd say this depends on the scenario: If you created the file your best place is probably the vendors folder. If a user uploads it, I keep it in app/uploads/meaningful_folder_name. If is is uploaded, parsed and then not needed then I'll keep it in tmp and then delete it when I am done. If it shou

Re: Performance different between cakephp 1.1 and 1.2

2009-03-16 Thread jcorrea
Having debug>0 make the application a lot slower. Personally i've found that having too many related models make cake load really slow. Profiling my applications i get render times of 20ms, queries arround 20 to 50ms but loading the related models may take 800ms. On Mar 16, 5:01 am, Miles J wrot

Re: Why there are so many 'DESCRIBE' when I enable debug model?

2009-03-16 Thread Richard
My understanding is that this enables CakePHP Models to identify details about your schema. By extracting this metadata, the models can be further exploited by ohter areas in cake, such as the helpers. The form helper, for example uses the metadata to automatically set size and limits on fields in

Re: Help with a query

2009-03-16 Thread gkc
Miles, thank you for your response. I am not using a model or a find on this. I havent had the time to really learn the whole relational model concept and I am in a hurry to get this so I am just using Model->query for this one. I am sure it would be a lot easier, but maybe for another project.

Re: Why there are so many 'DESCRIBE' when I enable debug model?

2009-03-16 Thread joshua
I find there is a sql which will took >17ms everytime when the action needs authentication in ACL model. That means if I use ACL database model in my application , there will always be >17ms was taken. Can someone give an explanation of this? //sql SELECT `Aco`.`id`, `Aco`.`parent_id`, `Aco`.`mode

Why there are so many 'DESCRIBE' when I enable debug model?

2009-03-16 Thread Joshua
As you can see, the 'describe' sql took (7+17+17) ms! Why they are there? Can I disable it? 1 DESCRIBE `aros` 7 7 7 2 DESCRIBE `acos` 7 7 17 3 DESCRIBE `aros_acos`7 7 17 --~--~-~--~~~---~--~

Re: Ajax reload of an element.

2009-03-16 Thread byqsri
Thanks Dave for your answer. I hope to not make a special view to render the element's results. I hope that there is a method to escape this On Mar 15, 8:12 pm, "Dave Maharaj :: WidePixels.com" wrote: > I think I know what you mean. > > What I do (no expert so I may be doing it wrong) but for ex

$ajax->observeField() problem

2009-03-16 Thread Manisha P
Hello All, I am using $ajax->observeField() It is showing me error 'Form is not defined' in javascript console. Does anyone has some solution for this? Thanks in advance Manisha. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Users with ACL problem

2009-03-16 Thread dr. Hannibal Lecter
What brian is suggesting is the following: 1. Right not your ARO (requester) is a User, which forces you to distinguish between students and teachers 2. If you make Teacher an ARO and Student another ARO, you eliminate that problem (this is easily done with ACL) On Mar 16, 3:12 am, "Dave Maharaj

Re: Variable state through multiple Ajax requests (ModalBox) including forms

2009-03-16 Thread Milmar
Hello, Since this is resolved, may you share the working example? I'd like to use it as reference since I'm working on something similar. Thanks. -Milmar On Jan 16, 8:43 pm, WebbedIT wrote: > Resolved thanks to Martin's help in the following thread ... > > http://groups.google.com/group/cake

Re: Some ACL Advice Please - Multiple Group Membership

2009-03-16 Thread AD7six
On Mar 16, 12:23 am, Smelly_Eddie wrote: > So I have finally broken down in my stubborn ways and agreed to accept > Cake's Acl component. After walking through the manual I believe it > will  make it into all my future sites. Careful. Acl is no more than a means of getting a yes no answer to a

Re: Performance different between cakephp 1.1 and 1.2

2009-03-16 Thread Miles J
It seems all your views are loading rather quickly, how long on average do your sql queries take? Also is this a local host or online server? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post t

Re: Fatal Error

2009-03-16 Thread Manisha P
I have added var $belongsTo = array('UserState' => array('className' => 'UserState', 'foreignKey'=>false, 'conditions' => '',

Re: My first CakePHP website launched

2009-03-16 Thread Davy
I was thinking something like that. Thanks a lot for the help guys! Davy On Mar 16, 12:24 am, Gonzalo Servat wrote: > On Sun, Mar 15, 2009 at 6:33 PM, Davy wrote: > > > OK. Thx. > > > Another thing. Does cake have a concept of severity for flash messages > > (or any other)? > > > I mean, som

Re: Performance different between cakephp 1.1 and 1.2

2009-03-16 Thread namsouth
Miles, Thank for you advice, as your advice, I have been installed the debug tools, try to find out which process cause the generate time is so slow, but I just cannot identify which module cause this problem , since from the timer session time used in render the element is so little, can you

changing $useDbConfig 'on-the-fly' ?

2009-03-16 Thread K3
how can i switch useDbConfig 'on-the-fly' ? it should depend of an URL param. I cannot put 'if' statetment in the variable declaration section... pls help Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakeP

Re: OT: odd undefined offset

2009-03-16 Thread Dr. Loboto
Output $line that produces error and check it. If $line do not have "=" sign, list($key, $val) will produce error with undefined offset as there will not be value for $val. On Mar 14, 12:13 am, brian wrote: > This isn't strictly a Cake issue but I wonder if someone has an idea > why I'm seeing t

Re: My first CakePHP website launched

2009-03-16 Thread Louie Miranda
You really have a great portfolio. Congratulations! -- Louie Miranda (lmira...@gmail.com) http://www.louiemiranda.net Quality Web Hosting - www.axishift.com Pinoy Web Hosting, Web Hosting Philippines On Mon, Mar 16, 2009 at 4:07 PM, Andrew Allen wrote: > > Congratulations on your site's launch

Re: My first CakePHP website launched

2009-03-16 Thread Andrew Allen
Congratulations on your site's launch! Your portfolio looks excellent and I hope you do well as a web-dev. I only have 2 suggestions on how to make your site better. 1) Get your own favicon (sorry but unless the sites devoted to cakephp I don't feel like thats an appropriate icon) 2) I like to ke