Re: hasAndBelongsToMany

2007-11-30 Thread rodrigo aramburu
consegui em parte utilizando $this-Post-findAllByCategoriaId($categoria_id); , mas pelo que vi nesta função não tem como adionar condições ou como ordernar os resultados Em 30/11/07, Augusto Ferreira [EMAIL PROTECTED] escreveu: acho que esta busca deveria ser feita pelo id da categoria, até pq

Re: hasAndBelongsToMany

2007-11-30 Thread Augusto Ferreira
Em vez de $this-Post-findAllByCategoriaId($categoria_id); use $this-Post-findAll('Post.categoria_id = ' . $categoria_id, null, $order); Em 30/11/07, rodrigo aramburu [EMAIL PROTECTED] escreveu: consegui em parte utilizando $this-Post-findAllByCategoriaId($categoria_id); , mas pelo que vi nesta

hasAndBelongsToMany

2007-11-30 Thread rodrigo aramburu
Olá pessoal, Estou com um problemas, estou com um relacionamento n-n, e consigo travar sem problema mas quando tento utilizar um $this-Post-findAll(array(' Categoria.nome'=$nomeCat),array(),null,null,null,3); ele da error e mostra a query , que não inclui a tabela categoria na query. O

Re: hasAndBelongsToMany

2007-11-30 Thread Eber Freitas Dias
Na verdade isso não é possivel de se fazer com o Cake... Não diretamente... O resultado do findAll é a construção de diversas queries, por isso que qdo vc procura sem incluir a categoria, elas aparecem, mas num query só não é possivel buscar numa relação HABTM, porque não é um LEFT JOIN ou coisa

Re: How do I access variables set in App Controller in View?

2007-11-30 Thread Adam Royle
Oh yeah, another thing, the Config class is only in the pre-beta. Adam On Nov 30, 6:40 am, skoggins [EMAIL PROTECTED] wrote: Sorry, I'm a newbie. I tried the code like this: App Controller function beforeRender() { if($this-Session-check('User')){

Re: How To Create Select Options for Fields Within Same Table

2007-11-30 Thread Dardo Sordi Bogado
There are thre ways: 1. If you are using Model::generateList(), ex: // generateList ($conditions, $order, $limit, $keyPath=, $valuePath) $categories = $this-Category-generateList(null, null, null, null, '{n}.Category.catname'); 2. Also you can just set Model::$displayField

Re: Newbie question: how do i load the javascript helper ?

2007-11-30 Thread Eemerge
Thanks for the answer, one more thing though, should i use it in every controller or just the main app controller? Christopher E. Franklin, Sr. : i will check again, though i checked several times.maybe it slipped :) On Nov 30, 7:02 pm, ldb [EMAIL PROTECTED] wrote: G'day Hopefully I'm not

1.2 Routing question..

2007-11-30 Thread chad
How could I achieve routing like so: /project/{project_name}/{action}/ * without any hacks in the controller? I have it working with some hacks in the controller but would rather make it more dynamic in the future and figured Router might help with that. Thanks

Re: How To Create Select Options for Fields Within Same Table

2007-11-30 Thread Dardo Sordi Bogado
This is for fields from the same table. I don't understand what you mean with the aro aco method. 2007/11/30, Joyce [EMAIL PROTECTED]: Can this solution for fieldname within same table be used with those that are of different tables? Or do I have to use the aro aco method for that? Thanks.

Re: multiple hasMany?

2007-11-30 Thread Luke
alright it appears that the associations are working correctly, but the scaffolding just isn't being generated for notes. oh well I guess On Nov 30, 1:23 pm, Jon Bennett [EMAIL PROTECTED] wrote: On 30/11/2007, Luke [EMAIL PROTECTED] wrote: no that would only allow me to have one note and

Re: How To Create Select Options for Fields Within Same Table

2007-11-30 Thread Joyce
Can this solution for fieldname within same table be used with those that are of different tables? Or do I have to use the aro aco method for that? Thanks. On Dec 1, 4:23 am, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: There are thre ways: 1. If you are using Model::generateList(), ex: //

Re: multiple hasMany?

2007-11-30 Thread Jon Bennett
On 30/11/2007, Luke [EMAIL PROTECTED] wrote: no that would only allow me to have one note and one item per order... I want many items and many notes per order... so I put order_id inside each of those tables. oh yeah, doh! it's even easier then, the issue is most likely cause by cake's

Re: multiple hasMany?

2007-11-30 Thread Dardo Sordi Bogado
I think his tables are ok (he posted them here a couple of messages before). orders: id date customer_name customer_phone customer_etc total order_items: id order_id name description price sku order_notes: order_id note date 2007/11/30, Jon Bennett [EMAIL PROTECTED]: do you mean my

Re: multiple hasMany?

2007-11-30 Thread Luke
no that would only allow me to have one note and one item per order... I want many items and many notes per order... so I put order_id inside each of those tables. On Nov 30, 1:16 pm, Jon Bennett [EMAIL PROTECTED] wrote: do you mean my table names? no I'm assuming your orders table is:

Re: multiple hasMany?

2007-11-30 Thread Jon Bennett
do you mean my table names? no I'm assuming your orders table is: Order - id - order_item_id - order_note_id - created - modified and you have in your order model class Order extends AppModel { var $name = 'Order'; var $hasMany = array( 'OrderNote' = array(

Re: How To Create Select Options for Fields Within Same Table

2007-11-30 Thread Dardo Sordi Bogado
Hi, I don't quite get you. that's probably because my English sucks! (I'm a Spanish speaker) Do you mean something like this if I have a products table with fieldname: id, productname, cat_id, and I would need a select element under the product, where I will be able to select the

Re: Update gone wrong.

2007-11-30 Thread Mech7
I have in webroot index.php define ('CAKE_CORE_INCLUDE_PATH', 'C:' . DS .'wamp'. DS .'www'. DS .'cake_1.2'); When i look at the framework even if cache is not configured it should fall back to th default file caching.. But still i have in core.php Cache::config('default', array('engine' =

Re: Newbie question: how do i load the javascript helper ?

2007-11-30 Thread Eemerge
Ok i added that line in cake/app_controller.php and so far so good. Thanks for the help :) On Nov 30, 11:41 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: My bad, it's at the very end of helpers section which makes no sense to me since it should be at the very top. It is also in

Re: can't upload

2007-11-30 Thread Dardo Sordi Bogado
Since you are using CakePHP 1.2, I suggest you to try the UploadBehaviour. There should be an article in the bakery. 2007/11/30, Dilbert [EMAIL PROTECTED]: On 30 Nov, 18:35, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: Check the encoding on the form, it must be multipart/form-data. ?php

Re: can't upload

2007-11-30 Thread Dilbert
On 30 Nov, 18:35, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: Check the encoding on the form, it must be multipart/form-data. ?php echo $form-create('Model', array('type' = 'file')); ? also check what is in ?php pr($_FILES); ? 2007/11/30, Christopher E. Franklin, Sr. [EMAIL PROTECTED]:

Re: mysql_connect() fails although mySql support is enabled.

2007-11-30 Thread Dardo Sordi Bogado
Maybe it's not loading the mysql extension. Command line php, have a different php.ini from the apache's module. Find it, then look there for mysql.so/mysql.dll You can run in a command line: php -m that will give you the list of extensions loaded by php-cli. 2007/11/29, lynch [EMAIL

Re: Get a hasAndBelongsToMany colection a controller

2007-11-30 Thread Dardo Sordi Bogado
Try this $his-User-recursive = 2; $this-set('data', $this-User-read(null, $id)); In the view: pr($data); // --- data is a bad name :P 2007/11/29, bibi [EMAIL PROTECTED]: I have a model witch use a hasAndBelongsToMany collection class User extends AppModel { var

Re: Default Admin Routing for Forms in 1.2 Pre Beta

2007-11-30 Thread Bruno Bergher
Thanks a lot, people. I'll get to it on Monday and comment on the solution. On Nov 30, 2:34 am, Kalileo [EMAIL PROTECTED] wrote: I have suffered the same problems, but fear not, they are solved: There have been a few bugs which are all been fixed in the meantime. These fixes are already in

Re: Update gone wrong.

2007-11-30 Thread Chris Hartjes
On Nov 30, 2007 9:10 PM, Chris Hartjes [EMAIL PROTECTED] wrote: On Nov 30, 2007 7:33 PM, Mech7 [EMAIL PROTECTED] wrote: It still does not work.. it can't read the cache configuration.. even though all it is supposed to do is throw up an error and revert to default file caching.. Hrm, you

Re: 1.2 Routing question..

2007-11-30 Thread chad
Thanks..getting warmer. however why does it put it as a named param in url? if I do: Router::connectNamed(array('project_name')); Router::connect('/projects/:project_name/:action/*', array('controller' = 'projects'), array('project_name' = '[-_a-zA-Z] +')); in view: echo

Re: $ajax-submit and JavaScript

2007-11-30 Thread peterhf
At the present time, when a button which is an ajax submit is clicked, control is transferred to the JavaScript that checks for correctly populated required fields. If there is a required field that is not correctly populated, an alert box is displayed. When the alert box is closed, the ajax

Re: $ajax-submit and JavaScript

2007-11-30 Thread Christopher E. Franklin, Sr.
Why don't you do the validation on the same page using javascript if you're going that route. Otherwise, you will have to use the model validation and let the controller method complete what it needs to. if($this-Model-create($this-data) $this-Model-validates()) {

Re: Accessing data stored on other server

2007-11-30 Thread Christopher E. Franklin, Sr.
Well, what I am thinking is this: You know how you can display an image on your page from another site? Why not try that? I know it works as long as the folder on the other site is not protected. If it is, and you must get the file through a php page, just put the swf source url as the php page

Re: Best practices for organizing tables?

2007-11-30 Thread Comida411
Hi I've spent a lot of time designing dbs that are cke compliant.. I rather enjoy it.. If you want me to design yours i will.. Tahnk you [EMAIL PROTECTED] On Nov 29, 3:33 pm, BravoFoxtrot [EMAIL PROTECTED] wrote: What are the best practices for organizing tables? My scenario is that I want to

Re: multiple hasMany?

2007-11-30 Thread Jon Bennett
alright it appears that the associations are working correctly, but the scaffolding just isn't being generated for notes. oh well I guess hey Luke, any progress? cheers, jon -- jon bennett w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett

Re: Can I use model class independently?

2007-11-30 Thread Takuo Shiono
It's too tied into the framework itself to be used independently. I suggest using something Propel (http://propel.phpdb.org/trac/) if you want to add ORM to an existing project. Thank you for your advice. I prefer to use cakePHP model as ORM since I am familiar with it. It seems to be

Need help with data relations and controlers

2007-11-30 Thread [EMAIL PROTECTED]
I'm very new to cakephp and I'm trying to figure out how related tables work. Here's my question. Say I have a list of message boards that have users connected to them in the Calendar model with the $hasMany variable. Now, say each calendar has a contact field that holds an email address.

Re: Newby questions part 2: custom query for pagination

2007-11-30 Thread Dardo Sordi Bogado
Implement paginate() and paginateCount() in the model with your custom querys. 2007/11/30, Bram [EMAIL PROTECTED]: Hi all, Here comes part 2 of my newby questions serie. I've a model called Company that has multiple ratings. The rating contains a number from 1 to 5. The rating of the

$ajax-submit and JavaScript

2007-11-30 Thread peterhf
How does one execute a JS script before the html request is made and halt the request based on some condition in the JS? For instance, I wish to check that required fields are correctly populated; if any required field is not correctly populated, I want to show an alert and return to the page

Re: Newbie question: how do i load the javascript helper ?

2007-11-30 Thread Christopher E. Franklin, Sr.
My bad, it's at the very end of helpers section which makes no sense to me since it should be at the very top. It is also in the controllers section: --- $helpers Use this variable to have your controller load helpers into its views. The HTML helper is automatically loaded, but

Re: multiple hasMany?

2007-11-30 Thread Jon Bennett
alright it appears that the associations are working correctly, but the scaffolding just isn't being generated for notes. oh well I guess hmm, doesn't make sense, I don't this is a bug, it's used to often by too many. Please paste the code for your models in the bin:

Re: Change layout for default error messages and static pages (CakePHP 1.2)

2007-11-30 Thread [EMAIL PROTECTED]
Ahh, nice. Thanks. On Nov 30, 12:08 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: You can use your own PagesController, just copy the one that comes with cake (in the cake dir) to app/controllers/, then tune as you wish. 2007/11/30, [EMAIL PROTECTED] [EMAIL PROTECTED]: The pages

Re: multiple hasMany?

2007-11-30 Thread Luke
do you mean my table names? On Nov 30, 1:09 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: Try defining your model classes whitout the 'order_' prefix, and set $useTable = 'order_whatever'; in the model. 2007/11/30, Luke [EMAIL PROTECTED]: umm I might have asked the question wrong.

Re: multiple hasMany?

2007-11-30 Thread Dardo Sordi Bogado
Try defining your model classes whitout the 'order_' prefix, and set $useTable = 'order_whatever'; in the model. 2007/11/30, Luke [EMAIL PROTECTED]: umm I might have asked the question wrong. here is what I am trying to do: I have 3 tables: orders, order_items, and order_notes Orders is

Re: scaffold error

2007-11-30 Thread Luke
it outputs app\controllers\orders_controller.php (line 41) and an empty yellow box. I am on version 1.2.0.5875 pre-beta On Nov 30, 12:27 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: what version? Try debug($this-data) in beforeFilter; 2007/11/30, Luke [EMAIL PROTECTED]: I am not

Re: Multiple DBs association

2007-11-30 Thread Zwift
Problem is that I don't know how to set up DataSource, because I cannot do associacion between two diferent databases using only models, can I? there is no field for database config name in associacion array. I just read some information that datasources can make you do assosciacions between

Re: XHR calls and an Auth problem - [security risk?]

2007-11-30 Thread phpjoy
I checked my application, and I found the origin + fix. In the file routes.php: Router::connect('/pages/*', array('controller' = 'pages', 'action' = 'display')); Router::connect('/sections/', array('controller' = 'sections', 'action' = 'index', 'prefix' =

Re: scaffold error

2007-11-30 Thread Dardo Sordi Bogado
what version? Try debug($this-data) in beforeFilter; 2007/11/30, Luke [EMAIL PROTECTED]: I am not sure what I did, but for some reason the edit action isn't working in any of my controllers. It keeps telling me Invalid id for Order::edit(). Why would it be doing that? Here is an example

How To Create Select Options for Fields Within Same Table

2007-11-30 Thread Joyce
Hi all, I am a newbie in cakePHP, and I have created a table as per below. I have 3 fields for my categories table, and would like to create a Select form element to insert new categories and link within the table itself(where the parent_id comes from the id). Such that it will echo the select

Re: How do I access variables set in App Controller in View?

2007-11-30 Thread skoggins
Just what I was looking for! Thanks! Here's my login fcn so it may help someone down the road: function login() { if(empty($this-data) == false) { if(($user = $this-User-validateLogin($this-data['User'])) == true)

My Models are causing recursive issues

2007-11-30 Thread Chris Thompson
My setup Blogs - hasMany Posts - hasAndBelongsToMany Accounts Post - belongsTo Blog - belongsTo Account -hasMany Note Note - belongsTo Post - belongsTo Account Account - hasMany Post - hasMany Note - hasAndBelongsToMany Blog The issue comes when I am in Posts and I do a recursive = 2, which

Re: Input field read only

2007-11-30 Thread Brian
I understand how to do readonly with straight HTML and this should be a simple and easy thing to do within Cake. Is it not? Brian On Nov 30, 12:48 pm, Brian [EMAIL PROTECTED] wrote: I just noticed that none of the parameters being passed in the array are being used? What would cause that? On

Re: Input field read only

2007-11-30 Thread Chris Hartjes
On Nov 30, 2007 1:29 PM, Brian [EMAIL PROTECTED] wrote: this doesn't work either: ?php echo $html-inputTag('Employee/start_date', array('size' = '4 0', 'disabled' = true)) ? Have you thought about using a hidden field and simply displaying the data? -- Chris Hartjes My motto for 2007:

Re: Input field read only

2007-11-30 Thread Chris Hartjes
On Nov 30, 2007 1:46 PM, Brian [EMAIL PROTECTED] wrote: What I'm trying to do is have an input box with a JS calendar tool that the user can only use the calendar tool to select the properly formatted date. http://www.cs.tut.fi/~jkorpela/forms/readonly.html That might help, and you might be

Re: Input field read only

2007-11-30 Thread Brian
this doesn't work either: ?php echo $html-inputTag('Employee/start_date', array('size' = '4 0', 'disabled' = true)) ? On Nov 30, 11:39 am, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: 'disabled' = true (without the single quotes) On Nov 30, 9:30 am, Brian [EMAIL PROTECTED] wrote:

Change layout for default error messages and static pages (CakePHP 1.2)

2007-11-30 Thread [EMAIL PROTECTED]
As far as I can see, Cake's static 'pages' (in the pages controller) and the default error pages (empty, not_found, permission_denied) must use the 'default.ctp' layout. Note that neither of these use a user defined controller, so there's no where to define '$this-layout'. Is there a way to

scaffold error

2007-11-30 Thread Luke
I am not sure what I did, but for some reason the edit action isn't working in any of my controllers. It keeps telling me Invalid id for Order::edit(). Why would it be doing that? Here is an example controller: ?php class OrderItemsController extends AppController { var $name =

Re: can't upload

2007-11-30 Thread Dardo Sordi Bogado
Check the encoding on the form, it must be multipart/form-data. ?php echo $form-create('Model', array('type' = 'file')); ? also check what is in ?php pr($_FILES); ? 2007/11/30, Christopher E. Franklin, Sr. [EMAIL PROTECTED]: Well, I guess my first question would be, are you using a browse

Re: Input field read only

2007-11-30 Thread Christopher E. Franklin, Sr.
'disabled' = true (without the single quotes) On Nov 30, 9:30 am, Brian [EMAIL PROTECTED] wrote: How do I get an input field to be readonly? I have tried ?php echo $html-inputTag('Employee/start_date', array('size' = '4 0', 'READONLY' = 'readonly')) ? and ?php echo

Re: multiple hasMany?

2007-11-30 Thread Anupom
Join tables should be named after the tables that will join, in alphabetical order, with underscores in between. As an example, a join table between posts and tags tables should be named posts_tags, not tags_posts. The default value of the foreign keys used in the join table must be underscored,

Re: multiple hasMany?

2007-11-30 Thread Jon Bennett
Always best to stick to a A-Z (why can't I think of the correct term for that!) ALPHABETICAL cheers, jon -- jon bennett w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are

Re: multiple hasMany?

2007-11-30 Thread Jon Bennett
Does cake not allow multiple hasMany associations? for some reason it is only rendering scaffolding for the first of the two I'm putting in here: class Order extends AppModel { var $name = 'Order'; var $hasMany = array( 'OrderNote' = array(

Re: can't upload

2007-11-30 Thread Christopher E. Franklin, Sr.
Well, I guess my first question would be, are you using a browse control to browse for the image on your comp or is it already on the hard drive of the server some where? Second, can you post the upload function as well? On Nov 30, 8:34 am, Dilbert [EMAIL PROTECTED] wrote: I have an article

Re: multiple hasMany?

2007-11-30 Thread Luke
does nobody know or is it impossible or what? On Nov 29, 3:39 pm, Luke [EMAIL PROTECTED] wrote: Does cake not allow multiple hasMany associations? for some reason it is only rendering scaffolding for the first of the two I'm putting in here: class Order extends AppModel { var $name =

Re: Newbie question: how do i load the javascript helper ?

2007-11-30 Thread ldb
G'day Hopefully I'm not misunderstanding. In your controller, make sure you have it defined. var $helpers = array('Html', 'Form','Javascript', 'Ajax' ); is the full line I have for context. That will work for just Javascript. If you use any helpers that are not built in, just make sure you put

FormWizard snippet for Cake 1.1

2007-11-30 Thread ldb
G'day Sorry, I'm new to cake and have been scaling hills for the past few weeks. I have read all the entries I can find and am still missing something on how it hooks up and works. I have to use Cake 1.1 for this, no choice I have a project where I use four forms

can't upload

2007-11-30 Thread Dilbert
I have an article model with an image field(I don't want to create another model). This is the code for admin_add function admin_add() { if (!empty($this-data)) { $this-cleanUpFields(); $this-Article-create(); if ($this-Article-save($this-data)) { if

Newby questions part 2: custom query for pagination

2007-11-30 Thread Bram
Hi all, Here comes part 2 of my newby questions serie. I've a model called Company that has multiple ratings. The rating contains a number from 1 to 5. The rating of the company is calculated using an avg() on the rating field of all ratings. In the view of 1 company, I'm doing this with a

Re: Latest additions to 1.2

2007-11-30 Thread Aaron Shafovaloff
Excellent!!! On Nov 17, 9:17 pm, Gwoo [EMAIL PROTECTED] wrote: Several people voiced opinions aboutpluginsand in an effort to make them more flexible we added the functionality to access models acrosspluginsand the main application in the current 1.2 branch. Use the dot notation

Re: How To Create Select Options for Fields Within Same Table

2007-11-30 Thread Dardo Sordi Bogado
I you want to use fields from associated tables, use the key/valuePath options in Model::generateList(), and set recursive to the apropiate value. 2007/11/30, Dardo Sordi Bogado [EMAIL PROTECTED]: This is for fields from the same table. I don't understand what you mean with the aro aco method.

Re: Input field read only

2007-11-30 Thread Dardo Sordi Bogado
It is, just pass array('disabled' = disabled) as the options array. 2007/11/30, Brian [EMAIL PROTECTED]: I understand how to do readonly with straight HTML and this should be a simple and easy thing to do within Cake. Is it not? Brian On Nov 30, 12:48 pm, Brian [EMAIL PROTECTED] wrote: I

Re: Multiple DBs association

2007-11-30 Thread gwoo
there is a lot of information on this google group. You can do associations across multiple datasources. The only thing that is a little tricky is the HABTM since a third table is involved. BUt you can always create a model for that too and specify its db config. That is also discussed in

Re: Search box

2007-11-30 Thread sendami
I'm using cake 1.1. Are there big differences between 1.1 and 1.2? I'm totally a newbee. I just started cake two weeks ago. I recognized that many people are using cake 1.2. I'll try the version and your code. Anyway, thank you very much for your reply. On Nov 29, 7:50 pm, José Pablo Orozco

Re: Newbie question: how do i load the javascript helper ?

2007-11-30 Thread Christopher E. Franklin, Sr.
It is in the helpers section of the manual ;) On Nov 30, 8:31 am, Eemerge [EMAIL PROTECTED] wrote: Sorry to ask such a newbie question, but i didnt find anything about it in the manual. Maybe i missed it, but anyway: how do i load the javascript helper?

Re: Using form helper without model?

2007-11-30 Thread francky06l
What controller is your form calling ? Usually a form is submited, so where do you submit it ?: You can use any name for the 'model' i guess as long as you have controller to handle it .. On Nov 30, 2:14 pm, avairet [EMAIL PROTECTED] wrote: Hi everybody, I'm looking for a trick to use a form

Re: Facing problem on Joining table using HABTM

2007-11-30 Thread [EMAIL PROTECTED]
More details are as below: on the view tr tdfieldset legendTest size/legend ?=$habtm-checkboxMultiple('Service.Size', $sizes_list) ? /fieldset /td /tr tr tdfieldset legendTest types/legend ?= $habtm-checkboxMultiple('Service.Group', $groups_list) ? /fieldset /td /tr tr tdfieldset

Re: bake function, Fatal Error, Call to undefined function mysql_connect()...

2007-11-30 Thread lynch
@ Chris HartjesI reinstalled it and i got a error after the mak install. Installing PHP SAPI module: apache2handler /usr/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/share/apache2/ build/libtool' libphp5.la /usr/lib/apache2 /usr/share/apache2/build/libtool --mode=install cp libphp5.la

Re: Recursivity problems

2007-11-30 Thread AD7six
On Nov 30, 12:27 pm, Skull [EMAIL PROTECTED] wrote: snip Have a look at your model associations, and ensure their aliases are unique. I.e. None of this: var $hasMany = array('NotUnique' = array('className' = 'doesnt matter')); var $belongsTo = array('NotUnique' = array('className' = 'doesnt

Re: email component - smtp auth (SOLVED?)

2007-11-30 Thread Gorka
Changed $this-_newLine from \n to \r\n and mail started to work. The CRLF thing applies to the whole email, and not just the ending CRLF.CRLF... I should have slept a bit more before reading the dmtplf doc! Anyway, if it is mandatory to end lines with CRLF and not just CR, shouldn't _newLine

Re: Habtm recursivity

2007-11-30 Thread DJ Spark
since there is no code to evaluate, i may only guess: maybe, it's about plural form, maybe, it's about the related model StageStage (are you sure about this name ?) maybe, it's about you model associantions. please, show us some of the models, so we can help :) spark On Nov 28, 2007 10:28

Re: email component - smtp auth (SOLVED?)

2007-11-30 Thread Gorka
My fault... I was starting an SMTP connection on localhost, which is of course whitelisted. Solved. Still mail wasn't delivered, so I updated the email component to the latest nightly build and now I'm getting a 451 See http://pobox.com/~djb/docs/smtplf.html; SMTP error. Before the update the

Re: Paginating search results, keeping search criteria, and not messing with the view

2007-11-30 Thread AD7six
On Nov 29, 10:16 pm, loki_mdog [EMAIL PROTECTED] wrote: It's not that I am against it and I will use this line if I have to but it doesn't make sense to me to include it in the view. I am defining everything else about the pagination in the controller (including my filtering logic)...seems

Re: Facing problem on Joining table using HABTM

2007-11-30 Thread AD7six
On Nov 30, 11:39 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hai friends, I am facing a specfic problem on habtm.Incase the version i am using is 1.2 pre_beta.Everything are working fine except the joining table. I am using three set of multiple checkbox.For that i am using three

Re: Habtm recursivity

2007-11-30 Thread AD7six
On Nov 30, 10:52 am, Skull [EMAIL PROTECTED] wrote: Nobody ??? Try showing some code, or otherwise give enough information so that the first thing to do as an answer, isn't a question. AD --~--~-~--~~~---~--~~ You received this message because you are

Re: How do I access variables set in App Controller in View?

2007-11-30 Thread Adam Royle
Instead of retrieving this information from the database on every page load, why don't you store the user array in the session instead of just the id. so in your login function you would set something like this: $user = $this-User-find(whatever logic to find your user); if ($user){

Accessing data stored on other server

2007-11-30 Thread Novice Programmer
Hello guys, actually i have stored some SWFs on one web server...but the index page of the site is not on that server... the php page where these swfs will be embedded is on some other server.. what are the possibilities of using the swfs on other server from this one.. I guess i can't directly

Re: 1.2 Routing question..

2007-11-30 Thread Aaron Shafovaloff
Router::connectNamed(array('project_name')); Router::connect('/project/:project_name/*'); That's a start On Nov 30, 1:27 pm, chad [EMAIL PROTECTED] wrote: How could I achieve routing like so: /project/{project_name}/{action}/ * without any hacks in the controller? I have it working with some

Re: multiple hasMany?

2007-11-30 Thread Jon Bennett
So it isn't a many-to-many association, it's just two one-to-many associates. as I stated in my previous reply, the problem is to do with the order in which your foreign keys are listed in the Orders table, and the fact your associations are mapped in a different order. This is why when you

Re: Change layout for default error messages and static pages (CakePHP 1.2)

2007-11-30 Thread Dardo Sordi Bogado
You can use your own PagesController, just copy the one that comes with cake (in the cake dir) to app/controllers/, then tune as you wish. 2007/11/30, [EMAIL PROTECTED] [EMAIL PROTECTED]: The pages controller subclasses the AppController, so you can override its layout by setting one in the

Re: Input field read only

2007-11-30 Thread Brian
I just noticed that none of the parameters being passed in the array are being used? What would cause that? On Nov 30, 12:44 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On Nov 30, 2007 1:29 PM, Brian [EMAIL PROTECTED] wrote: this doesn't work either: ?php echo

Re: cake + php5 = bad performance?

2007-11-30 Thread Chris Hartjes
On Nov 29, 2007 10:25 AM, powtac [EMAIL PROTECTED] wrote: We did some benchmarks (not with cake) and figured out, that hard objectorientated code in PHP5 is slower than PHP4! Ah yes, the famous 'PHP 5 is slower than PHP 4' argument. Whatever. Chances are the bottleneck in your application

Re: Search box

2007-11-30 Thread José Pablo Orozco Marín
Cool! im a newbee too :) sendami escribió: I'm using cake 1.1. Are there big differences between 1.1 and 1.2? I'm totally a newbee. I just started cake two weeks ago. I recognized that many people are using cake 1.2. I'll try the version and your code. Anyway, thank you very much for your

Re: Cake 1.2 isUnique validation

2007-11-30 Thread Ivolution
@MrTufty: The code I posted above should work with both operations (updating and inserting). That's why the code checks if the id is set in the model (hence it's working with an existing row then, and checks all other rows for duplicates of the to-update value). On Nov 30, 2:49 pm, MrTufty

Re: Best practices for organizing tables?

2007-11-30 Thread BravoFoxtrot
I think I'll use prefixes. I forgot about the $useTable variable. I remember reading about it now that you mention it. thanks for the reply. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post

Re: Cake 1.2 isUnique validation

2007-11-30 Thread MrTufty
Good solutions Richard, nice one. You may want to look into specifying the 'on' part of the validation rule, which allows you to set whether the validation is done on creating a new record, or updating an existing one. I'm not sure how, if at all, that would tie into the code you've provided

Using form helper without model?

2007-11-30 Thread avairet
Hi everybody, I'm looking for a trick to use a form without a model. My form doesn't save POST'ed variables in a table, it just save them in session to simply display on another page. But when I make $form-create(null);, all field's names contain the name of the current model, like

Multiple DBs association

2007-11-30 Thread Zwift
Hello I'm new here, but I was developing with cake for a while now. Now I'm doing bigger project, and I need to work with 2 DBs - one of them is static I cannot mess with its structure... So is it possible to create associations between two different databases? I'm searching for some tutorial

Re: Habtm recursivity

2007-11-30 Thread AD7six
On Nov 30, 12:31 pm, Skull [EMAIL PROTECTED] wrote: alot Holy copy and paste batman! Who the stage named your staging tables? If you delete all those default array keys, it's a lot easier to read. plus you won't be posting war and staging peace to the google group with each of your questions.

Ajax validation vs Javascript validation?

2007-11-30 Thread Action
Quick question: I need to validate a form but I don't need to compare any of the fields to the database. Is it better to use ajax validation with the model or javascript validation? and why? --~--~-~--~~~---~--~~ You received this message because you are

XHR calls and an Auth problem - [security risk?]

2007-11-30 Thread phpjoy
I'm experiencing a VERY weird auth problem, which is a very big security risk for my application. When I try to access a page in the admin section directly, I'm being redirected to the login page. When I try to do the same via an XHR call, the page is loaded! Example: When I try to access the

Facing problem on Joining table using HABTM

2007-11-30 Thread [EMAIL PROTECTED]
Hai friends, I am facing a specfic problem on habtm.Incase the version i am using is 1.2 pre_beta.Everything are working fine except the joining table. I am using three set of multiple checkbox.For that i am using three table.Right now whats happening is first two tables are working fine that

Re: Recursivity problems

2007-11-30 Thread Skull
Nobody ? On 28 nov, 14:23, Skull [EMAIL PROTECTED] wrote: Hello, I use Cake 1.2 I'm working with several models that seem to be correctly associated. On their own view pages, all works fine, the related elements are there, as long as I don't use recursivity. I'm trying to get some data

Re: Cake 1.2 isUnique validation

2007-11-30 Thread RichardAtHome
If anyone else is looking for some drop in code to handle unique validation, here's what I came up with. This is a generic function you can drop into your app_model: /** * checks is the field value is unqiue in the table * note: we are overriding the default cakephp

Re: Paginating search results, keeping search criteria, and not messing with the view

2007-11-30 Thread Rob
On Nov 29, 6:52 pm, loki_mdog [EMAIL PROTECTED] wrote: Hey Folks, I have got paginating search results working...PERFECTLY!!! Took me long enough...anyway, I would like the have the pagination remember the filter terms (as it currently does) without having to make any modifications to the

Re: Save doesn't work with Postgres

2007-11-30 Thread Rhee
No one has ever this problem? On Nov 29, 12:17 pm, Rhee [EMAIL PROTECTED] wrote: Does anybody have problem to use Save function with Postgres? Everytime I call $this-Model-save($this-data) I get the following notice messages (repeated 4 times): Notice: Undefined index: name in

  1   2   >