R: Menu from database

2007-03-18 Thread GMail
I made a little test and I have put: pr($this->uses); exit(); in cake/libs/controller/controller.php __construct() function, before it exiting. What I discovered was that if you set $uses to null or an empty array() in your controller it overrides the declaration in app_controller, d

Introducing myself

2007-03-18 Thread jfricci
I am new to this group and would like to introduce myself. I am the President of US AngelInvestors,an angel investor group in Silicon Valley,and also founder of Bay Area Startup Network a networking group in the Bay Area. I invite you to join my network on LinkedIn, which I use much principally.

Re: saving sensitive data with md5

2007-03-18 Thread Daniel.S
Will that re-hash the MD5'ed password field when editing and then saving again? I do this at the moment: In model: function beforeSave() { $password = isset($this->data['User']['password'])?$this->data['User'] ['password']:""; if (!preg_match(VALID_MD5,$password) { $this->data['User']['pass

Re: is acl.php not working?

2007-03-18 Thread Jon M.
Having the same problem. Looked everything over don't know what the problem could be. - Jon On Mar 15, 3:24 pm, "rtconner" <[EMAIL PROTECTED]> wrote: > I cannot getacl.php to work in 1.2. I've tried the latest "stable" > build and the latest nightly build. Both give me the same error > -->ph

Re: saving sensitive data with md5

2007-03-18 Thread Daniel.S
No need to jump up and down proclaiming the original message poster to be incompetant while trumpeting CakePHP's virtues. Why don't you learn from Mariano and provide a solution. You've done it in a few message threads today, and it's not productive at all. On Mar 19, 5:30 am, "Walker Hamilton" <

Re: Menu from database

2007-03-18 Thread Walker Hamilton
Hmmmokay, so the default pages controller does: var $uses = null; Which makes me think that setting your demo app's controller to $uses=null causes no models to load in, which then means that when it tries to query the DB, it doesn't have any models instantiated that it can use to do so. So.

Re: newbie question, populate drop down box from other parent table

2007-03-18 Thread cc96ai
yes , i set it up already, in controller i added this variable $this->set('groupArray', $this->User->Group->generateList()); and the view selectTag( 'User/group_id', $groupArray, null, array(), array(), true ); ?> now works fine. one other qu

Re: newbie question, populate drop down box from other parent table

2007-03-18 Thread Joshua McFarren
In your User Model you need to have var $belongsTo = array ( 'Group' => array('className' => 'Group') ); Then in your View you could put selectTag('User/group_id', $groups, $html- >tagValue('User/group_id'), array(), array(), false);?> --~--~-~--~~~---~--~~ You

Re: R: Class dependence and overriding Methods to do garbage collection on files

2007-03-18 Thread Joshua McFarren
Thank you Steven and Marco! --~--~-~--~~~---~--~~ 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 PROTE

newbie question, populate drop down box from other parent table

2007-03-18 Thread cc96ai
I have 2 simple tables Groups [id, name] Users [id, name, group_id] when admin create a new user , he has to fill in the group I try to use selectTag() to build the Group drop down in User page, but I have no idea how could cake do that for me ? any snipper code / direction will help Thanks

Re: ODBC support

2007-03-18 Thread jon
I succeeded connecting cakephp with adodb: 'adodb', //use "adodb" 'connect' => 'odbc', //adodb support not only "odbc", but also "mysql", "ldap", etc) 'host' => 'mys

Re: Menu from database

2007-03-18 Thread Walker Hamilton
Okay! Now we're getting somewhere! What you want to do is always have a model for your controllers. The trick is to not have a db table for a model. So, instead of cutting the DB->Model->Controller->View chain at Controller, we're going to cut it at DB. create your model, and then put this i

Conditional Ajax div update?

2007-03-18 Thread jefffff
Hello, i'm trying to implement a login system using ajax, but i've come across a problem. I want to do it so that when a login is incorrect, then only a small div below the form is shown with "invalid login" but when the login is correct i want to update a different div with the user's account opt

Re: Menu from database

2007-03-18 Thread LSL
I'm really sorry that it seems I think CakePHP is wrong. I know that it is probably my fault that I can't use it the right way. As I have written in my first post - It's a great piece of SW. Now I'm a bit closer to the problem. It seems that the error is present only when I use controller without

RE: Unit Testing in 1.2

2007-03-18 Thread Mariano Iglesias
You can simplify the test a lot, just put it like (see the use of loadController() instead of all the junk I've just given you): uses('controller' . DS . 'controller'); loadController('Users'); class UsersControllerTest extends UnitTestCase { function testGetTitle() { $c

newbie. add inside a view

2007-03-18 Thread sixlaneve
sorry for this very newbie questions, but between bakery, here and google, still I haven't got an answer. let's take the blog tutorial in cakephp manual as example... when I look at one of the post, how can I add a field for adding comments, and how to display existing comments? Any examples? Tu

RE: Unit Testing in 1.2

2007-03-18 Thread Mariano Iglesias
1. Unzip simpletest at cake/vendors/simpletest (inside after installing you should see simple test files like unit_tester.php) 2. Set up your tests on app/tests inside the appropriate directory. As a guidance, you can set up your controller tests under app/tests/cases/controllers/. For example, l

RE: saving sensitive data with md5

2007-03-18 Thread Mariano Iglesias
Sure, use the beforeSave and beforeFind on the model side. class User extends AppModel { // ... function beforeSave() { if (isset($this->data[$this->name]['password'])) { $this->data[$this->name]['password'] = md5($this->data[$this->name]['

Re: ajax auto save?

2007-03-18 Thread RRose
There is a nice JQuery plugin that does this: http://daemach.blogspot.com/2007/03/autosave-jquery-plugin.html You can probably convert the code to prototype if that is your library of choice. HTH, Ryan Rose http://www.digiwize.com On Mar 18, 3:11 pm, "Uncle Bill" <[EMAIL PROTECTED]> wrote: > C

Re: Model::query() + Sanitize::sql() vs.DboMysql API

2007-03-18 Thread gwoo
You should only run the first when the second will not do what you want. That said probably 90% of whatever you have to do should use the second. Sanitize is not needed as data and fields are escaped properly at the dbo level. --~--~-~--~~~---~--~~ You received th

ajax auto save?

2007-03-18 Thread Uncle Bill
Can anyone point me to some sample code that will use ajax to autosave a form periodically? Thanks. --~--~-~--~~~---~--~~ 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@go

Re: Thank You for CakePHP

2007-03-18 Thread junal
yes! Thank you all CakePHP developers. On Mar 18, 9:34 pm, "tracyfloyd" <[EMAIL PROTECTED]> wrote: > Ditto. > The Cake team is creating some amazing software here. > > On Mar 18, 9:49 am, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > There's so much love put into the development of Cake, that any

Re: Unit Testing in 1.2

2007-03-18 Thread Walker Hamilton
Maybe try DH's testing suite for Cake 1.2 ? http://cakebaker.42dh.com/2006/12/18/testing-with-cakephp-12-a-preview/ he's got instructions. On Mar 18, 12:58 pm, "Dat Chu" <[EMAIL PROTECTED]> wrote: > Hi guys, > > Does anyone know how to go about running a unit test case / suite in > 1.2 . I

Re: saving sensitive data with md5

2007-03-18 Thread Walker Hamilton
This is not a cakePHP problem so much as a programming issue. If you learn how to hash md5's using php, you'll be able to do them in cake. On Mar 18, 12:12 pm, "billybob" <[EMAIL PROTECTED]> wrote: > Hi - > > I'm using cake's MVC approach which works really great. I like the > ability to use the

Re: Menu from database

2007-03-18 Thread Walker Hamilton
On Mar 18, 12:59 pm, "LSL" <[EMAIL PROTECTED]> wrote: > There is no solution? Please, CakePHP seems very cool but this is a > problem... > There is a solution, but you are not providing enough information for us to help you solve it. Dijize was correct in his instructions provided to you, but so

Re: Menu from database

2007-03-18 Thread LSL
There is no solution? Please, CakePHP seems very cool but this is a problem... L. LSL wrote: > Thanks, I have tried this but without success. The excerption from > app_controller.php: > > var $uses=array('MenuCategory'); > function beforeFilter() { > parent::beforeFilter(); > $th

Unit Testing in 1.2

2007-03-18 Thread Dat Chu
Hi guys, Does anyone know how to go about running a unit test case / suite in 1.2 . I can't seem to find the documentation anywhere about this. I have version 1.2 of cake now and have put some test code under /app/ tests/cases/controllers/my_controller.test.php How do I run it? Do I need to put

how to dynamically display form fields client side

2007-03-18 Thread keymaster
In a view file I have a 'select' dropdown. Depending on the user selection, I want to display a different set of additional fields ... without refreshing the page. How is this done ? (being a js/Ajax newbie, I don't know where to start) ? Not looking for a solution, just a quick pointer to get g

saving sensitive data with md5

2007-03-18 Thread billybob
Hi - I'm using cake's MVC approach which works really great. I like the ability to use the MVC and save from the controller; it makes things nice and is very easy. I did run into a problem which I can't figure out, however. Let's say I want to save sensitive information like a password in the

Model::query() + Sanitize::sql() vs.DboMysql API

2007-03-18 Thread Pento
Hello, everybody! So I have what advantages of using of Model::query() + Sanitize::sql() instead of using DboMysql API? When I must use the first and when the second? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

R: Overriding foreign key conventions

2007-03-18 Thread GMail
Yes you can For belongsTo: var $belongsTo = array( 'BelongClass' => array( 'classname' => 'BelongClass', 'foreignKey' => 'your_foreign_key_field_id' ) ); var $hasMany = array( 'HasManyClass' => array( 'className' => 'HasMan

Overriding foreign key conventions

2007-03-18 Thread korcs
Hi Bakers, i have a database table (table name: 'relations') which related to other tables via a foreign key (field name: related_table_id). I want, that whenever i fetch an entry from the table 'relation', the associated table entry will be fetched as well (like the posts and comments in the ma

Re: how to dynamically display form fields client side

2007-03-18 Thread Samuel DeVore
ajusx->observeField might be what you want. I use this to load form elements based on choices On 3/18/07, keymaster <[EMAIL PROTECTED]> wrote: > > In a view file I have a 'select' dropdown. > > Depending on the user selection, I want to display a different set of > additional fields ... without

Re: R: Format ID field throughout

2007-03-18 Thread Samuel DeVore
you could have the after find create a format_id field on the fly and then you would still have the id field for linking and other work. Then you can use the format_id for display and the id for the 'work' Sam D On 3/18/07, Mike Digital Egg <[EMAIL PROTECTED]> wrote: > > Thanks for the tip, I ha

Re: cakephp and developer rates

2007-03-18 Thread bernardo
Walker's analysis makes sense. In economic terms: If by using a framework you are able to produce the "same simple web app" in less time, you may say that you have increased your productivity and as a consequence you are able to reduce your costs and increase your profit. It has nothing to do with

Re: Ajax editor() and wysiwyg editor

2007-03-18 Thread Dat Chu
I don't thnk either of those support ajax editor at the time. You might want to write a plugin for them. However, TinyMCE is quite heavy since it does a lot of checking and processing (its capabilities is really broad too). You might want to go for a the lite version of TinyMCE and put it in your

Re: cakephp and developer rates

2007-03-18 Thread Walker Hamilton
I have always looked at it like this: You will pay more per hour for a good programmer (no matter the tools they are using). You will end up paying the same amount for a not-so-good programmer because they will take much longer to produce the same thing that the expensive (and hopefully, good) pro

Re: Thank You for CakePHP

2007-03-18 Thread tracyfloyd
Ditto. The Cake team is creating some amazing software here. On Mar 18, 9:49 am, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > There's so much love put into the development of Cake, that anyone who > uses it, cannot but love it! Thanks so much, Cake has been an eye- > opener and is such a pleasure

Re: R: Format ID field throughout

2007-03-18 Thread Mike Digital Egg
Thanks for the tip, I have tried that and it worked. However I have now run into a new problem which is that the code now breaks the links. For example: The URL to edit a project is now: /projects/edit/FWL0001 which doesn''t work. I guess I need to reverse the transformation on any database que

cakephp and developer rates

2007-03-18 Thread sixlaneve
might sounds like a stupid questions but... if cakephp is a rapid development framework (and it looks like), does it mean that developing a simple web app will cost less money? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

Re: Thank You for CakePHP

2007-03-18 Thread gerbenzomp
There's so much love put into the development of Cake, that anyone who uses it, cannot but love it! Thanks so much, Cake has been an eye- opener and is such a pleasure to work with! Gerben. On 18 mrt, 04:45, "phirschybar" <[EMAIL PROTECTED]> wrote: > true that. > > On Mar 17, 2:38 pm, "yolabing

Newbie to Cake - IIS5 problem

2007-03-18 Thread david
I seen loads of posts about the problems with IIS, but I didn't spot anything that relates exactly to my problem (so maybe it's not a cake problem - but IIS) - maybe there is an existing post - and I just don't know what to search for! (in which case I do apologise in advance) Basically, I can't

adressing css-files (for yui) outside the css folder

2007-03-18 Thread symfony
Hey, is it possible (with url-rewrite) to adress css-files outside the css- folder in webroot? I want to use yui and save it in /vendors/yui. But I cannot acces the css! I've tried it like this, but it didn't work :( $this->controler->webroot.$this->yui_folder . DS . $file . DS . $file . ".css"; C

Need some help with pagination in 1.2

2007-03-18 Thread barduck
Hi all, I need some help and advice with implementing pagination in 1.2 . I got the basic functionality working which means I have paginate() return the correct count of items of the first page and if change the URL to pass different page # and limit #, the page behaves as expected. What I am n