Re: What is wrong with this code?

2009-08-07 Thread FrederickD
Thanks Brian! I realize nobody is paid. Yes there is frustration and desperation at times. I do know how to live with it and continue to forge ahead. Indeed I was treating check() incorrectly. I read the entry in book.cakephp.org about six times until it finally sunk in. Once you understand what

Re: Ubdate HABTM and hasMany

2009-08-07 Thread Persivo Cunha
Suppose that you have any validation, in your saveAll, you have to chance your this->data. First, if you used save, the correct is save ($this->data), and not $this->data['Recipe']. As you are using saveAll, your this->data must have similar to this below $this->data = array( 0 => array(Recipe

Re: Retrieve data from $this->Auth->User in Model?

2009-08-07 Thread Persivo Cunha
Yes. You can retrieve data using this variable $_SESSION use debug($_SESSION) and you'll see that the info will be there, more especifically $_SESSION['Auth'] On 3 ago, 20:39, DigitalDude wrote: > Hey, > > for a little validation-function in my model I need to get the data > from the logged-in

Re: What is wrong with this code?

2009-08-07 Thread brian
Nobody on this list is being paid to answer anyone's questions. We've all been there before where our desperate queries have gone ignored. Learn to live with it. In the meantime, maybe you should give this a read: http://catb.org/esr/faqs/smart-questions.html But back to your problem, you're tre

Re: Assigning, accessing and comparing viewVars in a controller...

2009-08-07 Thread brian
Controller::set(), as you can see, adds a variable with the supplied name & value to the $viewVars array which, in turn, is made available to the View object. However, you're not creating a *local* variable with the given name & value. For that, you'd need to first asign it to a variable, then use

Re: Invalid argument supplied for foreach()

2009-08-07 Thread brian
function catfun($id = null) { $this->set('cats', $this->Cat->find('all')); $this->Cat->cat_id = $id; $this->set('cats', $this->Cat->read()); } You're setting a variable $cats twice here. On Fri, Aug 7, 2009 at 5:59 AM, kishore chatna wrote:

Re: possible to do validation in not current model? where should I put validation??

2009-08-07 Thread brian
I'm not sure that I understand your question. But you can call the model's function directly from the controller. On Fri, Aug 7, 2009 at 4:42 PM, leafchild wrote: > > Thanks, brian. but can I associate with my validation macadamized > function? > > so if set validation in Size model: > >

Re: Uploading file issue - worning mkdir()

2009-08-07 Thread brian
Check the permissions for the directory. The webserver has to have write access to the dir. On Fri, Aug 7, 2009 at 4:02 PM, leafchild wrote: > > I'm trying to make this plugin(http://www.milesj.me/resources/script/ > uploader-plugin) works. > > However, after I install I'm getting an error - Warn

Re: How can I leave entered value even there is an errro and couldn't complete

2009-08-07 Thread brian
Are you using FormHelper to create your form elements? If you do, for example: echo $form->input('Post') ... the helper will add the value of the element based upon $this->data. If you are using the helper, maybe you should post your controller and view code. On Fri, Aug 7, 2009 at 6:56 PM, le

Re: I can't make cakePHP work with SQLite3.

2009-08-07 Thread Marcelo Andrade
On Thu, Aug 6, 2009 at 1:12 PM, Vincent wrote: > > I got a problem with SQLite3: > Warning (2): sqlite_query() [function.sqlite-query]: file is encrypted > or is not a database [CORE/cake/libs/model/datasources/dbo/ > dbo_sqlite.php, line 133] > > This is my configuration file: > class DATABASE_CO

Re: URL some page .../id disappeared ?

2009-08-07 Thread euromark (munich)
as soon as you post the data, you dont need the /id anymore it is "hidden" in the form and gets passed on each submit if you "need" it in your url for some reason, dont use "action"=>"edit", but "url"=>"/".$this->params['url]['url'] on creating the form now it will stick to the url On 8 Aug., 0

URL some page .../id disappeared ?

2009-08-07 Thread leafchild
URL some page .../id disappeared ? I have site there are different form pages to organize products. Some form page such as admin_edit page - URL: ... admin/product/edit/ 1 After I submit URL still same either there is an error or not. However, some form page lose id from URL after submit, and

Re: ACL not denying access to protected actions

2009-08-07 Thread robh
Like a charm! Added parent::beforeFilter(); to all my controllers and it works as expected. Thanks a lot. On 7 Aug, 20:12, Josh wrote: > My problem was that I had removed the parent::beforeFilter(); > statement from my controllers. It seems like the section of the > Cookbook where it says to in

How can I leave entered value even there is an errro and couldn't complete

2009-08-07 Thread leafchild
I have a page with form. If user entered name, address,,,and ,all kinds of information and submit but there is mistakes such as not entered email properly and came back to form page with error message. How can I keep the entered value user entered properly. Currently in my form page, if user has

Re: what's the best, most current book available in English?

2009-08-07 Thread Jamie
I agree with Miles - 'the' book (book.cakephp.org) is the best resource. Print it out if you must. Beware that most of the third- party CakePHP books out there pale in comparison. - Jamie On Aug 7, 7:41 am, vtbludgeon wrote: > Hello > > Cake noob here, but I have no fear of PHP/MySQL and some e

Re: What is wrong with this code?

2009-08-07 Thread FrederickD
Never mind. So far two posts... ZERO answers... I kept banging on it and fixed it. Instead of using ($session->check...), which now I learned returns true or false, I am now using ($session->read...) which works well. I guess I have to figure out the right combination of things to put into a pos

Re: Assigning, accessing and comparing viewVars in a controller...

2009-08-07 Thread geste
Sometimes I hit myself with a small, embarrassing clue stick immediately after posting. I thought I had tried using $this->viewVars['whatever' ] in my find conditions and that it just didn't work. But I just tried that little test of: $this->set('menu_link', "/budgets" ); $this->set('menu_n

Assigning, accessing and comparing viewVars in a controller...

2009-08-07 Thread geste
Background: i am trying to build a little database-driven 2-level menu system that checks authorization to access menu pages and actions *before* they are displayed. If you are not authorized to use the "budgets" table in any way, you won't be presented with a "budgets" menus option (I am using

Re: Running shells as cron jobs on Godaddy

2009-08-07 Thread Josh
It turns out there were 2 problems and there are two minor ongoing issues. For anybody setting up the cake shell on godaddy to run as a cron job, here is a description of my own issues: First: The "line12: cake: command not found" was cause because cakeshell couldn't find the cake bash file. I ch

Re: what's the best, most current book available in English?

2009-08-07 Thread Miles J
Personally, the docs are the only way to go. There are some CakePHP books but they are either outdated or poorly written. On Aug 7, 7:41 am, vtbludgeon wrote: > Hello > > Cake noob here, but I have no fear of PHP/MySQL and some experience > with Zend Framework. I want to do a project with typica

Re: Invalid argument supplied for foreach()

2009-08-07 Thread Miles J
So what exactly are we looking at here? Where is the problem? --~--~-~--~~~---~--~~ 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 gr

Re: how to set "CHECKED" with form helper radio

2009-08-07 Thread leafchild
>adam, I know it's array and if you see my first post I had set array already. >Miles J Thanks, Miles J OK, I try to use $form->input() Probably if i use $form->input() then if there is error the info user enter is still there? except the one invalid value?? I've been using $form->text style and

Re: possible to do validation in not current model? where should I put validation??

2009-08-07 Thread leafchild
Thanks, brian. but can I associate with my validation macadamized function? so if set validation in Size model: = ... 'size_name' => array( 'namechk'=>array( 'rule'=>array(

Uploading file issue - worning mkdir()

2009-08-07 Thread leafchild
I'm trying to make this plugin(http://www.milesj.me/resources/script/ uploader-plugin) works. However, after I install I'm getting an error - Warning (2): mkdir() [function.mkdir]: Permission denied [CORE/cake/libs/folder.php, line 466] Actually I tried another behavior to upload file and got sam

Re: CakePHP Editor/IDE

2009-08-07 Thread Jon Molesa
And some more http://en.wikipedia.org/wiki/Ctags *On Thu, Aug 06, 2009 at 04:44:18PM -0400 Jon Molesa wrote: > Date: Thu, 6 Aug 2009 16:44:18 -0400 > From: Jon Molesa > Subject: Re: CakePHP Editor/IDE > To: cake-php@googlegroups.com > > > I get code completion in Vim with ctags-exuberant. I

Re: CakePHP Editor/IDE

2009-08-07 Thread Jon Molesa
A list of editors and tools supporting ctags http://ctags.sourceforge.net/tools.html *On Thu, Aug 06, 2009 at 04:44:18PM -0400 Jon Molesa wrote: > Date: Thu, 6 Aug 2009 16:44:18 -0400 > From: Jon Molesa > Subject: Re: CakePHP Editor/IDE > To: cake-php@googlegroups.com > > > I get code comple

Re: ACL not denying access to protected actions

2009-08-07 Thread Josh
My problem was that I had removed the parent::beforeFilter(); statement from my controllers. It seems like the section of the Cookbook where it says to insert this line might lead you to believe that you only need it when using $this->Auth->allowedActions. In fact, this is the only way to assure t

AuthComponent - Need more explanation about "$this->Auth->authorize"

2009-08-07 Thread mig_akira
Hello everyone! I've been trying to make a simple site using Acl/Auth. Everything is going fine, except that I don't quite understand the differences between the 4 kinds of 'authorizes', nor how to implement them. For example, I don't understand how can I use the AclComponent::check() to authen

AuthComponent - Need more explanation about "$this->Auth->authorize"

2009-08-07 Thread mig_akira
Hello everyone! I've been trying to make a simple site using Acl/Auth. Everything is going fine, except that I don't quite understand the differences between the 4 kinds of 'authorizes', nor how to implement them. For example, I don't understand how can I use the AclComponent::check() to authen

Re: ACL not denying access to protected actions

2009-08-07 Thread robh
Hi, (Sorry, meant to reply to the group) Have you had any joy with this issue? I am struggling with exactly the same problem you have described. Cheers On Aug 3, 5:53 am, Josh wrote: > Hello, > > I have been working on an app for quite a while now, and I have just > noticed that myACLdoesn't

What is wrong with this code?

2009-08-07 Thread FrederickD
I am in a quandary as to what is wrong with this code: check('Auth.User.group_id') == 1): ?> link(__ ('distributors',true),''.'/'.'distributors'); ?> link(__('dealers

Re: Routing problem with underscores and named arguments

2009-08-07 Thread JamesF
well i didn't want to do it this way but in my bootstrap: define('SEO_SEPERATOR', '_'); now in my links: $html->link('mylink', array('controller'=>'mycontroler', 'action'=>'myaction', 'sid'=>$sid, 'slug'=>$slug . SEO_SEPERATOR)); in my router connect('/:slug:sid/*, etc etc') this works for ri

Re: Routing problem with underscores and named arguments

2009-08-07 Thread JamesF
ok this is driving me nuts now. basically if i put an underscore after the parameter e.x :slug_ cake is expecting to find a match on 'slug_' not 'slug' as i want. if i put an underscore before slug ex _:slug it works fine. it appears underscore doesn't work as a variable delimiter. On Aug 6, 2:03

Testing non-trivial controllers

2009-08-07 Thread Steve Madsen
I have read through the Cookbook, searched on the Bakery and read Mark Story's two blog postings about testing controllers. I am primarily a Rails developer, so there is certainly some bias here, but: either I am missing something or controller testing is far more complicated with Cake than it sho

Cakephp accessing files

2009-08-07 Thread adrian
I'm setting up paypal and have everything running fine except for one last thing which is encrypting the form that is sent to PayPal. I have this setup with no problems on a server not running cakephp, but when I try to set it up while running Cakephp it just wont access the files it needs. It us

Invalid argument supplied for foreach()

2009-08-07 Thread kishore chatna
Hi, i am getting this error while calling the function my db table -- CREATE TABLE IF NOT EXISTS `cats` ( `cat_id` int(11) NOT NULL AUTO_INCREMENT, `cat_name` varchar(150) NOT NULL, PRIMARY KEY (`cat_id`) )

Re: Trouble integrating SWFUpload with cakephp project

2009-08-07 Thread huisman.peter
SUHOSIN and swfupload gave me nightmares http://www.hardened-php.net/suhosin/index.html On Aug 6, 9:38 pm, Robert McWay wrote: > Also..the swf upload settings in my view might help also: > > link(array('swfupload/swfupload', 'swfupload/plugins/ > swfupload.queue', 'swfupload/fileprogress', 'swfu

need a cms plugin for tutorwebsite

2009-08-07 Thread adilraufk...@gmail.com
I need a opensource simple cms plugin to use in my tutor application, is there any one who has used cms as plugin to cake. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send

CakePHP SSL Certificate has expired.

2009-08-07 Thread James Barcellano
The certificate *.cakephp.org has expired! Just for anyone wondering, it's still safe to go there! Firefox get's a little over cautious on expired certs. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" grou

Re: CakePHP Editor/IDE

2009-08-07 Thread yayan rukmayana
i'm use komodo it's nice to me..and work well for cakephp --~--~-~--~~~---~--~~ 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,

Re: PHP 5.3.0 deprecated warnings

2009-08-07 Thread Frank Z
It's a quick and dirty solution that worked for me. Saved me alot of time. Until it's fixed in the build, I'm okay with this... On Jul 12, 12:31 am, 10drill wrote: > I've just upgraded PHP to 5.3.0 on my development server and found all > of my Cake sites have about 20 warning messages startin

Ubdate HABTM and hasMany

2009-08-07 Thread Luke
Hi, I have a form to add recipes to a database. I have got a HABTM Relationship and a hasMany. recipe HABTM subcategories recipe hasMany ingredients In my controller I using the following: $this->Recipe->saveAll($this->data['Recipe']) This updates my Recipe table with the HABTM Relationship.

Re: Missing Method in UsersController

2009-08-07 Thread robh
Cool. I thought URLs should map to the view name ie. users/view_list, but if they map to the controller action then it works for me. I'm still getting my head around the naming conventions - takes a bit of getting used to. Thanks On Aug 7, 2:50 pm, Jamie wrote: > Are you going to the URL "/use

Re: Storing arrays in the database (one field many values)

2009-08-07 Thread euromark (munich)
well ok serializing/unseriazing is still different than implode/explode both are not very handy though implode could be better if you want to search your in your "pseudo array" with LIKE %{...}% serializing if you dont want to do anything expect then saving/reading hasMany or even HABTM as Robe

Re: Storing arrays in the database (one field many values)

2009-08-07 Thread euromark (munich)
i wouldn't say that vijay was incorrect - he ment the same thing, just didn't express it as clear as you, miles :) either way it is way cleaner to normalize the database - this way you have more control over the multiple choices and if you delete one "choice", you can make sure it is not related

what's the best, most current book available in English?

2009-08-07 Thread vtbludgeon
Hello Cake noob here, but I have no fear of PHP/MySQL and some experience with Zend Framework. I want to do a project with typical stuff: CRUD with relational db data, authentication and simple user-group-based access control, ajax. What book do you like? (Yes the online docs and toots are fine b

Re: Multiple checkboxes

2009-08-07 Thread brian
You should save each separately. Set up your association as HABTM. Event model: public $hasAndBelongsToMany = array( 'Tag' => array( 'className'=> 'Tag', 'joinTable'=> 'events_tags', 'foreignKey' => 'event_id', 'as

Find Count inside a model relationship

2009-08-07 Thread John R
I think there is a way to do this, but it is escaping me .. I have two tables: entries and votes Users vote on entry, which are stored inside table "votes" like: id entry_idip 1 2 129.192.12.4 2 1 129.192.12.4 3 2

Re: CakePHP Auth Redirect

2009-08-07 Thread brian
In AppController::beforeFilter() $this->Auth->logoutRedirect = array('controller' => 'pages', 'action' => 'display', 'home); Or 'index', or whatever points to your default page. On Thu, Aug 6, 2009 at 1:40 PM, FrederickD wrote: > > Would you show me how you put the element to log in on the side

Re: primaryKey

2009-08-07 Thread Jamie
Why would you not want a primary key, even if just to make saving and deleting easier? In my opinion, the lack of a primary key in a database table just makes things harder to deal with, without many (if any) benefits. - Jamie On Aug 6, 5:05 pm, gjofum wrote: > I can set up primaryKey in model

Re: Missing Method in UsersController

2009-08-07 Thread Jamie
Are you going to the URL "/users/viewList" or "/users/view_list"? Basically, given these conditions: - controller action is 'Users::ViewList()' - view file is 'view_list.ctp' the URL will be: users/viewList The code engine will look for the view file in underscored form, but the resulting URL

Re: Update with WHERE Clause

2009-08-07 Thread Jamie
Can you supply the schema of the table in question? On Aug 7, 2:40 am, gjofum wrote: > You're right. > But I merge 2 tables (in db) together, because retrieving data will be > more faster (now i can join only 2 tables, but before I had to join 3 > tables, so it's much faster. I will query from t

Re: Missing Method in UsersController

2009-08-07 Thread robh
Hi Vijay, Thanks for your reply. Are you suggesting I use "function viewlist()" in my controller? I was following the convention at: http://book.cakephp.org/view/26/View-Conventions or more specifically: "View template files are named after the controller functions they display, in an underscor

Re: do I get it? ACL's purpose

2009-08-07 Thread delocalizer
Hi Mateo; It's true - getting your head around Acl takes some time, but if I may say so - you're probably overthinking the problem. My experience was that it is conceptually simpler than I had imagined, but more complicated to implement than I hoped... if that makes sense! So I suggest you actuall

Re: DB-Views instead of tables

2009-08-07 Thread orbdex
OK, I made it... one point that did not work: if the physical view-name differs from the generated model:pluralized- name it does NOT SEEM to work. I had a view called search, model-name was RegSearch setting $useTable = "search" did not work, after renaming the view to searches everything worke

console and db connection

2009-08-07 Thread cronet
Hi, is there a way to specify which db connection the console uses to connect to the db? Regards, cronet --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php

DB-Views instead of tables

2009-08-07 Thread orbdex
Hey all, I would like to use a database-view instead of a table for a certain model in my application. the $useTable = #viewname# does not seem to work...an error is thrown telling me that the table could not be found background: the view collects data from accross 6-7 tables together and i woul

RE: Curious how to question

2009-08-07 Thread Dave Maharaj :: WidePixels.com
Right on That’s the idea I was looking for. Thanks. Dave -Original Message- From: Jamie [mailto:jamie@gmail.com] Sent: August-07-09 2:57 AM To: CakePHP Subject: Re: Curious how to question Try something like this (assuming you're using the standard array conventions for you

Re: Certain strings crashing CakePHP - where do I look first?

2009-08-07 Thread delocalizer
Hi tt; How long are these strings? What datatype are you using to store these strings in the db? b.t.w. the links in your post to the examples don't appear to go anywhere useful... :( On Aug 6, 8:23 pm, technicaltitch wrote: > Dear all, > > Please I'm desperate - if you had a simple CakePHP app,

Re: Trouble integrating SWFUpload with cakephp project

2009-08-07 Thread tracyfloyd
Maybe this? http://swfupload.org/forum/generaldiscussion/176 On Aug 6, 3:38 pm, Robert McWay wrote: > Also..the swf upload settings in my view might help also: > > link(array('swfupload/swfupload', 'swfupload/plugins/ > swfupload.queue', 'swfupload/fileprogress', 'swfupload/handlers')) ?> > >

Re: Update with WHERE Clause

2009-08-07 Thread gjofum
You're right. But I merge 2 tables (in db) together, because retrieving data will be more faster (now i can join only 2 tables, but before I had to join 3 tables, so it's much faster. I will query from this table every page, so speed is more important than saving data for me.) That's why I have id

Re: How to obtain a number from a query that provides a COUNT

2009-08-07 Thread AD7six
On 7 ago, 11:15, albe wrote: > I have found a solution in this way: > > $post['Post']['haswarnings'] = count($this->Warning->query("SELECT  * > FROM `db`.`warnings` WHERE `post_id` ='".$post_id."'")); > > Thank you, anyhow! > For that you'd use ->find('count', array('conditions' => $conditions

Re: knowledge base component

2009-08-07 Thread Fran Iglesias
The Cakebook? http://thechaw.com/cakebook El 07/08/2009, a las 11:12, leop escribió: > Does anyone know of a knowledge base / wiki application built with > Cake? --- Fran Iglesias http://cakephpilia.blogspot.com --~--~-~--~~~---~--~~ You received this message

Re: knowledge base component

2009-08-07 Thread leop
Yep, my mistake. what I meant when I asked was... Does anyone know of a knowledge base / wiki application built with Cake? On Aug 6, 12:00 am, Miles J wrote: > What your asking for seems more like a full blown plugin, not a > component. > > I for one havent heard of anything like your asking. --

Re: How to obtain a number from a query that provides a COUNT

2009-08-07 Thread albe
I have found a solution in this way: $post['Post']['haswarnings'] = count($this->Warning->query("SELECT * FROM `db`.`warnings` WHERE `post_id` ='".$post_id."'")); Thank you, anyhow! On 7 Ago, 01:32, albe wrote: > Hi everybody! > maybe my problem is banal but I really don't know how to solve i

Re: If submitted file size is bigger than post_max_size value, no validation takes place

2009-08-07 Thread OmarC
Thanks for the reply Vijay. The problem is, when the form with the large file is submitted, the code in the controller is not executed. This only happens when the file is larger than the post_max_size, if the file is equal or smaller than the post_max_size, I can handle the data pretty well. Tha

Re: How to obtain a number from a query that provides a COUNT

2009-08-07 Thread Miles J
return $result[0][0]; Thats the only way to fix what your doing, thats how cakes built. --~--~-~--~~~---~--~~ 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

Re: How to obtain a number from a query that provides a COUNT

2009-08-07 Thread albe
The matter is a view of a forum site that has to show an alert for every post that has been warned by one or more user. I have a "posts" table and a "warnings" table. The warning table contains (*user_id,*post_id,reason) When the view shows all the posts of a discussion I want them to have an aler

Re: Notice (8): Undefined variable: title [APP/views/titles/view.ctp, line 6]

2009-08-07 Thread jburns
Thanks everyone. I have deduced that it is to do with $title being some sort of reserved word in CakePHP. If I change the table name to (e.g.) salutations and recreate the M/V/Cs it works fine. The reason that only the 'view' view failed is that is references $title, while the other views referenc

Re: Notice (8): Undefined variable: title [APP/views/titles/view.ctp, line 6]

2009-08-07 Thread bram
$title is a special variabe and it is used to set the page title. This took me a long time to figure out. Also, if you set variables with underscored, they don't end up in your views (they are available in camelCased format). I hope that this will change soon! On Aug 6, 6:22 pm, jburns wrote: >

Re: Disabling cache for po files

2009-08-07 Thread pespinos...@gmail.com
Thanks euromark, You are right. The problem wasn't the cache. Te problem was that I was editing the po files directily with netBeans, my editor and when you save from the editor, the changes don't save. I had to make it from the poEdit. Now everything is working fine. On 6 ago, 23:07, "euromark (

Re: How to obtain a number from a query that provides a COUNT

2009-08-07 Thread mike karthauser
Can you just use find('count',$params)? Mike Karthauser Brightstorm limited Tel: 07939252144 On 7 Aug 2009, at 00:32, albe wrote: > > Hi everybody! > maybe my problem is banal but I really don't know how to solve it: > > I wrote a query in a controller and put the result in a variable, in > th