Ideas about models and associations

2008-09-17 Thread Günther Theilen
Hi! I'm working on a new project and right now I'm struggling a bit to put the requirements together in a proper cake-like way. I use Auth/ACL which is set up and works fine. The users who can log-in belong to three different groups. These groups are defined by a field role_id in the user

Re: Ideas about models and associations

2008-09-17 Thread Siegfried Hirsch
How about defining an ProfilesController as the base class for the other controllers for your different models. That what we have done in a similar case, where we had contacts and people and companies depending on the ContactsController. On Wed, Sep 17, 2008 at 8:10 AM, Günther Theilen [EMAIL

Re: Ideas about models and associations

2008-09-17 Thread Günther Theilen
Could you please provide some code snippets as I don't see the difference between our approaches? Siegfried Hirsch wrote: How about defining an ProfilesController as the base class for the other controllers for your different models. That what we have done in a similar case, where we had

Problem on session

2008-09-17 Thread [EMAIL PROTECTED]
Hi I have cake 1.1.13 I have this problem on session. My session is setted in this way in core.php: define('CAKE_SESSION_SAVE', 'cake'); define('CAKE_SECURITY', 'low'); define('CAKE_SESSION_TIMEOUT', '288'); (Session time = 24 hour ) Now I noted in tmp/ where there are session cookies that these

Core lib Folder - Folder::tree fatal error, call to undefined method __tree()

2008-09-17 Thread Howard Lince
Core lib Folder - Folder::tree fatal error, call to undefined method __tree() as the title states, for some reason calling Folder::tree comes back with this error: Fatal error: Call to undefined method PublishController::__tree() in ..cake\libs\folder.php on line 416 I'm not sure if this is my

Re: Accessing MySQL default values

2008-09-17 Thread grigri
It's easy to get the default values. Setting them would be harder (especially since cake caches the model schema, so you'd have to kill that once you changed it as well). To get the default values, just use `Model::schema()` : $fields = $this-Model-schema(); echo 'dl'; foreach ($fields as $key

Re: Model Baker Beta

2008-09-17 Thread andruu
Where can this be downloaded? I saw the video on Youtube. On Sep 16, 4:50 am, JJ [EMAIL PROTECTED] wrote: I've been trying out the Beta version of ModelBaker...Has anyone seen or tried it?  It definitely makes building websites a whole lot faster and easier. Really easy to use, self

cakePHP Console; Problem: 'Error: schema.php could not be loaded'

2008-09-17 Thread Omar
Hi, I had a problem with cake Console. I'm sorry if I said this console is reared. Ok let me show you the problem: I have Ubuntu 8.04, LAMPP (PHP5, MYSQL, etc) + php5-cli, mysql- client-5.0, Everything works just fine. even CakePHP works well. But I was trying to access the console writing: cake

[OT] Cake on rails

2008-09-17 Thread Wojciech
Hey bakers! Did you see one? http://www.cakeonrails.co.uk/ --~--~-~--~~~---~--~~ 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

Re: Is there a way I can have find('all') return an array that is indexed by the value of one of the fields?

2008-09-17 Thread yash
hey there... this is what i have been looking for... but there is a small problem... i am using it on a model which is belongs to another model. with a normal find('all') i get this result.. [0] = Array ( [Model1] = Array ( [a] = 0

problem using find method in cakephp with conditions contains 'LIKE'

2008-09-17 Thread jittos....
i am a new comer in cakephp.. i am going through some tutorials in cakephp.. i found one problem i want to write find method for the following query SELECT `Book`.`isbn`, `Book`.`title`, `Book`.`author_name` FROM `books` AS `Book` WHERE `Book`.`title` LIKE 'A%' ORDER BY `Book`.`isbn` DESC LIMIT

Re: Is there a way I can have find('all') return an array that is indexed by the value of one of the fields?

2008-09-17 Thread Marc Schuetze
I excidently posted this with an error before this should work function find($type, $queryData = array()) { if(isset($queryData['index'])) { if($queryData['index'] === true) { $index_path =

Re: problem using find method in cakephp with conditions contains 'LIKE'

2008-09-17 Thread RichardAtHome
'conditions' = array('Book.title LIKE' = 'A%'), The condition has been moved to the left hand side as a security measure. On Sep 17, 8:14 am, jittos [EMAIL PROTECTED] wrote: i am a new comer in cakephp.. i am going through some tutorials in cakephp.. i found one problem i want to write

Re: Cake on rails

2008-09-17 Thread Donkeybob
Is this real? Everything points to being a joke to me. . . I don't see any real world code . . . . On Sep 17, 3:32 am, Wojciech [EMAIL PROTECTED] wrote: Hey bakers! Did you see one? http://www.cakeonrails.co.uk/ --~--~-~--~~~---~--~~ You received this message

getting cake bake to work on vista, xampp..

2008-09-17 Thread gabriel
hi, I would like to know if anyone can help me.. I am trying to get cake bake to work on vista, xampp, I have also installed cygwin.. I have included in my advanced-Enviroment Variables-path (edit) C:\xamp\php\php4\phpcli.exe;C:\xamp\htdocs\testsite\cake\console \cake.bat yet when I type in '

Re: Model Baker Beta

2008-09-17 Thread [EMAIL PROTECTED]
On Sep 17, 10:12 am, andruu [EMAIL PROTECTED] wrote: Where can this be downloaded? I saw the video on Youtube. http://www.widgetpress.com/ It's a private beta at the moment though, a message on the home page says... Interested Beta Users? Contact [EMAIL PROTECTED]

Re: soap with attachment which datatype to use?

2008-09-17 Thread [EMAIL PROTECTED]
This is in no way related to CakePHP but I have done this using nusoap and used multipart/mixed. But the other side must of-course understand the datatype you use... On Sep 17, 12:13 am, . [EMAIL PROTECTED] wrote: how would i do soap attachments? Would I use type binary = xsd:base64binary

Re: localization

2008-09-17 Thread Claudia
Hi there I haven't read the article, so I am not sure whether this fits in with whatever the article says. I always use utf-8 as character encoding and never had any troubles with Cake localisation. In the views you simply use the function __() (or one of the other translation functions) to get

checkbox value becomes default (1) after submit

2008-09-17 Thread Klesus
Hi, I have a checkbox with a particular value in a form, here is the code : ?php echo $form-checkbox('Task.repeated_task', array('value' = 'yes', 'checked' = 'unchecked')); ? The first loading of the form is correct, the generated html is : input type=checkbox

Re: Cake on rails

2008-09-17 Thread phpcurious
yep. it's not real. i think they just want to use cakephp's popularity in Search engines to make their site to earn some. On Sep 17, 9:13 pm, Donkeybob [EMAIL PROTECTED] wrote: Is this real? Everything points to being a joke to me. . . I don't see any real world code . . . . On Sep 17, 3:32 

Re: changing data in the hasAndBelongsToMany tables

2008-09-17 Thread nachopitt
Hey thanks a lot for this information. Do you know how to handle this when you have multiple People to be attached to the same Match, along with the roles? On Sep 16, 12:08 pm, Dérico Filho [EMAIL PROTECTED] wrote: Just solved it:                 $this-Match-save(                        

Re: getting cake bake to work on vista, xampp..

2008-09-17 Thread Gabriel Kolbe
Thanks a mil, got it working !! On Wed, Sep 17, 2008 at 3:16 PM, Donkeybob [EMAIL PROTECTED] wrote: I got this to work on my vista machine but I didn't use the direct file name in the path, just try C:\xampp\php; C:\xamp\htdocs\testsite\cake\console It works like a charm for me On Sep

Calling Jquery function in afterSave()

2008-09-17 Thread osxboy
Hi I want to call: parent.$.akModalRemove(); in afterSave() but can't work it out! I want the data to be saved and then parent.$.akModalRemove(); closes the DIV containing the form --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Auth Redirect Problems

2008-09-17 Thread Okto Silaban
I'm not really sure, but I think : $this-Auth-loginRedirect doesn't tell we're we gonna go after logging in.. But, if we're acessing an area which not allowed by Auth, we will sent to that page.. (if you're not login yet..). So I set that in beforeFilter : function beforeFilter() {

Re: Unsigned Integers??

2008-09-17 Thread Brenton B
Yeah, makes sense. On Sep 16, 5:00 pm, villas [EMAIL PROTECTED] wrote: Hi, I think only the dev team can explain exactly why Cake is the way it is. However, I thought that you'd probably answered your own question :-) Many of us do not use MySql and we are delighted that so much effort

Fwd: problem in cakephp style

2008-09-17 Thread wael altahawi
-- Forwarded message -- From: wael altahawi [EMAIL PROTECTED] Date: Wed, Sep 17, 2008 at 8:59 AM Subject: problem in cakephp style To: cake-php@googlegroups.com hi 1) i have installed AppServ 2.5.10: Apache 2.2.8 PHP 5.2.6 MySQL 5.0.51b phpMyAdmin-2.10.3 2) under

question regarding swfupload component

2008-09-17 Thread introvert
Hello I have recently started learning cakephp and came around swfupload component for cakephp available here: http://bakery.cakephp.org/articles/view/swfupload-and-multipurpose-uploader However, I couldnt figure out two things. There are 2 view template files but I dont know how should I call

Re: question regarding swfupload component

2008-09-17 Thread Donkeybob
what version of cake are you using? if its 1.2 then you use the .ctp file, if earlier then you can use the .thtml file On Sep 17, 2:33 pm, introvert [EMAIL PROTECTED] wrote: Hello I have recently started learning cakephp and came around swfupload component for cakephp available

Re: Calling Jquery function in afterSave()

2008-09-17 Thread the_woodsman
Sorry osx boy, I don't quite get what you're trying to achieve, but it's absolutely nothing like this! Jquery is part of the html / view layer, and the model layer can't/shouldn't have anything to do with it! Perhaps what you want to do is: - call a controller function via a AJAX request -

Re: Model Baker Beta

2008-09-17 Thread villas
It's Mac only - shame. On Sep 17, 2:32 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Sep 17, 10:12 am, andruu [EMAIL PROTECTED] wrote: Where can this be downloaded? I saw the video on Youtube. http://www.widgetpress.com/ It's a private beta at the moment though, a message on the home

Model association

2008-09-17 Thread VitillO
Hi, i have the following structure for a tshirt online store: Product HABTM Size Size HABTM Product Association table: products_sizes The problem is, i need a stocks system. For example, say i have 50 pieces of S (size) for a particular tshirt, before using cake i had a column 'stock' in the

Association question

2008-09-17 Thread VitillO
Hi, i have the following structure for a tshirt online store: Product HABTM Size Size HABTM Product Association table: products_sizes The problem is, i need a stocks system. For example, say i have 50 pieces of S (size) for a particular tshirt, before using cake i had a column 'stock' in the

Re: Cake setup for this kind of site:

2008-09-17 Thread moment11
I was hoping to make a couple of directories under the webroot, e.g. www.mysite.com/nonCakeDir1/ www.mysite.com/nonCakeDir2/ so I could then make calls to php files within those. (e.g. www.mysite.com/nonCakeDir2/hello.php) But as soon as there is a directory within the webroot, cake wants to

Re: Model association

2008-09-17 Thread Luiz Poleto
You can create the column stock in the association table.In the form where you do the association, you can add a new field for the stock. At least that was what i understood from your question... Regards, Luiz Poleto 2008/9/17 VitillO [EMAIL PROTECTED] Hi, i have the following structure for

Re: Cake setup for this kind of site:

2008-09-17 Thread Sam Sherlock
I have these in my .htaccess RewriteRule (nonCakeDir1|nonCakeDir2)/(.*) - [L] 2008/9/17 moment11 [EMAIL PROTECTED] I was hoping to make a couple of directories under the webroot, e.g. www.mysite.com/nonCakeDir1/ www.mysite.com/nonCakeDir2/ so I could then make calls to

Re: Model association

2008-09-17 Thread Adam Royle
You can create a model for your habtm association so you can add extra fields, etc, using the with key. Something like this... class Product extends AppModel { ... var $hasAndBelongsToMany = array( 'Size' = array('className' = 'Size', 'with' = 'ProductsSize', // -- this here, class

Sorting without Paginator

2008-09-17 Thread Brenton B
Hello. I would like to make use of the sort functionality in the Paginator class; however, don't want to actually paginate. My options are to either strip out the Sort stuff and create a new helper, or set the 'limit' in the options to something crazy high - which I think is a bit of a hack. I

$htmlHelper and layouts for a cake noob

2008-09-17 Thread brookshanes
I am using $htmlHelper helper class to create a link to a page. However when I use this on my default layout and click the link, I get a URL submitted like: /myController/myOtherController/view/index I need to have pretty URL's and cannot also figure out how to get rid of index.php in my URL.

Re: Clean retrieved data.

2008-09-17 Thread seanislegend
Hi Villas, I know the basic functionality for what I'm trying to achieve. It's just I'd obviously rather do it nicely, with CakePHP conventions in mind, rather then making some unneeded mess. On Sep 15, 11:53 am, villas [EMAIL PROTECTED] wrote: Did you try

Custom parameter separater in route URL?

2008-09-17 Thread equestrianerd
I would like to set up my URL for a controller to be: /persona/:action/:firstname_:lastname/ So to view a persona named John Smith, the URL would be example.com/persona/john_smith/ However, when I try to implement this, it thinks that Smith is the first name, and there is no last name

Re: Model association

2008-09-17 Thread VitillO
Hi guys, thanks for your replies. Right now, im my 'add' view of products, im getting a multiple select for the sizes, where i can select which sizes are available for that particular product, thats fine. The problem is that i need a stock number for each of this available sizes, so a multiple

Plural name: Emphases - Emphasis

2008-09-17 Thread Brenton B
Model is 'emphasis', plural is 'emphases'. Yet Cake doesn't seem to like it. libs/controller/inflector.php ... line 89 seems to have what it takes, but no love ... Thoughts? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Populating a selectTag using jQuery AJAX

2008-09-17 Thread peterhf
Using: CakePHP 1.1.19.6305 jquery-1.2.6.min.js In the view: trtd align=right class=label_14 width=200pxselect a campaign:nbsp;/tdtd align=left?php echo $html- selectTag( 'Campaign/CampaignID', $options_C, null, array( 'onchange' = 'display_select_event()','id' = 'select_campaign' ), null, true,

Re: Plural name: Emphases - Emphasis

2008-09-17 Thread Joel Perras
If Cake doesn't inflect the word 'emphasis' properly, you can add a custom inflection: http://book.cakephp.org/view/47/Custom-Inflections -J. On Sep 17, 8:27 pm, Brenton B [EMAIL PROTECTED] wrote: Model is 'emphasis', plural is 'emphases'. Yet Cake doesn't seem to like it.

Re: Sorting without Paginator

2008-09-17 Thread Joel Perras
FYI, the MySQL docs actually recommend that to retrieve all rows from a certain offset up to the end of the result set, you can use some large number for the second parameter. You can always wrap this up in a custom pagination function, which should achieve your desired result. If you want to

Re: Populating a selectTag using jQuery AJAX

2008-09-17 Thread teknoid
Perhaps I didn't look at your code very closely, but after you've made the xml string ($xml) what happens? Shouldn't your action output (return) that xml? I'm not sure if 1.1 has the ability to use RequestHandler to respond as xml, otherwise you could just make an empty layout, which would only

Re: Model association

2008-09-17 Thread teknoid
I explain how with work here, I think this should be good to get you started: http://teknoid.wordpress.com/2008/07/03/notes-on-cakephp-habtm-part-1-the-basics/ Also, just a hint... cake can easily create checkboxes for you (instead of multi-select). Just tell it to use 'multiple'='checkbox' in

[OT] Re: Plural name: Emphases - Emphasis

2008-09-17 Thread David C. Zentgraf
OT: Inflector recently thought the singular form of Pasta is Pastum. That class can be really good for a laugh sometimes. :-D On 18 Sep 2008, at 09:54, Joel Perras wrote: If Cake doesn't inflect the word 'emphasis' properly, you can add a custom inflection:

Re: Form data from a view element

2008-09-17 Thread Luenyar
$form-create('Comment') associates the form with the 'Comment' model, but not a controller. Presumably because the 'Comments' model could be used in many or all of your controllers with $uses. The 'action' option assumes the current controller, so if you render your element in the Posts

Forms not validating while using EmailComponent?

2008-09-17 Thread 703designs
How can I check if the data is valid before trying to send the mail out? Validation errors are falling into the email failed condition, and validation errors aren't reported to the user. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Populating a selectTag using jQuery AJAX

2008-09-17 Thread hydra12
In your controller, you need to $this-set('xml',$xml); Set the layout to be blank (1.2 has an ajax layout that would work for this, but I don't know if 1.1 does or not). You need a view called get_events that does this: ?php echo $xml; ? Your jquery is calling Attendance/get_events, so there

Re: Plural name: Emphases - Emphasis

2008-09-17 Thread Brenton B
Ha! harsh Thanks Joel, I figured it had to be straight forward (feel kinda silly now, meh), was just going in circles looking for it. On Sep 17, 8:03 pm, David C. Zentgraf [EMAIL PROTECTED] wrote: OT: Inflector recently thought the singular form of Pasta is Pastum. That class can be really

Re: Plural name: Emphases - Emphasis

2008-09-17 Thread Daniel Hofstetter
Hi Brenton, Model is 'emphasis', plural is 'emphases'. Yet Cake doesn't seem to like it. libs/controller/inflector.php ... line 89 seems to have what it takes, but no love ... Thoughts? Open a ticket for it on https://trac.cakephp.org so it can get fixed. -- Daniel Hofstetter

Re: $htmlHelper and layouts for a cake noob

2008-09-17 Thread Lance Willett
I need to have pretty URL's and cannot also figure out how to get rid of index.php in my URL. When index.php appear in the URL, it's usually an issue with htaccess rules or your server setup not supporting mod_rewrite. See the Cookbook page on mod_rewrite for more:

Re: Model association

2008-09-17 Thread VitillO
Ok guys, it seems i have the data (extra field 'stock' in the association table) in $this-data when i edit a Product, something like this, so the association table is auto-modelized: [Size] = Array ( [0] = Array ( [id] = 2

a complex data model- a cakephp breakthrough?

2008-09-17 Thread bMilesp
This is an interesting problem that i believe can have a reasonable solution using cakephp. i'm not going to get into the background, but it stems from this idea: http://fornicode.com/2008/03/18/cakephp-a-has-either-association/ now for the business. my current company has a custom built CMS

afterFind results formatting problem

2008-09-17 Thread brotherkeen
I am having a problem where the $results array is being formatted differently for two different NON-primary calls ($primary == false). Here's my setup: - Model_A hasMany Model_B - Model_B hasOne Model_C - Model_C has an afterFind() callback to modify the results. Now, here is what happens:

Re: Auth Redirect Problems

2008-09-17 Thread brotherkeen
Tony, I have the same problem. The redirect is inconsistent. Sometimes it redirects to my intended target. Other times it redirects to the page (or action/view) that I visited prior to visiting the login page. I also tried this method (mentioned above), and it did not work for me either.

Saving to multiple tables from one form

2008-09-17 Thread tbudzins
Hello I was wondering what the logic would be to save to multiple tables from one row, for example: if a form has a address, username and password. I would want to keep the address in the address table and the username and password in the user table. Would I need to call 2 separate Save calls in