Re: Why CakePHP ?

2014-09-03 Thread David Suna
If all you need is a CMS I would suggest using an existing CMS rather than trying to build one yourself in any language. There are many good CMS packages available and some of them are based on CakePHP. CakePHP, or another framework regardless of the language it is based on, is appropriate for

Does CakePHP 2.5 support the HSTORE and ARRAY data types from PostgreSQL?

2014-07-22 Thread David Suna
We are looking into what framework to use for a new project. One of the requirements of the project is to use PostgreSQL and take advantage of the Postgres specific data types like HSTORE. Is that something that CakePHP supports? Thanks. -- Like Us on FaceBook

Re: Form field which is displayed only

2014-06-12 Thread David Suna
Why are you using a form field at all? If you just want to display the data then just output the data as text. On Tuesday, June 3, 2014 2:13:58 PM UTC+3, th...@gmx.at wrote: I'm using CakePHP 2.4.9 In my application I want to have a readonly field where I display data which cannot be

Using PHPUnit for code that requires basic authentication

2013-09-30 Thread David Suna
How do I write test cases in PHPUnit for code that is using the Auth module with basic authentication? I have found bits and pieces of information about it but does anyone know of a step by step howto or detailed documentation? My code limits certain actions to certain user types so it calls

Putting custom code in a separate repository

2013-09-09 Thread David Suna
I started a project locally by cloning the git repository for CakePHP (branch 2.4). I would like to maintain the ability to do a pull on the git repository to get any updates as new releases are put out. I assume I should be on branch 2.4 rather than on master. I would also like to have my

Re: Putting custom code in a separate repository

2013-09-09 Thread David Suna
Thanks for the suggestion. From a quick look at git submodules it seems that they are geared to using them in a single directory. The changes to a clean CakePHP installation end up being across multiple directories as well as include changes to some of the files in the original CakePHP

Re: Putting custom code in a separate repository

2013-09-09 Thread David Suna
On Monday, September 9, 2013 4:58:06 PM UTC+3, Simon Males wrote: Some people have made lib/Cake a submodule https://github.com/nodesagency/cakephp-lib This sounds like it would work although it is somewhat of a shame to leave out all the code under app. My question would be how to get

Re: Putting custom code in a separate repository

2013-09-09 Thread David Suna
On Monday, September 9, 2013 5:05:04 PM UTC+3, Jeremy Burns : class...@classoutfit.com wrote: You add submodules in a path relative to the root of the git repository. I am a Git command line coward so use SourceTree (http://sourcetreeapp.com) which does it all for me. I have all (most) of

parseExtensions and ssl

2013-09-02 Thread David Suna
I am developing a REST API. I have it working using paresExtensions and mapResources. However, if I try to access the API using ssl (https instead of http) the routing does not seem to work and I get an error Missing Method in TenantsController *Error: * The action *30.json* is not defined

Re: User Defined Dashboard?

2013-09-02 Thread David Suna
If I understand the problem correctly I would restate it as: There are dashboard items (DashboardItem) that can be displayed on a dashboard. There is a relationship between user groups (Group) and a subset of dashboard items defining which dashboard items can be displayed for that group. You

Throwing error should output JSON

2013-08-28 Thread David Suna
I am developing a REST API using the latest CakePHP. I was under the impression (from a presentation I watched on YouTube from CakeFest 2010) that I could throw an error and have it return the error as JSON to the client by adding a json direction below /app/View/Errors and adding the

Re: Throwing error should output JSON

2013-08-28 Thread David Suna
Replying to myself - this is what I found. The presentation that I saw that said that putting error400.ctp in a json folder under /app/View/Errors would work automatically seems to be incorrect. The solution I came up with included the following steps: 1. Set a flag in

Best practice for Helpers

2013-07-16 Thread David Suna
As a best practice, should a helper output content or return the content to the View? In other words, should the call to the helper be: $this-MyHelper-someMethod($DataForHelper); or echo $this-MyHelper-someMethod($DataForHelper); Most of the built in helpers seem to prefer the latter form.

Re: Generating multiple 'requests' based on form selections

2013-06-30 Thread David Suna
I think your use of the term request is confusing. Do you need the client to issue six requests to the server with the various combinations? Or can the client issue a single request with all of the information and have the server process that as a request for six new records to be created? If

Re: Saving session data from a view

2013-06-16 Thread David Suna
Thanks for your response. As I had no choice that is what I ended up doing. However, the information I was interested in storing was only relevant to the view (i.e. which menu was opened when the user clicked on a link) and only meant for use in the view (reopen the menu that was opened at

Saving session data from a view

2013-06-12 Thread David Suna
I am using CakePHP 1.3. I have a helper which prints out the navigation menus. Depending on which top level menu is selected the appropriate sub menu is displayed. I want to be able to know on the next page view which menu / sub menu was previously displayed. I thought to accomplish this by

Re: How to delete an ACL node

2013-04-25 Thread david . suna
try cake acl help You can delete either and aro or an aco using cake acl delete aco node or cake acl delete aro node I am using CakePHP 1.3 so I don't know if this has changed in the 2.x series -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter

Re: Checking Consistency Before Saving

2013-04-23 Thread david . suna
I think a more basic question has to do with the data model. Why are you duplicating information in two places? If the Student has a reference to a Province and a Province has a reference to a Country then you do not need a reference to a Country in Student. From a UI standpoint I would

Re: changing table fields value for all found in the list

2013-04-17 Thread david . suna
Yes you have to have in front of $photo. This makes $photo a reference to the element in $photos instead of a copy. If you don't have it then you will be modifying a copy of the array element and not the element itself. See http://www.php.net/manual/en/language.references.php for a

Re: find all users from another table

2013-04-16 Thread david . suna
Since you are calling find the first time with 'list' it is returning the array as you state. However, you are trying to index into that array with an index of 'PhotoLike' which doesn't exist in that array. So the error message is correct. I believe that the second find should be

Re: changing table fields value for all found in the list

2013-04-16 Thread david . suna
You are doing a redirect inside of your loop which is kicking you out of your loop. That is why only the first update works. Also, there is no need to use the query method. You would be better off looping through the returned items and setting the privacy field and then calling saveAll i.e.

Re: retrieving data in a view cake 1.3

2013-04-02 Thread david . suna
The easiest way to debug a problem like this is to set up a debugging environment (like NetBeans and XDebug see https://netbeans.org/kb/docs/php/debugging.html). You can then set a break point at the point in the code and walk through and look at your data structures to see what is going on.

Re: Multiple Forms on the same form

2013-03-28 Thread david . suna
I have done this using AJAX. Have the button fire an AJAX event which calls an action on your controller which returns an empty workcenter section of the field. Pass in to the AJAX call an index and have the form fields specified using the index. When the form is submitted you would then

Re: Calling functions in other controllers

2013-02-27 Thread david . suna
On Wednesday, February 27, 2013 2:55:53 AM UTC+2, lirc201 wrote: I'm in 2 different controllers. In the checkout controller, I'm trying to call a function in the cart controller. Are you sure that the function is in the cart controller? The $uses variable indicates which other models

Re: Calling functions in other controllers

2013-02-27 Thread david . suna
Sorry - noticed a couple of typos 1. The $uses variable indicates which other models this controller will use 2. you may need to find the cart you are looking for and pass that information into the total() call On Wednesday, February 27, 2013 3:03:24 PM UTC+2, david...@gmail.com wrote: On

Re: Calling functions in other controllers

2013-02-27 Thread david . suna
On Wednesday, February 27, 2013 6:33:41 AM UTC+2, Yasir Arafat wrote: Hello, Before calling make sure you load the model of your cart model like $this-loadModel('Cart'); Since he is already including Cart in the $uses variable he does not need to call loadModel. Also, the notation

Problem with using components when Importing a Controller

2013-02-21 Thread david . suna
I have a controller EmailNotifications which I am accessing using App::Import('Controller', 'EmailNotifications'); The EmailNotifications controller uses the Email component var $components = array('Email', 'RequestHandler'); When I import the controller I use the following code:

Re: Problem with using components when Importing a Controller

2013-02-21 Thread david . suna
On Thursday, February 21, 2013 2:20:00 PM UTC+2, euromark wrote: Even with Cake1.3 you dont import and abuse controllers this way. You need to refactor those controller methods into clean model methods and only re-use those. Since we are talking about sending e-mails which uses the Email

Re: Implementing the Event Notifier Pattern in CakePHP

2013-02-20 Thread david . suna
On Wednesday, February 20, 2013 2:05:49 AM UTC+2, cricket wrote: Better to implement this in a component ... as long as your events will always be triggered from within a controller. That is, you won't be calling it in an afterDelete() callback. From the controller:

Re: Only check beforeDelete if direct deletion

2013-02-19 Thread david . suna
On Monday, February 18, 2013 12:27:46 AM UTC+2, cricket wrote: Perhaps you need to re-think your schema. What is the purpose of Record? Also, why do you wish to cancel a Record delete if an Invoice exists? I abstracted the specific problem domain in the hopes of not getting lost in the

Implementing the Event Notifier Pattern in CakePHP

2013-02-19 Thread david . suna
Does anyone have any advice as to how to go about implementing the Event Notifier pattern in CakePHP 1.3? Basically, I want to have email notifications sent out when various events occur (adding or deleting instances of specific models). The notifications can be sent to different e-mail

Only check beforeDelete if direct deletion

2013-02-17 Thread david . suna
I have an application built with CakePHP 1.3 with a model structure as follows: Tenant hasMany Records (dependent = true) Tenant hasMany Invoices (dependent = true) An Invoice can have a reference to a Record which I represent as Invoices belongsTo Records so that fetching an Invoice will fetch

Re: Only check beforeDelete if direct deletion

2013-02-17 Thread david . suna
Unfortunately, that won't work since an Invoice does not always have a Record. I still need to be able to get all of the Invoices for a Tenant even if there is no Record associated with the Invoice. Similarly, there can be Records that are not referenced by an Invoice. -- Like Us on

Re: Can not save two fields

2013-02-06 Thread david . suna
What is the SQL that is generated from the save function? Do you have a debugging environment set up so you can step through the code? -- 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

$useDbConfig being ignored in 1.3.10

2013-01-28 Thread david . suna
I have an app that was developed using CakePHP 1.3.10. I am now trying to add a controller for a model that is in a different database. The code for the model is very simple: class Cdrs extends AppModel { /** * * @var string The name of the model */ var $name = 'Cdrs'; /**

Re: $useDbConfig being ignored in 1.3.10

2013-01-28 Thread david . suna
I figured out what the problem was. I had misnamed the model file so the file was being ignored and the defaults were being used for the model instead. I renamed the model file correctly and now it is working. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter

Multiple domains sharing a single database with non-unique user names

2013-01-16 Thread david . suna
I have a Cake 1.3 application that we have been developing for a while. The application will support multiple domains and sub domains on a single database. We are using the standard ACL for user login and permissions. The problem that we have run in to is that the user name space is not