Re: problem with related models and recursion

2008-04-24 Thread senser
any suggestions ??? On Apr 22, 2:05 pm, senser [EMAIL PROTECTED] wrote: I don't think problem is withmodels, because if I comment the variable $hasMany=UnitI18n in Unit model (i.e. Unit and UnitI18n are NOTrelated) and Cake doesn't run queries on unit_18ns table but only on unts. Adding

Re: Forms that add/edit Multiple Models part II

2008-04-24 Thread Dr. Tarique Sani
On Thu, Apr 24, 2008 at 2:05 AM, Jee [EMAIL PROTECTED] wrote: Can anyone give me any suggestions for adding and editing multiple models from one form in Cake 1.2? A call to saveAll should suffice but it would also help if you showed some code that you are using Tarique --

Re: cake 1.2 r6709 - scaffolding and german umlauts

2008-04-24 Thread Siegfried Hirsch
2008/4/23 MonkeyGirl [EMAIL PROTECTED]: Technically, it doesn't matter which character set you use as far as storing data into a database goes. Whatever you put in, you get the same stuff out. I would recommend using CHARSET=utf8 COLLATE=utf8_unicode_ci however, because this makes the

Creating forms

2008-04-24 Thread rtanz
Hi I am designing a survey application that should enable users to create questionnaires for people. The questionnaire designer would like to have the option to write the question down and then choose whether to have a checkbox, textbox, radio buttons etc for the response. I have created the

Re: Format date field in 3 select

2008-04-24 Thread avairet
Hi James, Maybe my English is poor... I know the FormHelper::datetime do that. But in my case I need to specify a special DOM Id for each select to add a datepicker and the FormHelper::datetime doesn't allow this possibility. So my question was about a Cake's method to deconstruct my date field

Re: Creating forms

2008-04-24 Thread Fran Iglesias
El 24/04/2008, a las 10:05, rtanz escribió: my problem is how to have cake then create the forms themselves based on the designer's selection. any hints? thanks You could create fields in the Question model to store the type and options for response. Then, in the view, a switch structure

Re: Creating forms

2008-04-24 Thread rtanz
right i think i get it thanks alot, ill try it out and see how it goes On Apr 24, 10:20 am, Fran Iglesias [EMAIL PROTECTED] wrote: El 24/04/2008, a las 10:05, rtanz escribió: my problem is how to have cake then create the forms themselves based on the designer's selection. any hints?

Re: Ajax::observeField

2008-04-24 Thread Davide
Chris Hartjes wrote: D'oh -- that stuff I posted is Cake 1.2 specific. I don't use Cake 1.1 at all, so can't help you there. Ok Chris but you gave me a hint. So searching in the core code (session.php) I saw three points where Session.checkAgent is present. The only way I found (puttin some

Re: Undefined variable: html

2008-04-24 Thread Davide
williamn wrote: Notice: Undefined variable: html in D:\xampp\htdocs\sirusananda\app \views\layouts\default.thtml on line 17 Fatal error: Call to a member function css() on a non-object in D: \xampp\htdocs\sirusananda\app\views\layouts\default.thtml on line 17 But when I switch back, those

Re: Undefined variable: html

2008-04-24 Thread williamn
Strange, generally this error appear when the HtmlHelper is not defined in the helpers array of the controller. Is it defined? var helpers = array(html,...); I add var $helpers = array('Cache', 'Html'); in app_controller.php and those error message are disapear..but still I don't

Undefined variable: html

2008-04-24 Thread williamn
My application running fine so far, but when I change the database connection (development database to production database) I got this error : Notice: Undefined variable: html in D:\xampp\htdocs\sirusananda\app \views\layouts\default.thtml on line 17 Fatal error: Call to a member function css()

Re: Problem with widget in opera.

2008-04-24 Thread lekshmi
There is no error while looking in javascript console... please help me to solve the problemits very urgent please:-(:-(:-( Gonzalo Servat wrote: On Sun, Apr 20, 2008 at 2:46 PM, lekshmi [EMAIL PROTECTED] wrote: lekshmi wrote: Hi, I am using cake php helper

Session

2008-04-24 Thread KND
Now i am set the session $this-Session-write('Signup', $signup); Can u help how to retrive this session value please --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this

Re: Email Component uses SMTP not sending...

2008-04-24 Thread JaMoyFriends
hmmmmine uses, a template tooo...i think b logica has the closest answer...im still not sure On Apr 23, 3:05 am, aranworld [EMAIL PROTECTED] wrote: Are you using the latest nightly build? There is a bug in the beta release from January that prevents the Mail component from sending a mail

Re: How to use not in in new find() ?

2008-04-24 Thread rob30
ups sorry it works as expected, thanks ! --~--~-~--~~~---~--~~ 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 group, send email to

difference between saving in add and edit

2008-04-24 Thread rtanz
Hi why is it that in the add function you use $this-data when saving and in the edit function you use $this-data['Post']? function add() { if (!empty($this-data)) { if ($this-Post-save($this-data)) { $this-flash('Your post

Re: Router::queryString issue in 1.2 beta

2008-04-24 Thread grigri
1) http_build_query is a PHP5-only function It's implemented for PHP4 in basics.php, along with array_intersect_key, array_diff_key, file_put_contents and array_combine. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Multiple foreign keys to the same table.

2008-04-24 Thread Dovdimus Prime
Hi all I'm beginning with CakePHP. I understand that in defining a model, you can specify a foreign key relationship (in this case to a parent table) by setting the $belongsTo variable. The obvious question is: how do you specify two parent tables? What if an Employee model has a Site parent

Re: Format date field in 3 select

2008-04-24 Thread da_student
hey, you can split the string example ($datevar is the value in your database date field): $splitted = explode('-',$datevar); $year = $splitted[0]; $month = $splitted[1]; $day = $splitted[2]; is that what you mean? --~--~-~--~~~---~--~~ You received this

Re: Session

2008-04-24 Thread da_student
$this-Session-read('Signup'); in controller $session-read('Signup'); in view --~--~-~--~~~---~--~~ 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

Re: Multiple foreign keys to the same table.

2008-04-24 Thread majna
var $belongsTo = array( 'Category' = array('className' = 'Category', 'conditions' = '', 'order' = '', 'foreignKey' = '',

Can I use AuthComponent without ACL and existing User Table

2008-04-24 Thread bingo
Hi all, I have been using OthAuth component for long for user authentication purpose. But now I am planning to switch to using AuthComponent mainly because it is part of core CakePHP library. I wanted to know, 1. can I use my existing user table with AuthComponent 2. Do I need to use ACL

Re: difference between saving in add and edit

2008-04-24 Thread majna
You can use $this-data['Post'] in add too. But if $this-data contains associated model for example ['Category'] array, Only Post data will be saved. You should use $whitelist param in save() too. Check API. model-save On Apr 24, 12:53 pm, rtanz [EMAIL PROTECTED] wrote: Hi why is it that in

Re: Can I use AuthComponent without ACL and existing User Table

2008-04-24 Thread djiize
hi 1. you can use existaing tables, see userModel and fields Auth variables 2. ACL not needed if you just do authentication. If you need authorization too, you can use ACL or whatever else 3. Auth is a somewhat wrapper for authentication and authorization. The last part can be done by ACL. But

Re: Multiple foreign keys to the same table.

2008-04-24 Thread Dovdimus Prime
Hmmm. I should point out, as indicated in the thread title, that both foreign keys actually point to the same table. I don't know if this makes a difference. Here's the logic: The model is an answer which is selected for a question as part of a questioning process. Each answer has a preceding

How to display records from a table in php cake

2008-04-24 Thread rocky verma
How to display records from a table in php cake Help me to figure out this problem Thanks Rocky --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to

Re: difference between saving in add and edit

2008-04-24 Thread James K
You don't For both saving or editing, you should follow this order of operations: $this-Model-create($this-data['Model']); $this-Model-save(); The create function will look for an id passed in the $this-data for the model. If it sees one, it understands the save should perform an update, if

Uses PHPUnit instead of SimpleTest

2008-04-24 Thread Renan Gonçalves
Hi! I have been created a ticket (https://trac.cakephp.org/ticket/4531) proposing a change of CakePHP Test Suite. I'm sure PHPUnit is better than SimpleTest! Comments be welcome. Thanks! -- Renan Gonçalves - Software Engineer Cell Phone: +55 11 8633 6018 MSN: [EMAIL PROTECTED] São Paulo -

Re: How to display records from a table in php cake

2008-04-24 Thread the_woodsman
Ha! This is a very broad question. How far are you in your understanding of Cake? Have you made a model for your table? Are you accessing it in a controller? If you don't know the answers to these questions, you should probably read up more, and all should become clear. The short answer is to

Re: Changing username of Authenticated user

2008-04-24 Thread Zoltan
Yes, That's what I'm doing: 1) save data to database, 2) (the problem) how to refresh the session from the database without them having to logout / log back in. Zoltan On Apr 23, 4:12 pm, Marcin Domanski [EMAIL PROTECTED] wrote: Hey, Shouldn't you change it in db and update the auth data

$id=null vs $id

2008-04-24 Thread rtanz
hi i am reading the manual and have some doubts regarding the use of $id, for example sometimes in an edit function you have function edit($id=null) while in a delete function you get function delete($id). Where do I use null and where not? thanks

Re: Multiple foreign keys to the same table.

2008-04-24 Thread grigri
class Answer extends AppModel { var $belongsTo = array( 'PrevQuestion' = array('className' = 'Question'), 'NextQuestion' = array('className' = 'Question'), ); } This will imply the foreign keys being 'prev_question_id' and 'next_question_id'; you can set the foreignKey entry in the

Re: $id=null vs $id

2008-04-24 Thread Dr. Tarique Sani
Not related to CakePHP See http://php.net/manual/en/functions.arguments.php#functions.arguments.default T On Thu, Apr 24, 2008 at 7:19 PM, rtanz [EMAIL PROTECTED] wrote: hi i am reading the manual and have some doubts regarding the use of $id, for example sometimes in an edit function you

Re: How to display records from a table in php cake

2008-04-24 Thread Sliv
If there ever was a RTFM post of all time, this was it. http://manual.cakephp.org --~--~-~--~~~---~--~~ 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

Re: difference between saving in add and edit

2008-04-24 Thread grigri
The create function will look for an id passed in the $this-data for the model. If it sees one, it understands the save should perform an update, if there is no id, it understands the save as an insert. That should be 'if it sees one, and a record with that PK exists, it understands the save

Slow...

2008-04-24 Thread Pierre MARCOURT
Hi, I am programming using CakePHP / Ajax and the more I program, the more my website is slow. I don't understand why, because I am programming the way you have to when you use CakePHP. And I don't think that I am doing to much queries. Is there some important things I have to avoid when I

Re: Can I use AuthComponent without ACL and existing User Table

2008-04-24 Thread bingo
Great... Thanks djiize. I don't need group part yet. So it seems to be fairly simple to use Auth Component Regards, On Apr 24, 8:11 am, djiize [EMAIL PROTECTED] wrote: hi 1. you can use existaing tables, see userModel and fields Auth variables 2. ACL not needed if you just do

Re: Slow...

2008-04-24 Thread Chris Hartjes
On Thu, Apr 24, 2008 at 8:33 AM, Pierre MARCOURT [EMAIL PROTECTED] wrote: I am using a lot Ajax and Scritptaculous, is that a problem ? Almost my entire site is in Ajax. Yes, that is bound to be slow without a lot of thought on the use of unobtrusive javascript. In my app_controller.php, I

Re: Changing username of Authenticated user

2008-04-24 Thread aranworld
What about this? 1) after saving new database info, write new username / password to a cookie 2) destroy current session data 3) autologin using the information from the cookie This page should help a bit:

Re: Uses PHPUnit instead of SimpleTest

2008-04-24 Thread Chris Hartjes
On Thu, Apr 24, 2008 at 9:08 AM, Renan Gonçalves [EMAIL PROTECTED] wrote: Hi! I have been created a ticket (https://trac.cakephp.org/ticket/4531) proposing a change of CakePHP Test Suite. I'm sure PHPUnit is better than SimpleTest! Are you going to spearhead the effort to rewrite all the

extra number character in Flash message

2008-04-24 Thread Zoltan
I'm doing this bit that resets the user's password that set-up a flash message using: $this-Session-setFlash('Your new password has been e-mailed to you.'); $this-redirect('/users/login/'); exit(0); This displays on the next screen as Your new password has been e- mailed to you.1 I'm not sure

Re: extra number character in Flash message

2008-04-24 Thread Samuel DeVore
I bet in your view you are doing and echo of the -flash call, the flash call in the view automatically echos, and returns true, so you are echoing 'true' which is a one. Sam D On Thu, Apr 24, 2008 at 7:09 AM, Zoltan [EMAIL PROTECTED] wrote: I'm doing this bit that resets the user's password

Re: extra number character in Flash message

2008-04-24 Thread grigri
You're using echo to display the session flash. Remove the echo call and you'll be fine. (btw, this is listed on the FAQ page) On Apr 24, 3:09 pm, Zoltan [EMAIL PROTECTED] wrote: I'm doing this bit that resets the user's password that set-up a flash message using:

Re: Changing username of Authenticated user

2008-04-24 Thread Chris Hartjes
On Thu, Apr 24, 2008 at 10:07 AM, aranworld [EMAIL PROTECTED] wrote: What about this? 1) after saving new database info, write new username / password to a cookie 2) destroy current session data 3) autologin using the information from the cookie This page should help a bit:

Routing to RSS feed

2008-04-24 Thread seb
Hi all bakers I succeded in generating RSS feeds following the marvelous tutorial from Jiri Johannes Kupiainen found on webarchives. I'm still stuck with one thing, though. I want to route mydomain.com/app/rss to mydomain/app/index.php/main/index.rss I'm trying this :

Re: Slow...

2008-04-24 Thread Pierre MARCOURT
I am doing some queries in /beforeRender()/ because I have to set variables in the layout. When users Log In in my system, they can change the order of the elements (little calendar, etc.) of the layout. And then I save this order in the database. So I am using the /beforeRender()/ function to

Re: Uses PHPUnit instead of SimpleTest

2008-04-24 Thread Guillaume
If I remember well, PHPunit for PHP 4 is an old version not maintened anymore. For the moment, CakePHP is compatible with both PHP 4 and PHP 5... So for now I guess SimpleTest is the way to go. On 24 avr, 15:08, Renan Gonçalves [EMAIL PROTECTED] wrote: Hi! I have been created a ticket

Re: Slow...

2008-04-24 Thread Chris Hartjes
On Thu, Apr 24, 2008 at 10:22 AM, Pierre MARCOURT [EMAIL PROTECTED] wrote: I am doing some queries in beforeRender() because I have to set variables in the layout. When users Log In in my system, they can change the order of the elements (little calendar, etc.) of the layout. And then I

Re: extra number character in Flash message

2008-04-24 Thread Zoltan
That was exactly it - thanks! Zoltan On Apr 24, 10:15 am, grigri [EMAIL PROTECTED] wrote: You're using echo to display the session flash. Remove the echo call and you'll be fine. (btw, this is listed on the FAQ page) On Apr 24, 3:09 pm, Zoltan [EMAIL PROTECTED] wrote: I'm doing this

Re: Multiple foreign keys to the same table.

2008-04-24 Thread Dovdimus Prime
Of course, it's simple. Thank you. On Apr 24, 12:27 pm, Dovdimus Prime [EMAIL PROTECTED] wrote: Hmmm. I should point out, as indicated in the thread title, that both foreign keys actually point to the same table. I don't know if this makes a difference. Here's the logic: The model is an

Re: How to display records from a table in php cake

2008-04-24 Thread pappu
Try this Jai Maharashtra ?php foreach ($posts as $post): ? tr td ?php echo $post['Post']['id']; ?/td td ?php echo $html-link($post['Post']['title'],'/posts/view/'. $post['Post']['id']);? /td td

Re: reset Session variables without any visible cause

2008-04-24 Thread Thomas Jones
Same problem here. I set a variable in a component, can access it in a view but after sending the form the variables seem to be empty. strange... On Mar 30, 11:03 pm, Mauricio Morales [EMAIL PROTECTED] wrote: I have the same strange problem... I'm working with CakePHP 1.2B and sessions saved

Re: Can I use AuthComponent without ACL and existing User Table

2008-04-24 Thread aranworld
I made a number of tutorials focused on ACL. This one should help you understand the relationship between the AuthComponent and the AclComponent: http://aranworld.com/article/164/cakephp-acl-tutorial-auth-component-example On Apr 24, 7:03 am, bingo [EMAIL PROTECTED] wrote: Great... Thanks

Re: Combine and compress js / css..

2008-04-24 Thread Mech7
Hey this seems quite cool.. did the packer work for you with cake from svn ? @MattC Yeah its not really a big issue.. and its easy to fix :D would be nice though for a next version to have it by default ;) On Apr 23, 9:25 pm, Sam Sherlock [EMAIL PROTECTED] wrote: Also there is this built on

Re: Uses PHPUnit instead of SimpleTest

2008-04-24 Thread the_woodsman
To my (limited) understanding, SimpleTest also has much better support for mock objects. I'm sure PHPUnit is better than SimpleTest! I'd be interested to hear why... On Apr 24, 3:27 pm, Guillaume [EMAIL PROTECTED] wrote: If I remember well, PHPunit for PHP 4 is an old version not maintened

Form data not available in controller

2008-04-24 Thread zendrumz
Hey everyone, I'm a cakephp newbie putting together my first project. I'm trying to save form data to my database through a form generated by the formHelper in a view element. The problem I'm having is that $this- data is apparently empty when I try to access it from my controller. I've checked

Re: Slow...

2008-04-24 Thread hydra12
Are you using firebug in firefox? I've noticed that sites with lots of javascript run VERY slow under firebug. Try testing in another browser or turning firebug off and see if that helps. On Apr 24, 9:32 am, Pierre MARCOURT [EMAIL PROTECTED] wrote: Thanks for the advice Chris, I am going to

Re: Displaying in Input Field Value of Parent Element

2008-04-24 Thread seb
In my bill add view i've currently this entry: echo $form-input('member_id'); The result is a dropdownlist with all the ID's available in the Members table. But here i don't want to see the ID, i want to see the lastname from the lastname column. In your controller, setup the $names

Re: Form data not available in controller

2008-04-24 Thread seb
When I submit the form, the controller branches to display the error message in my view, along with the following: 1 query took 2 ms NrQuery Error AffectedNum. rows Took (ms) 1 DESCRIBE `contacts` 6 6 2 Well, *which* error message ? It

Re: php4 auto-validation

2008-04-24 Thread el_baker
I have a similiar issue, but I use php5 and my model has only a hasOne association. The problem in detail: I have a registration form with three input fields (username, password, email). When I click the submit button, apache crashes. The crash message says the module php5ts.dll crashed. I use

Re: Does CakePHP's ACL have anything like Zend_Acl's Assert functionality?

2008-04-24 Thread mcjustin
Thank you James; but I don't think that addresses the notion of adding flexibility to rules so they are not absolute, but dependent upon various criteria. For example, allow an ARO to access an ACO only during a particular time window. Zend_Acl allows an assertion construct to be passed to rule

Plugins and Auth component

2008-04-24 Thread alxlevin
Hi. I'm trying to write a profiling plugin named Profile in 1.2.0.6311 Beta. I can access the views in my plugin (profile/ profile_mains/login) but as soon as I add the Auth component in the profile_app_controller.php file, I get redirected to profile/users/ login and receive a Missing

Re: Slow...

2008-04-24 Thread Pierre MARCOURT
yes, I am using Firebug in Firefox. I tried with Firebug turning off but it is the same. However, if I test it in IE 7 or Safari 3.1, it is a lot better ! But most of the users of my system will use FireFox... hydra12 a écrit : Are you using firebug in firefox? I've noticed that sites with

Re: Does CakePHP's ACL have anything like Zend_Acl's Assert functionality?

2008-04-24 Thread aranworld
Here is one way you could do a time limited ACO. Let's say you wanted to limit update access to a comment: 1) when comment is created, create an ACO that is bound to that comment 2) grant the user permission to update that particular comment 3) in the controller, before presenting the edit

MySQL Views support in Cake 1.2

2008-04-24 Thread Sebastian Veggiani
Hi, somebody could clarify what is the level of support of Cake 1.2 for woriking with MySQL Views? For example, I've a chain o associations of three or more levels. If I want to filter the results by a field in the 3rd level or beyond there is no easy way to do it, unless I use a Custom SQL

Re: Forms that add/edit Multiple Models part II

2008-04-24 Thread Jee
Sorry about that. I am never sure how much to include! Following is the action the form posts to. I have validation rules in both the Agency model and the Member model. But the validation errors from the member model don't show up on a failure. Only the agency errors show and not all of those.

Controller variables VS. Configure::write()

2008-04-24 Thread aranworld
So, let's say I want to set a flag that determines whether or not a login link should be displayed if a visitor to my site is not logged in. Which is the more cake friendly way to do this? // put this in my AppController var $displayLoginLink = TRUE; OR // put this in my bootstrap.php

Re: $id=null vs $id

2008-04-24 Thread Andrew Assarattanakul
This is more about the way PHP functions are used. Using: function edit($id=null) {} function delete($id) {} Will set a default parameter so that you can call edit(); you will not get an error. Now if you tried delete(); you will get an error because the required parameter was not fulfilled.

Re: Routing to RSS feed

2008-04-24 Thread Anupom
Hi Did you try this tutorial http://anupom.wordpress.com/2008/03/12/rss-in-cakephp-12/ ? On Thu, Apr 24, 2008 at 8:21 PM, seb [EMAIL PROTECTED] wrote: Hi all bakers I succeded in generating RSS feeds following the marvelous tutorial from Jiri Johannes Kupiainen found on webarchives. I'm

Re: Routing to RSS feed

2008-04-24 Thread MarcS
try Router::connect('/rss',array('controller'='main','action'='index', 'ext' = 'rss)); I guess this ought to work On Apr 24, 3:21 pm, seb [EMAIL PROTECTED] wrote: Hi all bakers I succeded in generating RSS feeds following the marvelous tutorial from Jiri Johannes Kupiainen found on

Re: Changing username of Authenticated user

2008-04-24 Thread Marcin Domanski
ok - my advice would be to create a function in app_controller that would: a) get the model ($model = $this-Auth-getModel()) b) query it for new data for the specific id c) write the data to session $this-Session-write('Auth', $data); On Thu, Apr 24, 2008 at 4:20 PM, Chris Hartjes [EMAIL

Re: Routing to RSS feed

2008-04-24 Thread seb
MarcS wrote: try Router::connect('/rss',array('controller'='main','action'='index', 'ext' = 'rss)); I guess this ought to work This does not work. Gives me 404 :( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Routing to RSS feed

2008-04-24 Thread MarcS
from looking at the API it seems like you can't use ext in router::connect my only idea would be creating an rss controller and then redirect to main/index.rss obviously that is not really pretty I would be curious to see if someone has a better solution On Apr 24, 7:49 pm, seb [EMAIL

Error Cakephp (Failed opening required 'config\core.php' )

2008-04-24 Thread Quitos
Hi everyone, again requesting your help in CakePHP topic in its version 1.5, you will see, I'm changing a site and configured in cake and I'm moving to another server but I have problems with the current configuration my folders are as follows: Cake Librery: C:/cake Php Librery:

strange behavior behavior

2008-04-24 Thread [EMAIL PROTECTED]
Ok, here's the scenario: I've got a Product model and a ProductType model. Additionally I have an autoIncrement behavior created (the database I'm working on has many tables w/out auto-incrementing primary keys, and I can't change the structure). I have a function in my ProductType model called

Are sessions and cookies needed for public pages without user data?

2008-04-24 Thread lance
What is the advantage of saving a cookie and session information for a public CakePHP app (just the public-facing views, not admin views). Why should I save this information if there is no user data or preferences to keep track of? I know for the admin views it's important to keep user info for

Re: strange behavior behavior

2008-04-24 Thread [EMAIL PROTECTED]
I just checked and if I debug out $this-Product-ProductType from ProductsController, the settings for ProductType are correctly in the model. ProductType Object ( [name] = ProductType [useTable] = NPPProductType [primaryKey] = productTypeID [displayField] = productTypeName

Test Suite 1.2: Importing joining table problem on HABTM fixture.

2008-04-24 Thread Defranco
Hi, I'm trying to import a Joining table on a fixture: var $import = array('model' = 'Model1Model2', 'records' = true); But when importing the table to test_suite database it is creating a table with just 1 primary key instead of 2 primary keys as original table has (model1_id or model2_id

First Doubt with CakePHP

2008-04-24 Thread Nicolás Andrade
Hello everybody; this is my first message in this group as I've started developing with CakePHP last monday. I saw lot of manuals, HowTos, guides and forums; but I have not found a place where solve this doubt. You know ussually Web Sites have a structure which seems like that: -Root *index.php

Re: Does CakePHP's ACL have anything like Zend_Acl's Assert functionality?

2008-04-24 Thread James K
The simple way would be to just handle those extra business rules separately. If the check passes AND your extra business rules are fulfilled, then...? As far as I know, there's no way to add an additional condition to the check. In these cases, it's best to keep things simple - especially since

embed gallery2

2008-04-24 Thread Zick
Hi, I'm trying to embed gallery2 with my cakephp web site. Has anyone tried this before? I just want to get some idea of how to get start. thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP

Re: First Doubt with CakePHP

2008-04-24 Thread Chris Hartjes
On Thu, Apr 24, 2008 at 4:15 PM, Nicolás Andrade [EMAIL PROTECTED] wrote: I mean I can separate tasks using a SiteAdmin folder, password protected. But in CakePHP, I don't know how to separate things. Any user which registers himself will use the User model; and me as administrator will use

Re: First Doubt with CakePHP

2008-04-24 Thread John David Anderson
On Apr 24, 2008, at 2:47 PM, Chris Hartjes wrote: On Thu, Apr 24, 2008 at 4:15 PM, Nicolás Andrade [EMAIL PROTECTED] wrote: I mean I can separate tasks using a SiteAdmin folder, password protected. But in CakePHP, I don't know how to separate things. Any user which registers himself

Re: Elementary Data Validation??

2008-04-24 Thread Jee
Why won't the validation messages for 'state' and 'agreed_to_terms' show up on the form below when an error is made? The validations and the action are below the form code. I could have written this stupid thing ten times over in the time I have been fighting with cakephp over this. Thanks for

Re: Error Cakephp (Failed opening required 'config\core.php' )

2008-04-24 Thread Sam Sherlock
I have the following in virtual hosts VirtualHost *:80 ServerAlias cake2.localhost DocumentRoot D:/Apache2.2.4/vhosts/cake2/html ServerAdmin [EMAIL PROTECTED] DirectoryIndex index.php index.html ErrorLog logs/error.log CustomLog logs/access.log combined directory

Re: Error Cakephp (Failed opening required 'config\core.php' )

2008-04-24 Thread John David Anderson
Run in debug mode so that the cached class paths will be overwritten. I've run into something like this in the past and running in debug mode (or deleting cache files) has helped. -- John On Apr 24, 2008, at 12:42 PM, Quitos wrote: Hi everyone, again requesting your help in CakePHP topic

Adding new records into two models with one form (or: trying to validate without saving)

2008-04-24 Thread MonkeyGirl
Hi. I'm about to try and write a bit of code that, based on data from one form, will insert some of the form's data into a record in one model, and the rest into a related record in another model. Before you point me at these threads:

Re: Are sessions and cookies needed for public pages without user data?

2008-04-24 Thread Sam Sherlock
I'm looking for a way to set the cookie and session for admin routes only 1. // called before every single action 2. function beforeFilter() { 3. // if admin pages are being requested 4. if(isset($this-params['admin'])) { 5. // check the admin is logged in

Re: Form data not available in controller

2008-04-24 Thread zendrumz
On Apr 24, 12:36 pm, seb [EMAIL PROTECTED] wrote: When I submit the form, the controller branches to display the error message in my view, along with the following: 1 query took 2 ms Nr Query Error AffectedNum. rows Took (ms) 1 DESCRIBE `contacts` 6

Re: Question about Model::save() and its beforeSave and afterSave callbacks

2008-04-24 Thread Joshua McFarren
Thank you all for your help, There were many good suggestions, some of which helped optimize my code. However the bug boiled down to something stupid (of course). I created my the association for my ProjectTask model wrong in my Schedule model. It should *not* have been pluralized. Not sure why

Re: Adding new records into two models with one form (or: trying to validate without saving)

2008-04-24 Thread Langdon Stevenson
Hi Zoe There are a number of ways to solve this problem. The neatest would be to manually execute the validation prior to saving any of the data. Have a look at the validation section of the Cake Manual. BTW - I only use Cake 1.1.X, so don't know if this has changed at all for 1.2 In

save() keeps creating new records, not updating old ones

2008-04-24 Thread Chez17
I am creating a basic facebook type site for my first cake project, just to learn it. I am having issues getting the save funciton to work with my model relationships. Its very simple right now, the modle Profile hasOne Info. The Info model belongsTo Profile and stores all the contact

Re: Are sessions and cookies needed for public pages without user data?

2008-04-24 Thread lance_mountain
I'm looking for a way to set the cookie and session for admin routes only http://www.jamesfairhurst.co.uk/posts/view/creating_an_admin_section_... Thanks Sam, that article does shed light on how to create and delete sessions manually. I was hoping to use CakePHP's built-in session handling

Re: Are sessions and cookies needed for public pages without user data?

2008-04-24 Thread Sam Sherlock
if(isset($this-params[Configure::read('Routing.admin')])) { die('admin route'); } what I was getting at was line 4 of the snippet - the link is where I found it - the above reads the admin route from config settings. so you can set the session and all you

Re: save() keeps creating new records, not updating old ones

2008-04-24 Thread b logica
Why not just store the Info data in Profile and save yourself the hassle? On Thu, Apr 24, 2008 at 6:57 PM, Chez17 [EMAIL PROTECTED] wrote: I am creating a basic facebook type site for my first cake project, just to learn it. I am having issues getting the save funciton to work with my

Re: save() keeps creating new records, not updating old ones

2008-04-24 Thread Nicolás Andrade
Hi I'd the same problem in my first Update view. It forgets the ID so when Save() checks if it must be Inserted or Updated; it Inserts it. Sometimes it happened when I was trying to edit something and the information was not validated; so the same display is shown; but with Id forgotten. I've

Re: Error Cakephp (Failed opening required 'config\core.php' )

2008-04-24 Thread Quitos
I take yours sugestions but it don't work. I install the Virtualhost like this: it can run in debug mode, because the error is after the Cake libs begins. And I delete the cache and tmp files and it don't works... Another idea??? --~--~-~--~~~---~--~~ You

Re: Displaying in Input Field Value of Parent Element

2008-04-24 Thread b logica
In the Members table i've two columns lastname and firstname. But in the most cases i want to display the two names concatenated ($lastname . ' ' . $firstname) for this i want to store the concatenated string in a pseudo column completename (to acess it with

Re: Controller variables VS. Configure::write()

2008-04-24 Thread b logica
I have my login in one place only, so this may not be useful to you. But I just check the session for a user in my nav element. If so, the logout link and other stuff is displayed; if not, the login link. On Thu, Apr 24, 2008 at 1:51 PM, aranworld [EMAIL PROTECTED] wrote: So, let's say I want

View this page CakePHP Unofficial Resources

2008-04-24 Thread Sliv
-Added link to htp://www.cakephpforum.net -Merged Blogosphere page -Merged Groups In Other Languages page Click on http://groups.google.com/group/cake-php/web/cakephp-unofficial-resources - or copy paste it into your browser's address bar if that doesn't work.

  1   2   >