Re: i apparently don't understand htaccess

2007-02-26 Thread [EMAIL PROTECTED]
Have you tried http://localhost/cows/?news --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email

Re: how to count articles in category ?

2007-02-26 Thread Nookie
can anybody tell my why in this function public function countContents($category_id){ $query = $this-query('SELECT COUNT(*) as how_many FROM '. $this-TABLE_CONTENTS_CATEGORIES.' WHERE category_id = '. $category_id); return $query[0][0]['how_many']; } to return 'how_many' value

Recursive model

2007-02-26 Thread Martin Schapendonk
Hi there, Using CakePHP 1.2 (r4451). I have a model Study that references itself (three attributes: id, parent_id, name). The Model is defined as follows (extra stuff removed for simplicity): ?php class Study extends AppModel { var $name = 'Study'; var $hasMany = array( 'Study' =

Re: Recursive model

2007-02-26 Thread Felix Geisendörfer
Try naming the hasMany study 'ChildStudy' and the belongsTo 'ParentStudy'. That should work. -- Felix -- http://www.thinkingphp.org http://www.fg-webdesign.de Martin Schapendonk wrote: Hi there, Using CakePHP 1.2 (r4451). I have a model Study that references itself

Outside Session data in Cake

2007-02-26 Thread Olwen Williams
I have an OS Commerce shop and I want to use the session data within a small cake app. I searched the list archives and found this thread, but can't seem to make it work.

Re: accessing form elements with javascript

2007-02-26 Thread Mandy
var f = document.forms['name_of_your_form']; var elmName = f.elements['data[Tag][tag_name]']; alert(elmName.value); Hope this helps! Thanks, Mandy. http://mandysingh.blogspot.com On Feb 26, 11:13 am, Zoltan [EMAIL PROTECTED] wrote: Hi, I have a form with a select element like:

Re: Recursive model

2007-02-26 Thread Felix Geisendörfer
Thanks, that worked. One small addition is that I had to add className in the association array as well, otherwise Cake would complain about non-existent classes ParentStudy and ChildStudy. Yeah I was about to add that but since you were already using assoc params and I couldn't remember the

Re: Drake :: Drupal-CakePHP 1.0.1b Released

2007-02-26 Thread Eric C Blount
Hey Mariano, Great work! I've been playing with Drupal and Drake all evening - really enjoying it so far! One thing: The layout template CakePHP uses must include body and /body tags. I couldn't get it to display anything without them. Any ideas why this is? If it's just part of the deal, you

Re: Passing value from appController to all models used by an action

2007-02-26 Thread CraZyLeGs
First of all, and IMHO when you need to access a model from a controller, better set it in the $uses array rather than taking advantage of model linking. If it's there, no need for $uses. I think performance is much more important than Source code readability, and hey

Re: CakePHP + AMFPHP 1.9b or WebOrb

2007-02-26 Thread CraZyLeGs
Search this group, I'm pretty sure this has been discussed pretty recently On Feb 25, 12:35 pm, peper [EMAIL PROTECTED] wrote: Hi. I'm planning to make a Flex2 client for CakePHP application. That means I need AMF3 for PHP. Both AMFPHP 1.9beta and WebOrb for PHP supports AMF3. Does anyone

Beginner: pulling categories out of a table from another model

2007-02-26 Thread voycey
Okay - Not sure if the subject made any sense but here is basically what I want to do: I have a table called tools: id, created, modified,title,doctype,document,catID and I have a category table (tool_categories): id, created, modified, title Now in the view for the tools page I want to pull

Finding class objects instead of Arrays

2007-02-26 Thread peper
Is it possible to make CakePHP to return array of objects of specified class instead of array of arrays. What I mean, f.e. I have 'users' table and 'User' model. User has name, login, password and email. I make, let's call it value object class: class UserVO { var $name; var $login; var

Re: Finding class objects instead of Arrays

2007-02-26 Thread Daniel Hofstetter
There is no such functionality available in CakePHP so you have to write it yourself. HTH -- Daniel Hofstetter http://cakebaker.42dh.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to

Re: Drake :: Drupal-CakePHP 1.0.1b Released

2007-02-26 Thread Eric C Blount
Mariano, Also, any idea why I can't add a URL Alias to a Drake path? For instance, I have a page served by the pages controller in CakePHP named test1.thtml. It works when I access /drake?run=%2Fpages%2Ftest1, but when I instruct the URL aliases module to route test1 to

Re: Passing value from appController to all models used by an action

2007-02-26 Thread CraZyLeGs
This is true for components too. would mean this true for the use of models in components. ( $this-controller-.. ) On Feb 26, 10:43 am, CraZyLeGs [EMAIL PROTECTED] wrote: First of all, and IMHO when you need to access a model from a controller, better set it in the $uses array rather than

Re: CMS: How to set pages to have 'parents'?

2007-02-26 Thread double07
Firstly, thanks for your feedback, but I'm getting this error? Fatal error: Call to undefined method stdClass::findAllThreaded() in C: \wamp\www\cake\app\controllers\nodes_controller.php on line 45 Am I missing something here? Cheers. On Feb 24, 1:30 pm, Eric C Blount [EMAIL PROTECTED] wrote:

Jquery and Cake

2007-02-26 Thread Ámon Tamás
Hello, There was some discuss about jQuery and cakePHP. I found a class what is a jquery helper class for php. Maybe it is usefull. http://www.ngcoders.com/php/pquery-php-and-jquery/ -- Ámon Tamás http://linkfelho.amon.hu --~--~-~--~~~---~--~~ You received

Re: How to set pages to have 'parents'?

2007-02-26 Thread double07
Thanks Mariano, I'll have a look at that component once I get the array Eric mentioned up and running. Cheers. On Feb 24, 1:34 pm, Mariano Iglesias [EMAIL PROTECTED] wrote: Sounds like findAllThreaded() is the answer you are looking for: http://bakery.cakephp.org/articles/view/63 Also

Re: Drake :: Drupal-CakePHP 1.0.1b Released

2007-02-26 Thread anselm
This is going to be very usefull ! Thanks a lot ! Anselm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this

Re: More than one HABTM?

2007-02-26 Thread Mech7
Hmm but i have a function to find all of them for the index and a category function to find only those with the selected category? How would i do this in the model? On Feb 26, 2:06 am, Grant Cox [EMAIL PROTECTED] wrote: Afaik you cannot query across a hasMany association, as these are built

Re: More than one HABTM?

2007-02-26 Thread AD7six
On Feb 26, 1:22 pm, Mech7 [EMAIL PROTECTED] wrote: Hmm but i have a function to find all of them for the index and a category function to find only those with the selected category? How would i do this in the model? On Feb 26, 2:06 am, Grant Cox [EMAIL PROTECTED] wrote: Afaik you cannot

Re: CMS: How to set pages to have 'parents'?

2007-02-26 Thread AD7six
On Feb 26, 11:51 am, double07 [EMAIL PROTECTED] wrote: Firstly, thanks for your feedback, but I'm getting this error? Fatal error: Call to undefined method stdClass::findAllThreaded() in C: \wamp\www\cake\app\controllers\nodes_controller.php on line 45 Am I missing something here? You

Re: CMS: How to set pages to have 'parents'?

2007-02-26 Thread Eric C Blount
Um...should be a method of the model class: http://api.cakephp.org/class_model.html#181aefe1bf7efe1504692c485c83caa8 http://api.cakephp.org/1.2/classModel.html#181aefe1bf7efe1504692c485c83caa8 Are you calling it as $this-Node-findAllThreaded(...), as in the example in your first post? Eric On

Share a sequence between two tables

2007-02-26 Thread Gonçalo Marrafa
Hi. Hi have two tables in my database that get their id's from the same sequence. The problem is that when i try to insert records in either of them cake tries to get the record's id by selecting the nextval for tablename_id_seq, which isn't correct. What is the correct way of getting the right

Re: New baker struggling with hasAndBelongsToMany

2007-02-26 Thread nate
http://groups.google.com/group/cake-php/search?group=cake-phpq=hasAndBelongsToMany+join+table+nate+through http://groups.google.com/group/cake-php/search?group=cake-phpq=hasAndBelongsToMany+join+table+nate On Feb 23, 3:25 pm, nickgust [EMAIL PROTECTED] wrote: Hey gang, been doing php for

Re: Jquery and Cake

2007-02-26 Thread nate
The jQuery interface is already being implemented, however, we don't take code from other projects for licensing reasons. On Feb 26, 7:01 am, Ámon Tamás [EMAIL PROTECTED] wrote: Hello, There was some discuss about jQuery and cakePHP. I found a class what is a jquery helper class for php.

Re: Jquery and Cake

2007-02-26 Thread Olivier Percebois-Garve
From their homepage: License : MIT or GPL ( what ever you wish to use ) This should be compatible with cake's license, isn't it ? On 2/26/07, nate [EMAIL PROTECTED] wrote: The jQuery interface is already being implemented, however, we don't take code from other projects for licensing

Re: variable number of items in one table

2007-02-26 Thread mike
I have setup table relations so that Order brings in Orderlines, but this leads me to another problem. I somehow need to total the order but this isn't as easy as I first thought. I'm wondering if anyone can give any help on how to do this, probably a for loop i would think? Thanks very much any

Re: Beginner: pulling categories out of a table from another model

2007-02-26 Thread voycey
Its okay - I had coded the $belongsTo and $hasMany a bit strangely: class ToolCategory extends AppModel { var $name = ToolCategory; var $hasMany= array ( 'Tool' =

Re: Jquery and Cake

2007-02-26 Thread nate
On cakephp.org, there's a bullet point that reads as follows: Clean IP - Every line of code was written by the CakePHP development team So no. On Feb 26, 8:28 am, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: From their homepage: License : MIT or GPL ( what ever you wish to use ) This

Re: More than one HABTM?

2007-02-26 Thread Mech7
Thanks i am trying the method on the first page.. In my controller items_controller.php I have this $this-Items- bindModel(array('hasOne'=array('CategoryItem'=array(; $constraint['CategoryItem.category_id'] = $category_id;

Re: More than one HABTM?

2007-02-26 Thread Jon Bennett
And my model looks like this category_item.php ?php class CategoryItem extends AppModel { var $name = 'CategoryItem'; } ? But it throws up an error No Database table for model CategoryItem (expected category_items), create it first. easiest fix would be to add the table

Re: More than one HABTM?

2007-02-26 Thread Mech7
Thanks allot working now learn something new everyday :D On Feb 26, 3:21 pm, Jon Bennett [EMAIL PROTECTED] wrote: And my model looks like this category_item.php ?php class CategoryItem extends AppModel { var $name = 'CategoryItem'; } ? But it throws up an error No

HTML Helpers in elements?

2007-02-26 Thread Mech7
I can't find how to do this.. how do i make the html helper class available within the elements?. Also I have this problem in a javascript files where i have defined the path to an image how do i deal with this if cake resides in a subdir? --~--~-~--~~~---~--~~

Re: Share a sequence between two tables

2007-02-26 Thread Martin Schapendonk
2007/2/26, Gonçalo Marrafa [EMAIL PROTECTED]: Hi have two tables in my database that get their id's from the same sequence. The problem is that when i try to insert records in either of them cake tries to get the record's id by selecting the nextval for tablename_id_seq, which isn't correct.

Re: Share a sequence between two tables

2007-02-26 Thread Martin Schapendonk
2007/2/26, Martin Schapendonk [EMAIL PROTECTED]: 2007/2/26, Gonçalo Marrafa [EMAIL PROTECTED]: Hi have two tables in my database that get their id's from the same sequence. The problem is that when i try to insert records in either of them cake tries to get the record's id by selecting the

Re: HTML Helpers in elements?

2007-02-26 Thread Ámon Tamás
Mech7 wrote: I can't find how to do this.. how do i make the html helper class available within the elements?. I think the next row is helping for you in the app_controller.php var $helpers = array('helper_you_want'); -- Ámon Tamás http://linkfelho.amon.hu

Re: Drake :: Drupal-CakePHP 1.0.1b Released

2007-02-26 Thread mozart_ar
thanks, Mariano. good job! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL

Re: HTML Helpers in elements?

2007-02-26 Thread Mech7
I allready have that.. ?php class AppController extends Controller { // Helpers var $helpers = array('Html', 'Javascript'); } ? But it is not available in elements :( On Feb 26, 4:46 pm, Ámon Tamás [EMAIL PROTECTED] wrote: Mech7 wrote: I can't find how to do this.. how do i

Re: Share a sequence between two tables

2007-02-26 Thread Gonçalo Marrafa
Thanks for your reply Martin. On Mon, 26 Feb 2007 16:32:59 +0100 Martin Schapendonk [EMAIL PROTECTED] wrote: You don't mention it, but I assume you use Oracle based on the fact you mention sequences. You also don't mention the Cake version and the database driver you use. I'm using

Re: FLEX 2 Integration Issues

2007-02-26 Thread [EMAIL PROTECTED]
It does look like the important stuff made it, including the services browser. I have it working and haven't had any issues yet, though I still need to try it with the new PHP extension. I will let you know when I get a chance to test that. Thanks, Rhett On Feb 23, 9:50 pm, Eric C Blount

RE: Passing value from appController to all models used by an action

2007-02-26 Thread Mariano Iglesias
What performance differences do you see? Let's say ModelA has references to ModelB, ModelC, ModelD... You use only ModelA on your controller but access B, C, and D through its linkage with A. When CakePHP takes the var $uses array it will instantiate all models in there, and for each model it

Re: HTML Helpers in elements?

2007-02-26 Thread Ámon Tamás
Mech7 wrote: I allready have that.. ?php class AppController extends Controller { // Helpers var $helpers = array('Html', 'Javascript'); } ? But it is not available in elements :( Where do you ant to use it? Maybe if you want to use other helpers in your controller this

Re: HTML Helpers in elements?

2007-02-26 Thread nate
Does it give you an error when you try to access it? On Feb 26, 11:12 am, Ámon Tamás [EMAIL PROTECTED] wrote: Mech7 wrote: I allready have that.. ?php class AppController extends Controller { // Helpers var $helpers = array('Html', 'Javascript'); } ? But it is not

findNeighbours does not seem to be working

2007-02-26 Thread Xandornot
Hi, has anyone successfully used findNeighbours? I have tried this in several models and even a simple use such as $this-set('neighbours', $this-Slide-findNeighbours(null, 'id', $id); with $id properly filled only produces an empty array of [prev] and [next] with no previous and next ids

Re: HTML Helpers in elements?

2007-02-26 Thread Samuel DeVore
On 2/26/07, Mech7 [EMAIL PROTECTED] wrote: I can't find how to do this.. how do i make the html helper class available within the elements?. I do this all the time, what errors are you seeing, you might check the case of the way you are calling it like ?php echo $html-link( or ?php

Re: best practice multiple checkboxes

2007-02-26 Thread szeta
excellent! Thanks for all the hints! On 23 Feb., 15:13, bbuchs [EMAIL PROTECTED] wrote: GreyCells also wrote a Helper for this purpose - I'm using it on a 1.2 project now, and it's great. I think the HTML it outputs could be a little cleaner, but it does what it should.

Re: [C] Session problems

2007-02-26 Thread tonitorello
jmassi wrote: I've read a lot of post talking about some session problems and I've tried out all the posible solutions that people say but mys sessions still not working. The problem is data is disapear when I redirect to another page. Also I've treid to save data in a database but

own helper with cakePHP

2007-02-26 Thread Arndtinho
Hello, how can I use my own helper in an app? I have a main_controller, an course_model, an course_helper and a global_layout. Controller: main_controller.php: class MainController extends AppController { var $name= 'Main'; var $layout = 'global'; var $helpers = array( 'Course'

Sending forms in an html email

2007-02-26 Thread Bootstrapper
What's the best way to send forms in an HTML email? I've seen it done before, but in my current attempt, Yahoo Mail is stripping out my action tag: action=/cake/goalsite/main/index/ so form action=/cake/goalsite/main/index/ method=post becomes form

Re: variable number of items in one table

2007-02-26 Thread mike
I have searched this board high and low and cannot find a solution to this problem On Feb 26, 12:24 pm, mike [EMAIL PROTECTED] wrote: I have setup table relations so that Order brings in Orderlines, but this leads me to another problem. I somehow need to total the order but this isn't as easy

Re: relationships

2007-02-26 Thread miggs
I ended up finding a solution under at the following location: http://groups.google.com/group/cake-php/browse_thread/thread/6547b2869f3cd9ad/4349906b4f18aa4d?lnk=gstq=%27Vote%27+modelrnum=4#4349906b4f18aa4d I'm not sure if it's the most elegant solution, but I ended up using the

Re: variable number of items in one table

2007-02-26 Thread djiize
either you foreach the $data['Order']['Orderline'] and calculate the sum of (price * quantity) or either you add a sum field in your orders table thats is modified when you add/edit/delete an orderline (maybe by an afterSave callback) On 26 fév, 18:54, mike [EMAIL PROTECTED] wrote: I have

Re: Sending forms in an html email

2007-02-26 Thread djiize
I met a lot of problem to do things like that in email, so now, I send a brief email, and put in it a link to a webpage that do things better ;) On 26 fév, 18:42, Bootstrapper [EMAIL PROTECTED] wrote: What's the best way to send forms in an HTML email? I've seen it done before, but in my

Re: how to pass criteria to pagination object?

2007-02-26 Thread [EMAIL PROTECTED]
On Feb 5, 7:02 am, vidya [EMAIL PROTECTED] wrote: Hi, I have a problem withpaginationof search results, when acriteria is specified. I usedpaginationhelper in bakery of cakephp. First time when I submit the form withcriteriaI get the correct results, but when I navigate to next page it

Re: Sending forms in an html email

2007-02-26 Thread Bernardo Vieira
Robin, Yahoo may include scanners to strip out those action references in their email servers in an effort to protect theis less than intelligent users, so I don't really see a way around that. Another problem is that, even if you do get the form past with the action tag intact you'll need to

Validation without a Model ?

2007-02-26 Thread Mech7
Is there a way to use the validators without a model? I am trying to create a email form so it does not have a table in the database, and doesn't have a model.. but I am trying to figure out how i can validate empty fields but the manual says i need to put this in the model. var

Question about pagination

2007-02-26 Thread [EMAIL PROTECTED]
Hello, I am trying to displays a large number of records, with pagination. The default code generated by bake.php works very well , but it displays *all* the records in the database table. I need to add some filtering criteria, and at the same time have pagination. Below is what i did so far.

Re: how to pass criteria to pagination object?

2007-02-26 Thread NOSLOW
This thread may be of use: http://groups.google.com/group/cake-php/browse_thread/thread/5d0a4cb93d66a6c2/1d4d9e3a35ddfa47?hl=en#1d4d9e3a35ddfa47 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To

Re: Validation without a Model ?

2007-02-26 Thread Mech7
Ok i found a way with a model and : var $useTable = false; But now i get this error? Notice: Use of undefined constant VALID_EMAIL - assumed 'VALID_EMAIL' in E:\xampp\htdocs\portfolio\cake\dispatcher.php on line 158 Notice: Use of undefined constant VALID_NOT_EMPTY - assumed 'VALID_NOT_EMPTY'

XML, MySQL and Controllers question(s)

2007-02-26 Thread Christopher E. Franklin, Sr.
Hello, Sorry for this very long post but, I want to get what information I can out for these questions. Sorry for my noobness to cake. I guess the questions are simple really but, just want to make everything clear. I have an xml file that contains a lot of data that is extracted from a

Re: own helper with cakePHP

2007-02-26 Thread Arndtinho
It's workin fine now. I used the same variable name twice On 26 Feb., 18:51, Arndtinho [EMAIL PROTECTED] wrote: Hello, how can I use my own helper in an app? I have a main_controller, an course_model, an course_helper and a global_layout. Controller: main_controller.php: class

Re: how to pass criteria to pagination object?

2007-02-26 Thread Adrian Maier
On 2/26/07, NOSLOW [EMAIL PROTECTED] wrote: This thread may be of use: http://groups.google.com/group/cake-php/browse_thread/thread/5d0a4cb93d66a6c2/1d4d9e3a35ddfa47?hl=en#1d4d9e3a35ddfa47 It was indeed helpful. Thanks. I have made the following changes : - in the controller : function

Can't save article in bakery (bug fix update for expects() article)

2007-02-26 Thread Mariano Iglesias
It's been a long time since I can't seem to modify articles on the bakery. As reported here: https://trac.cakephp.org/ticket/2075 Now a fix allows me to create new articles, but can't still edit articles. Is anyone having the same problem as me? Just want to make sure before bothering our

Re: Validation without a Model ?

2007-02-26 Thread Mech7
Nevermind got rid of the errors but it does not validate i never get an error when i leave the form blank? index.thtml h2Contact form/h2 div This is the contact form /div form method=post action=?php echo $html-url('/contact')? p Email: ?php echo $html-input('Contact/email',

Updated AppModel::expects() function for specifying which models should be returned

2007-02-26 Thread Mariano Iglesias
I just developed a new version that fixes two issues reported in the bakery article (http://bakery.cakephp.org/articles/view/185): 1. Timo, Ritesh (on comment entitled Association Name vs. Classname), and Grey Cells (via CakePHP google group) reported that when using different association

using sanitize together with validate for security

2007-02-26 Thread keymaster
I've read the relevant manual chapters and googled this forum. It has helped a bit, but unfortunately, I am still a bit vague on a reasonable way of using sanitize together with validation to properly secure things, Perhaps others are in the same boat, so I thought I would think out loud a bit

does cake detect ajax requests from prototype automatically?

2007-02-26 Thread [EMAIL PROTECTED]
Just curious, I'm trying to understand how my controller actions will 'know' a request is ajax, do I have to embed the ajax=1 in my requests? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post

Re: does cake detect ajax requests from prototype automatically?

2007-02-26 Thread nate
No, Prototype sends special HTTP headers which are detected by RequestHandler. On Feb 26, 5:12 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Just curious, I'm trying to understand how my controller actions will 'know' a request is ajax, do I have to embed the ajax=1 in my requests?

Ambiguous columns in findAll()

2007-02-26 Thread Norman
I implent search fields using examples I found here in the group: function search() { if(empty($this-data)) { $this-render(); } else { $conditions =array(); $search_term = $this-data['Candidato']['nome']; $conditions['Candidato']['nome'] = LIKE

Ambiguous columns in findAll()

2007-02-26 Thread Norman
I implent search fields using examples I found here in the group: function search() { if(empty($this-data)) { $this-render(); } else { $conditions =array(); $search_term = $this-data['Candidato']['nome']; $conditions['Candidato']['nome'] = LIKE

Re: does cake detect ajax requests from prototype automatically?

2007-02-26 Thread [EMAIL PROTECTED]
Ok, so if I make an ajax request with prototype, then my layout is automatically set to 'ajax'. If I don't create an ajax layout, is my controller action output wrapped in nothing,or does it fail? On Feb 26, 4:22 pm, nate [EMAIL PROTECTED] wrote: No, Prototype sends special HTTP headers which

Re: Ambiguous columns in findAll()

2007-02-26 Thread Langdon Stevenson
Hi Norman The way I normally format my conditions array is for example: $conditions = array('Batch.id' = $id); When the query runs Cake reformats 'Table.column' as `Table`.`column`. This result is no ambiguity. I have not constructed a LIKE condition, so I don't know about the right hand

RE: Ambiguous columns in findAll()

2007-02-26 Thread Mariano Iglesias
Try function search() { if (!empty($this-data)) { $search_term = $this-data['Candidato']['nome']; $conditions = array( 'Candidato.nome' = LIKE %{$search_term}% ); $results =

question about baker.cakephp.org

2007-02-26 Thread [EMAIL PROTECTED]
Hi, I'm using an older laptop, but I typically don't have problem with any web site, except baker.cakephp.org When I try to review or see component's details, it always crashes my browser. Can you get away from posting the entire source code on the component home page? Just curious, I would

Re: Can't save article in bakery (bug fix update for expects() article)

2007-02-26 Thread Mech7
I don't know but it also gives me many times errors when i want to comment on a article, also the tagging thingy displays an error :( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this

Re: question about baker.cakephp.org

2007-02-26 Thread Grant Cox
I would have thought upgrading your browser is the only thing required... What browser do you use? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: Validation without a Model ?

2007-02-26 Thread Grant Cox
In your controller: if ( $this-Contact-validates($this-data) ){ // mail } else { // show errors } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email

Re: Question about pagination

2007-02-26 Thread Grant Cox
Just pass your conditions as the first parameter to your paginate function. $your_conditions = array('session_id'=$session_id); $this-set( 'importData', $this-paginate($your_conditions) ); --~--~-~--~~~---~--~~ You received this message because you are

Re: does cake detect ajax requests from prototype automatically?

2007-02-26 Thread nate
No, there's a default ajax layout in the core. On Feb 26, 5:28 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Ok, so if I make an ajax request with prototype, then my layout is automatically set to 'ajax'. If I don't create an ajax layout, is my controller action output wrapped in nothing,or

Re: XML, MySQL and Controllers question(s)

2007-02-26 Thread Christopher E. Franklin, Sr.
Okay. What I have done so far: Did a bit more research into the Model for handling the data format before inserting it into the database. This seems more logical since the component helps the controller with the flow of things, not formatting data. So, I moved my code to the Model and it works

Re: question about baker.cakephp.org

2007-02-26 Thread nate
Yeah, it probably won't work off of baker.cakephp.org, but bakery.cakephp.org should work, unless you're on Netscape 4 or lower... On Feb 26, 5:59 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I'm using an older laptop, but I typically don't have problem with any web site, except

Re: Ambiguous columns in findAll()

2007-02-26 Thread nate
You can also do this with Controller::postConditions(), which auto- converts POST data to array conditions. On Feb 26, 5:54 pm, Mariano Iglesias [EMAIL PROTECTED] wrote: Try function search() { if (!empty($this-data)) { $search_term =

Re: Finally a good Editor for Windows

2007-02-26 Thread [EMAIL PROTECTED]
On Feb 13, 2:02 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: what part of alpha stage is it that you don't understand? I would have said alpha stage meant feature complete but not necessarily all that stable (ie use with care). I never realised software could be in alpha while also being in

Re: Validation without a Model ?

2007-02-26 Thread Mech7
Thanks allot that works great.. only it only checks the email / subject and not the textarea if it is empty or not? I tried changing the name but the error message does not come up? On Feb 27, 12:37 am, Grant Cox [EMAIL PROTECTED] wrote: In your controller: if (

Re: Ambiguous columns in findAll()

2007-02-26 Thread Norman
Thanks Langdon, Mariano and Nate. The $conditions = array('Candidato.nome' = LIKE %{$search_term}%); worked as a champ. And this even helped me to better understand the innards of the FindAll method. Nate, I was not able to fully understand how to use postConditions(). Im still on my first

Is it worth making a feature request for: pass query conditions to deforeDelete?

2007-02-26 Thread Langdon Stevenson
I am considering opening a ticket for a feature request for some functionality in del() / beforeDel(), but wanted to check if there is any reason why this shouldn't be implemented. While implementing some security in an application I came across the need to limit which data a user can delete

Routes created from database

2007-02-26 Thread crazed_climber
Over the last few days I have been trying to thinking of a way of easily and efficiently allow $Route-connect to be generated by a database table. This way I can organize my site better and make the urls look better. I know that I could do this from within routes.php, but there is potential for

saving to a related model

2007-02-26 Thread jyrgen
i'm having a silly problem with saving data to a related model. - class AuthorsController extends AppController{ var $uses = array('Author', 'User'); In my edit form i'd like to be able to save passwords (they belong to the User model.) But everytime cake creates a new User

Re: Routes created from database

2007-02-26 Thread Langdon Stevenson
Just from looking at the routes.php file I can't see any reason why you couldn't store route information in your database. All you would need to do is query the data, then run a forloop over the result set calling $Route-connect using the data from each record. I don't know if the database

Re: saving to a related model

2007-02-26 Thread Langdon Stevenson
Hi jyrgen My guess is that whey you are calling: $this-Author-User-saveField('password', md5($pw1)); Cake is passing the id or Author as the id of the User record to save. Therefore if there is no record that matches the id, a new one will be created. I would just go for a save() instead

Re: saving to a related model

2007-02-26 Thread jyrgen
thanks langdon ! i will try this out, although i'm wondering why cake doesn't have the foreign id already since i defined a relation in the model class: var $hasOne = array( 'User' = array('className' = 'User',

Re: saving to a related model

2007-02-26 Thread Langdon Stevenson
Hi jyrgen i will try this out, although i'm wondering why cake doesn't have the foreign id already since i defined a relation in the model class: That is true, and I guess that it should be possible to deduce the foreign key from the relationship. I don't know enough about the internals of

Query returns fatal error - Please help

2007-02-26 Thread Xandornot
$this-query(UPDATE users SET password = 'test' WHERE id = 25); I am using the previous in a controller, the controller returns a fatal error Fatal error: Call to undefined method UsersController::query() Does this not work in a controller?? What other magic do I have to do? I hope someone can

Re: Query returns fatal error - Please help

2007-02-26 Thread Langdon Stevenson
Hi Xandornot query is a method of the model class. Therefore you can't call $this-query() in a controller. You have to call it via a model. So if you model is User (to manage the users table), then you would do this: $this-User-query(UPDATE users SET password = 'test' WHERE id = 25); This

Re: Routes created from database

2007-02-26 Thread crazed_climber
Yeah I know that I could just write a query connect to the database and all that. I was just not sure if maybe the database class might have already been loaded at this point and I could use that just to keep it all organized. I think I just might call the database.php file if I can and put build

Re: saving to a related model

2007-02-26 Thread jyrgen
after i set the id manually in the Authors controller: $this-User-setId($this-author_id); ( $this-author_id is a controller variable which is derived from the session $this-Session-readSessionVar('User.author_id'); ) i was able to $this-User-saveField('password', md5($pw1)); dunno why,

Re: saving to a related model

2007-02-26 Thread Langdon Stevenson
That would do the job. Cake looks for a default id for the model that is being saved and uses it if it can find one. I have never done it this way myself, so thanks for enlightening me :-) Regards, Langdon jyrgen wrote: after i set the id manually in the Authors controller:

Re: Is it worth making a feature request for: pass query conditions to deforeDelete?

2007-02-26 Thread nate
The primary key value of the model being deleted is available as $this- id in Model::beforeDelete(), however, the proper place for the use case you're describing (authorization) is most correctly handled at the controller level. On Feb 26, 8:00 pm, Langdon Stevenson [EMAIL PROTECTED] wrote: I

Re: saving to a related model

2007-02-26 Thread jyrgen
Honestly speaking it is still not clear to me, why $this-Author-User-save fails due to a missing key. $this-Author itself is a huge object, it doesn't hold any data. hmm. I'm getting the notion that i should reread everything about models and relations. j.

  1   2   >