Re: find() using multiple references to the same table

2010-03-30 Thread John Andersen
I recomend you to take a look at the CakePHP book at: http://book.cakephp.org/view/872/Joining-tables which will help you to implement my modified version of the SQL statement. Take a look, and show us your solution or any issues you may then have. Enjoy, John On Mar 30, 3:09 am, Ryan

Re: $useDbConfig not working

2010-03-30 Thread John Andersen
Please show the code where you are setting the $useDbConfig, and what is the name of the file in which you are doing it! Enjoy, John On Mar 30, 8:31 am, mattmemo knockdownsh...@gmail.com wrote: Hello, I would like to have two different database configurations.  For my Projects controller, I

Re: How to pass an array trough URL??

2010-03-30 Thread toka...@gmail.com
I am developing a simple public API where I need receive an array of data from other website. is there better way? no difficult to implement? Thanks Tomas On 29 bře, 19:02, Miles J mileswjohn...@gmail.com wrote: Is there a reason your passing data like this through URLs? What are you trying

Re: Initial loading of Cake problem: Trying to get property of non-object in ...

2010-03-30 Thread WebbedIT
Because there is nothing wrong with the Cake releases, it must be your's and the OP's configuration which is causing the issue. You can't just install apache/php/mysql on a windows machine and be up and running. Wamp and Xampp are packages which take all the hassle out of this process and I

Re: find() using multiple references to the same table

2010-03-30 Thread WebbedIT
OK so you have the following Application belongsTo School Application belongsTo Student Student belongsTo School In order to run a find on Application but place a condition on the Student's current school you need to force a join using bindModel() as follows $this-Application-bindModel(array(

Re: Undefined index

2010-03-30 Thread Ed Propsner
I appreciate you taking the time Paul but there won't be a need for a test case. The idea of the Cake developers putting together such an intricate framework and not allow you to perform the most basic functions with form components is just ridiculous and highly unlikely. I too agree with

Re: How can Schema Shell create new tables?

2010-03-30 Thread Martin Westin
Also, I can't get the reverse to work either. I.e. update does not notice that a table should be dropped. I'd love some help on that also. On Mar 30, 7:51 am, Martin Westin martin.westin...@gmail.com wrote: Hi, cake schema run update -f always creates an ALTER TABLE statement. So how about

I can't get the value of session in controller

2010-03-30 Thread Rimoe
hi, everyone, I have set a session in aa.php ( session_start(); $_SESSION['aa'] = '12345'; ) I can read the value in bb.php ( session_start(); echo $_SESSION['aa'] ; ) but I can't read the value in any aaas_controller.php. ( echo $this-Session-read('aa'); echo $_SESSION['aa']; ) do anyone

Re: I can't get the value of session in controller

2010-03-30 Thread Jeremy Burns
Have you tried using the session component and helper instead of accessing the session directly? Jeremy Burns jeremybu...@me.com On 30 Mar 2010, at 09:33, Rimoe wrote: hi, everyone, I have set a session in aa.php ( session_start(); $_SESSION['aa'] = '12345'; ) I can read the

Database connects without any queries

2010-03-30 Thread NdJ
Hi, Recently I've noticed that CakePHP seems to cause a database connect for each page load (when the controller uses a model) even if the page does not perform any database query. On the surface of things this might make sense. My concern is that I'm seeing database connects even when the data

Re: Database connects without any queries

2010-03-30 Thread cricket
Do you have debug set to 0? Cake sends a bunch of DESCRIBE statements otherwise. Is this what you're seeing? On Mar 30, 5:23 am, NdJ nicholas.dej...@gmail.com wrote: Hi, Recently I've noticed that CakePHP seems to cause a database connect for each page load (when the controller uses a model)

shell missing view

2010-03-30 Thread cricket
Cake 1.2.5 I received the following error msg from a cron job: -- snip -- PHP Warning: extract(): First argument should be an array in /usr/lib/ php/cake_1.2.5/cake/console/error.php on line 149 PHP Notice: Undefined variable: file in /usr/lib/php/cake_1.2.5/cake/ console/error.php on line 150

Re: Database connects without any queries

2010-03-30 Thread NdJ
Hi Cricket, Yes debug is set to zero - quite literally I get a connect followed by a quit while the controller retrieves its data via cache. N On Mar 30, 10:06 pm, cricket zijn.digi...@gmail.com wrote: Do you have debug set to 0? Cake sends a bunch of  DESCRIBE statements otherwise. Is this

Re: Initial loading of Cake problem: Trying to get property of non-object in ...

2010-03-30 Thread Jon Bennett
How have you installed Apache and PHP?  I suggest you use a package such as WampServer 2 (what I use) or Xampp. Don't use xampp, least not on OSX - it caused me no end of pain. Virtualisation is the way, vmware or virtualbox. J -- jon bennett - www.jben.net - blog.jben.net Check out the

Re: Initial loading of Cake problem: Trying to get property of non-object in ...

2010-03-30 Thread Jeremy Burns
MAMP and MAMP Pro works well too. Jeremy Burns jeremybu...@me.com On 30 Mar 2010, at 13:58, Jon Bennett wrote: How have you installed Apache and PHP? I suggest you use a package such as WampServer 2 (what I use) or Xampp. Don't use xampp, least not on OSX - it caused me no end of pain.

Associated model not returning all data

2010-03-30 Thread WhyNotSmile
I have 3 models in my app: Group Users Banned Users Each of the Users and Banned Users belong to a group (or used to, in the case of banned users), so they both have a field called group_id. When I paginate the Users, I get a list of users, including their group. When I do the same thing

Save the world with CakePHP Sahana

2010-03-30 Thread kiang
I just found Sahana project is evaluating which PHP framework to use: http://wiki.sahanafoundation.org/doku.php/dev:fk_requirements Maybe somebody here would interested in putting some information for them. ;) For those who don't know sahana project: http://sahana.lk/ --- kiang Check out the

Re: Multi-page Surveys

2010-03-30 Thread Sam Sherlock
Sounds like you need the wizard comp http://bakery.cakephp.org/articles/view/wizard-component-1-2-1 http://bakery.cakephp.org/articles/view/wizard-component-1-2-1and some other stuff too - S On 29 March 2010 18:34, Jeff Winifred historyofrelig...@gmail.com wrote: I'm trying to create a

Paginator Helper - escape not working

2010-03-30 Thread Fernando Z. Bob
Hi everyone. My Paginator Helper is not working properly. Check out my code: ?php echo $this-Paginator-prev(' anterior', array(), null, array('class'='disabled'));? *OUTPUT: OK* ?php echo $this-Paginator-next('próximo ', array(), null, array('class' = 'disabled'));? *OUTPUT: NOTHING (blank

Re: recommendable to write view inside html tags?

2010-03-30 Thread Jeremy Burns
My opinion... I think these tags belong inside the layout, and have layout tags (div etc) in the view so that they appear inside the body tags rendered by the layout. As a view is always rendered inside a layout (isn't it?) there is no need for html etc inside the view. Jeremy Burns

Re: CakePHP 1.3.0-RC3 unleashed

2010-03-30 Thread jacmoe
I spoke too soon: The upgrade from RC2 to RC3 broke my app. :( Just a warning. Reverting to RC2. I think it has to do with me using extra fields in my model not in the database, but I'm not sure. On Mar 30, 12:30 am, jacmoe jac...@mail.dk wrote: Congratulations! :) You have come a long way

Re: recommendable to write view inside html tags?

2010-03-30 Thread rich...@home
A good rule of thumb is: anything that is shared between all pages goes in the layout On Mar 30, 3:10 pm, Jeremy Burns jeremybu...@me.com wrote: My opinion... I think these tags belong inside the layout, and have layout tags (div etc) in the view so that they appear inside the body tags

Set class help needed

2010-03-30 Thread cricket
I have an array of country data that I'm trying to adjust so it's suitable to pass to FormHelper for select options with optgroup labels. Set::combine has gotten me almost there but not quite. Here's the data: Array ( [0] = Array ( [id] = 1 [iso_code] = US

problem with TinyMCE under debug mode

2010-03-30 Thread ricky
Hi all, I'm using TinyMCE in my project, everything works fine under debug environment( debug==2), but TinyMCE doesn't work when I turn off debug ( set to 0 ). I compared the generated html code and they are identical. but I can't see TinyMCE UI at all. If I turn on debug mode, it works again.

Re: Associated model not returning all data

2010-03-30 Thread John Andersen
Check your name of the BannedUser model filename, should be banned_user.php! Enjoy, John On Mar 30, 4:28 pm, WhyNotSmile sharongilmor...@googlemail.com wrote: I have 3 models in my app:  Group  Users  Banned Users Each of the Users and Banned Users belong to a group (or used to, in the

Re: CakePHP 1.3.0-RC3 unleashed

2010-03-30 Thread Sam Sherlock
Congratulations and thanks to Mark and all those who contributed 1.3 is very fast; upgrading is smooth. Baking is a joy I notice that when I bake helper methods are called like this in views: $this-Html-link(...) rather than $html-link(...) though both work; is the former the way helpers

Re: CakePHP 1.3.0-RC3 unleashed

2010-03-30 Thread Jeremy Burns
I believe that whilst both work, the first is the way to go now; i.e. $this-Html, $this-Form etc. Jeremy Burns jeremybu...@me.com On 30 Mar 2010, at 17:26, Sam Sherlock wrote: Congratulations and thanks to Mark and all those who contributed 1.3 is very fast; upgrading is smooth. Baking is

Re: recommendable to write view inside html tags?

2010-03-30 Thread jacmoe
It's simple enough. :) Sample layout: head title ?php echo $title_for_layout; ? /title /head body div id=content ?php echo $content_for_layout; ? /div /body /html All your views are output through the $content_for_layout variable. Use all the html tags you want, inside of that content div. On

Re: How to pass an array trough URL??

2010-03-30 Thread Miles J
It seems like this should be a POST. But besides that, it should work fine. On Mar 29, 11:41 pm, toka...@gmail.com toka...@gmail.com wrote: I am developing a simple public API where I need receive an array of data from other website. is there better way? no difficult to implement? Thanks

Re: CakePHP 1.3.0-RC3 unleashed

2010-03-30 Thread Miles J
The changed it from $var to $this-Var simply so that manually set variables don't conflict with helper variables. On Mar 30, 9:28 am, Jeremy Burns jeremybu...@me.com wrote: I believe that whilst both work, the first is the way to go now; i.e. $this-Html, $this-Form etc. Jeremy Burns

Re: I can't get the value of session in controller

2010-03-30 Thread Miles J
Why are you triggering the session in aa.php and bb.php? What are those for anyway? The session component does all the session starting and magic automatically. On Mar 30, 1:40 am, Jeremy Burns jeremybu...@me.com wrote: Have you tried using the session component and helper instead of accessing

Validating not in list

2010-03-30 Thread Bart
Hello, I'm trying to build an application that is User based. However, I want to reserve some nicknames so you can't register them. When going over the validation rules, I find http://book.cakephp.org/view/1171/inList Which is basically what I need, but negated. Is there a way to say something

Re: making fpdf work in cakephp

2010-03-30 Thread butterlamb
I think I'm going to switch to tcpdf. According to an article in the Bakery (http://bakery.cakephp.org/articles/view/creating-pdf-files- with-cakephp-and-tcpdf), fpdf doesn't work well with 1.2. Thanks for all your help. On Mar 25, 6:51 pm, cricket zijn.digi...@gmail.com wrote: On Mar 25, 11:59 

RE: Auth Redirect Issues

2010-03-30 Thread Alan Asher
Cricket Thanks for trying to help but I already had the logout and loginredirect vars set. I figured out a workaround... Here's what my logout procedure looks like. $this-Session-destroy(); $this-Session-setFlash('Logout successful'); $redirect=$this-Auth-logout();

Cake 1.2.6 - Can't bake anything

2010-03-30 Thread McFrosty
So, I'm new to Cake...that being said, I followed all the directions and went through the blog tutorial, so I have a tender grasp of how it's supposed to work. I tried baking my first application today and have met with nothing but failure. While I was able to set up the console without any

Re: Cake 1.2.6 - Can't bake anything

2010-03-30 Thread Ed Propsner
Are you meaning to use Microsoft SQL server or MYSQL ? On Tue, Mar 30, 2010 at 2:53 PM, McFrosty mcfro...@gmail.com wrote: So, I'm new to Cake...that being said, I followed all the directions and went through the blog tutorial, so I have a tender grasp of how it's supposed to work. I tried

Retrieving objects from the DB instead of arrays

2010-03-30 Thread paws_galuten
I'm new to cakePHP and it seems like the only way to retrieve data from the data source is as an array. I'm finding that I am using a lot of code in my controller to prepare the arrays for display in the view, when I would rather be able to send an object to the view and get data from that object.

Re: Cake 1.2.6 - Can't bake anything

2010-03-30 Thread Jay Childers
I'm using IIS and MSSQL for my servers. On Tue, Mar 30, 2010 at 8:39 PM, Ed Propsner crotchf...@gmail.com wrote: Are you meaning to use Microsoft SQL server or MYSQL ? On Tue, Mar 30, 2010 at 2:53 PM, McFrosty mcfro...@gmail.com wrote: So, I'm new to Cake...that being said, I followed all

Re: Cake 1.2.6 - Can't bake anything

2010-03-30 Thread Ed Propsner
Just checking ... I'm new to Cake as well but seen it happen all too many times with different apps where someone accidentally picks the wrong server type. On Tue, Mar 30, 2010 at 11:48 PM, Jay Childers mcfro...@gmail.com wrote: I'm using IIS and MSSQL for my servers. On Tue, Mar 30, 2010 at

Re: Retrieving objects from the DB instead of arrays

2010-03-30 Thread Andy Dirnberger
Why not perform your manipulations in afterFind? http://book.cakephp.org/view/681/afterFind If you add an 'age' key to the result in the callback (my guess is you store the date of birth in the database, not the current age), you can then use $person['Person']['age'] in your view. On Mar 30,

Re: I can't get the value of session in controller

2010-03-30 Thread gmansilla
Use the Session Component, put this code in every controller that need to access to the session component var $components = array('Session') if you are going to use Session in your whole app then it would be a good idea to place that line in app_controller. Then, to use your session component

Re: Retrieving objects from the DB instead of arrays

2010-03-30 Thread Jamie
I'm afraid that there's no satisfying answer for you. Cake doesn't map DB records to objects; arrays are all you're gonna get. If you want your data in objects instead of arrays, then you'll have to rework a substantial part of the Cake core. You're stuck with arrays unless you want to do some

Re: Set class help needed

2010-03-30 Thread gmansilla
I would use Model::find('list'), and let cakephp do its magic On 30 mar, 11:20, cricket zijn.digi...@gmail.com wrote: I have an array of country data that I'm trying to adjust so it's suitable to pass to FormHelper for select options with optgroup labels. Set::combine has gotten me almost

Re: Multi-page Surveys

2010-03-30 Thread Zaky Katalan-Ezra
Try http://www.limesurvey.org/ as a reference version 2.0 which is a beta is based on cake. On Mon, Mar 29, 2010 at 8:34 PM, Jeff Winifred historyofrelig...@gmail.comwrote: I'm trying to create a multi-page survey, and kind of unsure which route or direction to go, can someone point me in the

Re: Retrieving objects from the DB instead of arrays

2010-03-30 Thread Walther
If you are manipulating data in your controller then your 'doing it wrong'. 'GoodCake' is to have the bulk of your code in your models (Fat model, thin controller), the controller should almost only call the correct model methods (And perform things like authorisation, authentication, session

Re: Further Datasource documentation

2010-03-30 Thread alan
Did you ever build the datasource? Want to release it on cakeforge or here? On Mar 18, 8:56 pm, Lucca Mordente luccamorde...@gmail.com wrote: Thanks Marco! I'll take a deeper look soon! Cheers, Lucca Mordente On Thu, Mar 18, 2010 at 10:46 PM, Marco marco.perg...@gmail.com wrote: What

Re: Retrieving objects from the DB instead of arrays

2010-03-30 Thread paws_galuten
Thanks for all of the helpful responses. It makes sense, but I feel like I'm shooting in the dark when it comes to learning cake. I do, in fact, have a fat controller and a thin model. I would really like to see some simple example apps, or a tutorial that does a little more than the blog. I guess