Learning cakePHP debugging

2009-09-01 Thread McScreech
Hello, I am learning to trace through my code to debug results that I don't understand. I have the following setup (in part): (And apologies for running on in my attempt to describe the situation.) in app_controller.php: var $uses = array('User'); var $components = array('Acl', '

Re: Learning cakePHP debugging

2009-09-02 Thread McScreech
@Martin, thanks. debug($activeUser); returns the type of output I was expecting. @abc, I'll look into the php version also. Now on to my problem, once I actually stopped to _read_ the debug output I realized that the $activeUser variable is NOT CHANGING when I log out and log back in again. In a

Re: Learning cakePHP debugging

2009-09-02 Thread McScreech
@LunarDraco, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You! I suspected that I was not setting the variable correctly and $activeUser = $this->Auth->user() in the beforeFilter function of app_controller.php was exactly the fix I needed. I got the the other version from

Change default labeling in views

2009-09-03 Thread McScreech
Hello, What does the double underscore represent in the following code from the head of the index.ctp file for the users view? I can see the results in the rendered page, but the reason I ask is that I would like to change this output without mucking up something else unintentionally.

Re: Change default labeling in views

2009-09-03 Thread McScreech
:02 am, brian wrote: > On Thu, Sep 3, 2009 at 10:51 AM, McScreech wrote: > > > Hello, > > > What does the double underscore represent in the following code from > > the head of the index.ctp file for the users view? > >     > >     > > __() is a function

User-generated id column

2009-09-04 Thread McScreech
Hello, I am converting an existing db to a web-based app. For most of the tables I have created a standard auto-incrementing integer id column. However, two of them have a pre-existing id column in the form 'AA- DDD', where A is alpha, D is numeric and the hyphen is embedded. I am looking fo

Trouble making javascript->link() work

2010-09-27 Thread McScreech
Hi, I can't seem to find what I am doing wrong here after scouring the web for hints. The relevant (I hope) code bits are included below. I am using cakePHP 1.2.6 and jquery 1.4.2. In my default.ctp, the 'javascript->link' form does NOT include the .js files but the direct '' tags form DOES. Any

Re: Using multiple domains on one app to create four seperate sites

2010-10-01 Thread McScreech
Jacob, I found the following (especially the first two) to be very helpful. http://www.ad7six.com/MiBlog/ProductionSetup http://www.ad7six.com/MiBlog/ProductionSetupRevisited http://groups.google.com/group/cake-php/browse_thread/thread/94625f2803546def/31a623769c72ab66?rnum=1&_done=%2Fgroup%2Fca

Add new items to a select box?

2010-01-12 Thread McScreech
Hello, I realize variants on this question have been done to death, but I have not been able to determine the bits I need to resolve this particular version. Is it possible to create a select box that you can add new list items to if they do not already exist in the linked model? I can provide m

Re: Add new items to a select box?

2010-01-13 Thread McScreech
I went on to another problem for now, will extract an example soon. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, s

Multiple table1 FKs referring to single table2 PK

2010-01-15 Thread McScreech
Hello, In the book sections http://book.cakephp.org/view/78/Associations-Linking-Models-Together 3.7.6.2 hasOne #hasOne-80 3.7.6.3 belongsTo #belongsTo-81 3.7.6.4 hasMany #hasMany-82 3.7.6.5 hasAndBelongsToMany (HABTM) #hasAndBelongsToMany- HABTM-83 I read: Possible keys for [hasOne|belongsTo|ha

Re: Add new items to a select box?

2010-01-19 Thread McScreech
Sorry, not a hard-coded example here, I have been having difficulty framing this question. I suppose what I'm asking about here is how to ensure data integrity when adding new rows to one table where it contains columns that are foreign keys to a second table when the referenced rows do not exist i

One input form, many models

2010-01-22 Thread McScreech
Can a single form be used to enter data belonging to several models? If so, how? McS. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To p

Re: Multiple table1 FKs referring to single table2 PK

2010-01-28 Thread McScreech
FINALLY, I've sorted through this mess and, once again, it comes back to understanding the cakePHP conventions. I had most of the linking relationships right, what was not working was the choice of names for my foreign-key columns in the intermediate table. I had columns in the 'mated' table named

Form inputs showing incorrect value

2010-02-02 Thread McScreech
Hello, I have edit/add views that are not retaining the correct values when they exist nor displaying the desired default values when new records are created. The following code examples look the same as other select type inputs in my code that DO work, I cannot seem to find my error. In the follo

Re: Form inputs showing incorrect value

2010-02-02 Thread McScreech
 pm, "Dr. Loboto" wrote: > echo $form->input('active', array( 'label' => 'Active Clone', > 'options' => array('no' => 'no', 'yes' => 'yes'), 'default' => > 'yes&#x

Find help for $this->set(compact())

2010-02-03 Thread McScreech
Hello, Where do I find the definition or explanation of '$this->set(compact ())' in the Cookbook or API? Thanx, DaveT. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Go

YASAQ Yet Another SaveAll Question

2010-02-18 Thread McScreech
Hi again, I can't get the saveAll() method to work for an indirectly-associated model. My model associations are: Clon hasMany MotherClon Clon hasMany FatherClon Mated belongsTo Mother /* mated.mother_id -> clon.id */ Mated belongsTo Father /* mated.father_id -> clon.id */ Mated belongsTo Pop

Re: YASAQ Yet Another SaveAll Question

2010-02-18 Thread McScreech
't know the > tables): > > Clon, MotherClon, FatherClon, Mated, Mother, Father, Pop > > and the following associations: > > Clon hasMany/belongsTo MotherClon > Clon hasMany/belongsTo FatherClon > > Mother hasMany/belongsTo MotherClon > Father hasMany/bel

Re: YASAQ Yet Another SaveAll Question

2010-02-18 Thread McScreech
>    John > > On Feb 18, 8:22 pm, McScreech wrote: > > > Yes, it is a bit of a complicated tangle isn't it! > > Excerpts of the related tables and models are: > > > CREATE TABLE clons ( > >         id INT NOT NULL AUTO_INCREMENT, > >         `nam

Re: YASAQ Yet Another SaveAll Question

2010-02-18 Thread McScreech
o code] > foreach clon in the data: >    save the clon - remember id; > > Add the remembered clon ids to the mated data. > Save the pop together with mated. > [/pseudocode] > > Hope the above helps you on the way, >    John > > On Feb 18, 9:35 pm, McScreech wrote: > >

Multiple forms on single page

2010-02-18 Thread McScreech
Is it possible to define several _independent_ data entry forms on a single page where each one posts data back to different models? Maybe with a redirect back to the same multi-form page on each Submit until a 'Done' button is clicked? And of course, if so, any suggestions on how to do so? DaveT

Trying to reduce arrays

2011-12-06 Thread McScreech
I am completely stumped. I have tried combinations of Set::extract, Set::classicExtract, Set::combine, and Set::flatten to get the results I show below. Perhaps this is a straight php question rather than cakePHP? 1) How do I obtain the results demonstrated? 2) How do I extract the key _names_ fro

Re: Trying to reduce arrays

2011-12-07 Thread McScreech
OK, thanks. I'm reading 'set.php' and see external references such as ' * See the unit test for more information.' Where do I look for that? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and he

Re: How Can I do custom pagination in Cake PHP ?

2011-12-08 Thread McScreech
Here are a few more good discussions: http://bakery.cakephp.org/articles/AD7six/2006/10/09/ pagination"> http://www.cakephpforum.net/index.php?showtopic=186";> http://www.sakic.net/blog/changing-cakephp-pagination-urls/";> McS -- Our newest site for the community: CakePHP Video Tutorials http://

Re: How Can I do custom pagination in Cake PHP ?

2011-12-08 Thread McScreech
Here are a few more good discussions: http://bakery.cakephp.org/articles/AD7six/2006/10/09/pagination http://www.cakephpforum.net/index.php?showtopic=186 http://www.sakic.net/blog/changing-cakephp-pagination-urls McS . -- Our newest site for the community: CakePHP Video Tutorials http://tv.cak

Re: Trying to reduce arrays

2011-12-08 Thread McScreech
Here's what I came up with. function flattenArray($a) { // reduce raw matrix to single level matrix of matrices // that will be the rows in results table. $r1 = array(); $r2 = array(); foreach ($a as $k1 => $v1) { foreach ($v1 as $k2 => $v2)

What does _App mean in cakephp?

2011-12-12 Thread McScreech
My question is in reference to the following post by Andy Dawson. I have successfully used his advise in my app as posted. I do now have working back references in my edit views and am very appreciative, I'm just trying to understand the details. What I don't understand is the relevance of _App in

Re: What does _App mean in cakephp?

2011-12-12 Thread McScreech
Sorry, forgot the environment details: Win XP SP3 Apache 2.2.16 PHP 5.3.3 cakePHP 1.3.4-0 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.

Re: What does _App mean in cakephp?

2011-12-13 Thread McScreech
Thanks very much Andy. I have not read about this inability to pass 1-dimensional data anywhere before. Is this detail in the manual somewhere? In the API? May I infer from your reply that it IS now possible in 2.0? Also, (if I'm not asking too much here) why was this so? Thanx, McS On Dec 13, 3

Re: What does _App mean in cakephp?

2011-12-14 Thread McScreech
Thanx again. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegrou

Trouble upgrading from 1.3.4 to 2.0.4

2011-12-14 Thread McScreech
Win XP SP3 Apache 2.2.16 PHP 5.3.3 cakePHP 1.3.4-0 (trying for 2.0.4-0) I'm attempting to upgrade from cake 1.3.4 to 2.0.4 with limited success. I use a non-standard setup as described in 'http://ad7six.com/ 2007/08/24/Production-setup-revisited.html'. I've actually had this running for some time

Re: Trouble upgrading from 1.3.4 to 2.0.4

2011-12-15 Thread McScreech
Thanx Mark. I shall try it out today. McS -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to ca

Re: Trouble upgrading from 1.3.4 to 2.0.4

2011-12-15 Thread McScreech
Yaahooo!!! I appear to have upgraded successfully. Thanx VERY MUCH Mark! I had only two hitches after upgrading that prevented my app from loading (and only about an hour of effort): 1) I had to remove a closing php tag from the end of app\config \routes.php (which subsequently preceded the upgrad

Re: Trouble upgrading from 1.3.4 to 2.0.4

2011-12-15 Thread McScreech
Damn, I was wrong - it's not actually working. I'm going to have to start over again since I'm beginning to lose myself in the tangle I've created. I'll post back again after I make a fresh install and step through the process again. -- Our newest site for the community: CakePHP Video Tutorials

Re: Trouble upgrading from 1.3.4 to 2.0.4

2011-12-16 Thread McScreech
snt working? any specific errors? > > On 15 Dez., 20:29, McScreech wrote: > > > Damn, I was wrong - it's not actually working. I'm going to have to > > start over again since I'm beginning to lose myself in the tangle I've > > created. > > I'

Re: Trouble upgrading from 1.3.4 to 2.0.4

2011-12-16 Thread McScreech
btw, since I'm using a non-standard setup, would there be any benefit to copying my app and webroot directories back under the cake install location before my next attempt? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions si

Re: Trouble upgrading from 1.3.4 to 2.0.4

2011-12-16 Thread McScreech
OK, I think I'm almost there. Both upgrade and command shell scripts ran to completion with no errors reported. However, when I try to access the app in the browser I get the following error on an otherwise blank page: Fatal error: Class 'Helper' not found in C:\_web\lab\cakes\204\GPDdev \View\Help

request->is('post') v request->is('put')

2012-02-01 Thread McScreech
I'm trying to understand the use of the request->is method in the CakePHP 2.0.4 baked actions. I have reduced the generated add and edit functions from a controller baked with CakePHP 1.3.4 and 2.0.4 to pseudo-code below to demonstrate my question. I am basing my expectations on the opinion I deriv

Re: Trouble upgrading from 1.3.4 to 2.0.4

2012-02-06 Thread McScreech
Apologize for the late return to this post, was away for a bit then assigned to other duties on my return. Short version: Yh, SUCCESS!!! Long version: I applied Mark's advise, successfully used his upgrade plugin, then only needed to adjust my code to conform to the new Auth component by

Re: request->is('post') v request->is('put')

2012-02-06 Thread McScreech
OK, I get that. Then the core of my question is: The condition in add function makes sense to me: if ($this->request->is('post')) But why does the edit function use this: if ($this->request->is('post') || $this->request->is('put')) and not this?: if ($this->request->is('put')) McS.

Re: request->is('post') v request->is('put')

2012-02-13 Thread McScreech
No one willing to explain this one? On Feb 6, 11:12 am, McScreech wrote: > OK, I get that. Then the core of my question is: > The condition in add function makes sense to me: >     if ($this->request->is('post')) > > But why does the edit function use this: >

Re: request->is('post') v request->is('put')

2012-02-13 Thread McScreech
if ($this->request->is('post') || $this->request->is('put')) and not this?: if ($this->request->is('put')) McS On Feb 13, 2:35 pm, McScreech wrote: > No one willing to explain this one? > > On Feb 6, 11:12 am, McScreech wrote:

How to detect which button on input form pressed?

2012-02-13 Thread McScreech
PHP 5.3.3, CakePHP 2.0.6 echo $this->Form->submit('Submit', array('div'=>false, 'name'=>'Submit' )); echo $this->Form->submit('Cancel', array('div'=>false, 'name'=>'Cancel' )); If I code multiple buttons on my form as above, how do I detect when the Cancel button is pressed? McS -- Our newest

Re: How to detect which button on input form pressed?

2012-02-13 Thread McScreech
Thank you, that did it. McS On Feb 13, 3:05 pm, Tilen Majerle wrote: > if (isset($this->request->data['Submit'])) {} > or > if (isset($this->request->data['Cancel'])) {} > > -- > Lep pozdrav, Tilen Majerlehttp://majerle.eu > > 2012/2/

Re: How to detect which button on input form pressed?

2012-02-13 Thread McScreech
7;re > canceling why are you submitting the form? Why not just link them back > to the index or wherever they came from. > > On Feb 13, 12:02 pm, McScreech wrote: > > > > > > > > > PHP 5.3.3, CakePHP 2.0.6 > > > echo $this->Form->submit('

Fatal Error on call to '$this->Session->setFlash'

2012-09-13 Thread McScreech
G'day, I do not understand how I induced this error: 'Error: Call to a member function setFlash() on a non-object' which happens on any call to '$this->Session->setFlash' as noted in the default edit (or add) function below? I was adding options to the related form (option lists, labels, titles)

Re: Fatal Error on call to '$this->Session->setFlash'

2012-09-13 Thread McScreech
Thank you very much, I had forgot to include the Session component. I haven't begun a new project in some time (since about cake 1.2) - forgot some basis setup stuff, I guess I was thinking the basic components and helpers were included by default. I do wonder however, how it _was_ able to work

DebugKit behaviour

2013-01-14 Thread McScreech
Hello, [ Apache 2.2.22 (Win32), MySQL 5.5.21, PHP 5.3.5, cakePHP 2.2.1 ] I'm having odd (IMO) behaviour from DebugKit - the toolbar only shows up if there are errors on the page and NOT if it renders correctly. Is this expected behavior? If so, how do I force the DebugKit toolbar to always disp

Re: DebugKit behaviour

2013-01-14 Thread McScreech
On Monday, January 14, 2013 11:12:05 AM UTC-5, McScreech wrote: > > Hello, [ Apache 2.2.22 (Win32), MySQL 5.5.21, PHP 5.3.5, cakePHP 2.2.1 ] > > I'm having odd (IMO) behaviour from DebugKit - the toolbar only shows up > if there are errors on the page and NOT if it rende

Re: DebugKit behaviour

2013-01-14 Thread McScreech
On Monday, January 14, 2013 11:12:05 AM UTC-5, McScreech wrote: > > Hello, [ Apache 2.2.22 (Win32), MySQL 5.5.21, PHP 5.3.5, cakePHP 2.2.1 ] > > I'm having odd (IMO) behaviour from DebugKit - the toolbar only shows up > if there are errors on the page and NOT if it renders co

Re: DebugKit behaviour

2013-01-15 Thread McScreech
On Monday, January 14, 2013 3:37:18 PM UTC-5, AD7six wrote: > > > > On Monday, 14 January 2013 20:28:31 UTC+1, McScreech wrote: >> >> On Monday, January 14, 2013 11:12:05 AM UTC-5, McScreech wrote: >>> >>> Hello, [ Apache 2.2.22 (Win32), MySQL 5.5.

odd results from auth redirect

2013-05-08 Thread McScreech
Been following the acl and auth tutorials and appear to be near working except for AuthComponent loginRedirect and logoutRedirect properties. Very bare-bones setup as listed below. Watching the DebugKit.Toolbar output I note the following: 1) on the users/login page Session > Auth > redirect is

just curious about changes in 2.3.x code

2013-05-10 Thread McScreech
G'day, Just been surfin the code and wondered, 1) Why the changes from [not] equal to ---> [not] identical to ( != | == ---> !== | === ) (many examples throughout code in 2.3.0 ---> 2.3.2: Utility\Debugger.php, Routing\Router.php, Network\CakeRequest.php, etc) 2) Why the changes to drop ret

Re: just curious about changes in 2.3.x code

2013-05-10 Thread McScreech
cool, thanx mark -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email

Re: odd results from auth redirect

2013-05-13 Thread McScreech
eforeSave($options = array()) from auth tutorial On Wednesday, May 8, 2013 12:27:14 PM UTC-4, McScreech wrote: > > > Been following the acl and auth tutorials and appear to be near working > except for AuthComponent loginRedirect and logoutRedirect properties. Very > bare-bones setup

Re: odd results from auth redirect

2013-05-13 Thread McScreech
return $this->redirect($this->Auth->redirectUrl()); // from Auth tutorial } else { $this->Session->setFlash('Your username or password was incorrect.'); } } } // end login() On Wednesday, May 8, 2013 12:27:14 PM UTC

paths in cake environment being mangled

2014-07-09 Thread McScreech
Hi all, Can anyone explain this behaviour? This setup worked for me prior to upgrading my pc from XP to Win7. I am now assuming that I have rebuilt my folder structure differently from the original setup with some detail missing/changed that has become invisible to me. However, the mangling of

Re: paths in cake environment being mangled

2014-07-09 Thread McScreech
P.S. When I try to access the login page it returns a blank page with the following message regardless of changes to any path variable: 'Not Found The requested URL /promats/users/login was not found on this server.' -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter ht

Re: paths in cake environment being mangled

2014-07-09 Thread McScreech
ave something visible to work with, eh? ;-) BTW, the paths are still mangled as described in my original post. On Wednesday, 9 July 2014 13:36:14 UTC-4, McScreech wrote: > > P.S. When I try to access the login page it returns a blank page with the > following message regardless of cha

Re: paths in cake environment being mangled

2014-07-10 Thread McScreech
led as described in my original post. > > On Wednesday, 9 July 2014 13:36:14 UTC-4, McScreech wrote: >> >> P.S. When I try to access the login page it returns a blank page with the >> following message regardless of changes to any path variable: >> 'Not Found

Re: paths in cake environment being mangled

2014-07-24 Thread McScreech
bump -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php

Re: paths in cake environment being mangled

2014-07-30 Thread McScreech
, José Lorenzo wrote: > > How did you determine the paths were mangled? > > On Thursday, July 24, 2014 3:10:54 PM UTC+2, McScreech wrote: >> >> bump >> > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You re

Re: Naming Conventions... Apply. Applys. Applies? Gobsmacked!

2014-09-10 Thread McScreech
You can add rules for the inflector class in your app/config/bootstrap.php file. For example, my app has a few relational tables that refer to events rather than entities (selected, mated, planted, treated). These models I do not want pluralized, so I add the following line to end of bootstrap.

Re: cant send email from localhost

2014-12-23 Thread McScreech
I have found that firewall and/or virus scanner settings will prevent mailing from localhost. Since I am working in a corporate intranet environment, I have no access to any of the configuration settings needed to compensate - so, I simply CANNOT use such functionality. In my case, I have smtp p

namespaces in cakePHP 3?

2015-01-23 Thread McScreech
where are namespaces defined in cakePHP 3 source? (i'm posting on google groups cakePHP **and** stackoverflow cakePHP) (if this is the wrong place to post this, i appologize - where **should** it go?) setup: Windows 7 Business Edition Service Pack 1 Server version: Apache/2.4

Re: namespaces in cakePHP 3?

2015-01-23 Thread McScreech
sorry, i meant to ask about the 'Cake' namespace specifically. thanx again. On Friday, 23 January 2015 15:07:25 UTC-5, McScreech wrote: > > where are namespaces defined in cakePHP 3 source? > > (i'm posting on google groups cakePHP **and** stackoverflow cakePHP) &g

Re: namespaces in cakePHP 3?

2015-01-23 Thread McScreech
got it, many thanx. On Friday, 23 January 2015 15:07:25 UTC-5, McScreech wrote: > > where are namespaces defined in cakePHP 3 source? > > (i'm posting on google groups cakePHP **and** stackoverflow cakePHP) > (if this is the wrong place to post this, i appologize - where

Re: Cakephp 3 core path change

2015-08-04 Thread McScreech
On Monday, 20 July 2015 15:52:15 UTC-4, CCorreia wrote: > > Hi everyone. > > "Config/paths.php" : define('CAKE_CORE_INCLUDE_PATH', > '/path/to/library/cakephp'); > > I have no trouble running the code after this change but as soon as I > remove the folder /cakephp/cakephp from the /vendors I st