Re: include another model's view

2007-02-28 Thread AD7six
On Mar 1, 8:45 am, "AD7six" <[EMAIL PROTECTED]> wrote: > On Mar 1, 12:08 am, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > > > I've been programming in php for years, but I'm relatively new to > > cake. I must say I am amazed at the ease of use and intuïtivity of the > > framework! Mostly things

Re: include another model's view

2007-02-28 Thread AD7six
On Mar 1, 12:08 am, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > I've been programming in php for years, but I'm relatively new to > cake. I must say I am amazed at the ease of use and intuïtivity of the > framework! Mostly things just work the way you expect them to, which > makes it very easy to

RE: newbie: register user

2007-02-28 Thread Mariano Iglesias
That way the logic of how the password is hashed stays on the model side, as it should (the User model should take care of how data is saved, anyway) -MI --- Remember, smart coders answer ten questions for every question th

Re: findCount SQL errors

2007-02-28 Thread Christopher E. Franklin, Sr.
Well, I got it to work. For all those who will run into this problem in the future, this is what I gathered. When you are using HABTM, it is very tricky to make manual saving of data successful. After you do it once, it seems to make sense With my data variables set for my classifieds, all tha

Re: error: Call to a member function requestAction() on a non-object

2007-02-28 Thread phirschybar
ahh. Thanks for the info.. makes sense. On Feb 28, 8:49 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > requestAction is a method of Controller not Model > > try > > $this->requestAction(... > > seehttp://api.cakephp.org/class_object.html#c40a38b60a3748b9cf75215b92ee... > andhttp://manual.cakeph

Re: Help Using Date Range with findAll

2007-02-28 Thread BlenderStyle
I figured it out. I did this: $conditions[]['Post.created'] = '>= 2007-02-01'; $conditions[]['Post.created'] = '<= 2007-02-28'; $this->Post->find($conditions); It seems the complex conditions section in the model chapter in the CakePHP Manual was wrong. It seems as Cake continues, the manual just

Re: Help Using Date Range with findAll

2007-02-28 Thread BlenderStyle
I figured it out. I did this: $conditions[]['Post.created'] = '>= 2007-02-01'; $conditions[]['Post.created'] = '<= 2007-02-28'; $this->Post->find($conditions); It seems the complex conditions section in the model chapter in the CakePHP Manual was wrong. It seems as Cake continues, the manual just

Re: Switch Element On/Off

2007-02-28 Thread scragz
Includes with parts of layouts are elements. Other way is probably better though. On Feb 28, 1:49 pm, "phirschybar" <[EMAIL PROTECTED]> wrote: > scragz: that sounds silly unless there is a slick way of doing > 'includes' with parts of layouts. In your case I would be repeating a > lot of layout c

Re: error: Call to a member function requestAction() on a non-object

2007-02-28 Thread Samuel DeVore
requestAction is a method of Controller not Model try $this->requestAction(... see http://api.cakephp.org/class_object.html#c40a38b60a3748b9cf75215b92ee3db1 and http://manual.cakephp.org/chapter/controllers On 2/28/07, phirschybar <[EMAIL PROTECTED]> wrote: > > I am trying to make it so that s

error: Call to a member function requestAction() on a non-object

2007-02-28 Thread phirschybar
I am trying to make it so that some data to an element is present on EVERY page on my entire app. So, to do this I made an app_controller.php in /app and I have the following: class AppController extends Controller { function beforeFilter() { // grab all of the categories.

Re: Status of CakePHP 1.2.x.x

2007-02-28 Thread CraZyLeGs
http://en.wikipedia.org/wiki/Beta_version#Alpha On Feb 28, 1:52 am, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > don't you mean when it's done 'baking' ;) after all no one wants a > partially raw cake. Although licking the spoon (playing with the > early alphas) does have it's rewards... > > O

RE: Integrating phpGACL with CakePHP

2007-02-28 Thread Mariano Iglesias
Update: still working on this (component is already over 900 lines, including documentation, which is about 70% of the code). When the component runs for the first time it will set up PhpGacl database schema (so there's no need to do anything other than just include phpGacl on your vendors direc

Re: Help Using Date Range with findAll

2007-02-28 Thread BlenderStyle
It's worth noting that this isn't working either: $conditions['Post.id'] = array('>= 1', '<= 10'); $this->Post->findAll($conditions); I think I don't understand how Cake deals with these ranges. On Feb 28, 4:10 pm, "BlenderStyle" <[EMAIL PROTECTED]> wrote: > I'm trying to find all Posts within a

RE: newbie: register user

2007-02-28 Thread Mariano Iglesias
Or a more clean way would be to change it on the beforeSave() of the model. And then if you build queries to find the user using user / password, just set a findByUserAndPassword method on the model where you take the plain password as parameter, and hash it before doing the find. -MI --

include another model's view

2007-02-28 Thread gerbenzomp
I've been programming in php for years, but I'm relatively new to cake. I must say I am amazed at the ease of use and intuïtivity of the framework! Mostly things just work the way you expect them to, which makes it very easy to work with, and a great pleasure too! There's also a lot of good docum

Re: Problem with multiple INSERTS

2007-02-28 Thread codecowboy
How do you build an array of checkboxes? --~--~-~--~~~---~--~~ 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

Re: New Auth component asking for login on every page :(

2007-02-28 Thread joradom
you have to set up the Auth object with the allowed actions in your controller: i.e. in my users_controller function beforeFilter() { $this->Auth->userModel = 'User'; $this->Auth->sessionKey = 'My'; $this->Auth->loginRedirect = '/users/index';

Re: newbie: register user

2007-02-28 Thread Langdon Stevenson
Hi cbmeeks > Below is my function to register a new user. In the function, you > will notice that I attempt to sha256 the password to store in the > database. Works great. > > However, just before the data is saved, the password box gets the new > sha256-ed password. In other words, if there

Re: Problem with multiple INSERTS

2007-02-28 Thread codecowboy
Hi Dan, You might want to use the html helper. I believe that you should be using id="data..." as opposed to name="data..." but the helper will take care of that. I'm assuming that the relationship is a has_many. In which case you should check out the models chapter of the cake manual. See the

Re: Switch Element On/Off

2007-02-28 Thread phirschybar
scragz: that sounds silly unless there is a slick way of doing 'includes' with parts of layouts. In your case I would be repeating a lot of layout code. GreyCells: thats exactly what I ended up doing. In my controller, I set a boolean and then just did a simple check for it in the view before ren

Re: Include Js file in layouts

2007-02-28 Thread GreyCells
Hi CraZyLeGs The HeadHelper /functionality/ is now in the core - not the code itself. Put: $javascript->link(array('jquery.js', app.js), false); in your view.ctp and e($scripts_for_layout); in the head section of your layout.ctp and you get the same functionality as HeadHelper. (Note the second

Re: newbie: register user

2007-02-28 Thread [EMAIL PROTECTED]
I haven't tried this, but it should work. Change your code to else { $this->data['User']['password'] = $pass; $this->Session-setFlash('Please correct errors below.'); } or its typical to empty out any password fields on errors, but that's up to you. Scott I think you can change if($th

Re: show page from tree with a for loop

2007-02-28 Thread Oneill
Is it difficult? I have a link for the threadedlists I use to put my menu together... http://bakery.cakephp.org/articles/view/63 On 28 feb, 15:36, "Oneill" <[EMAIL PROTECTED]> wrote: > Hi guys, > > I am busy with my nodes controller... I forwarded each routing to > nodes_controller -> show. > Now

Re: Please help me understand URL and Routes in Cake

2007-02-28 Thread John
> So, I'd like to have the following URLs > /units- for a view showing a table of multiple units > /units/- for a view of the single unit (no, I don't > want to use the action in the URL like /units/view/, I'd > like to keep this one as short and simple as possible) I wanted to do someth

Problem with multiple INSERTS

2007-02-28 Thread [EMAIL PROTECTED]
i want to post a array with multiples IDs, at an relationchip table. All this id are generated by a list of checkboxes. design architecture videos and my save function = $t = new customs; $t->save($this->data['customs']); do you have any idea ? --- Dan --~--~-~--~~

Re: Switch Element On/Off

2007-02-28 Thread scragz
Make multiple layouts and switch between them in the controller, $this- >layout = 'no_thingy'; On Feb 28, 11:44 am, "phirschybar" <[EMAIL PROTECTED]> wrote: > Hey all.. > > What if I have an element and I want to switch it on for some pages > and off for others? > > I could easily pass it some da

Switch Element On/Off

2007-02-28 Thread phirschybar
Hey all.. What if I have an element and I want to switch it on for some pages and off for others? I could easily pass it some data and do the logic to determine if it should be shown right within the element itself or even in the default layout but then I would have business logic right in the v

Re: findNeighbours does not seem to be working

2007-02-28 Thread Xandornot
I even tried putting this in the model with all parameters as static values, still it does not respond with any values for prev and next. Does anyone have any ways to get this to work? On Feb 26, 9:32 am, "Xandornot" <[EMAIL PROTECTED]> wrote: > Hi, has anyone successfully used findNeighbours? I

Re: Form validation + Ajax ?

2007-02-28 Thread bernardo
google cache? http://www.google.com/search?q=cache:wiki.cakephp.org/faq:how_do_i_validate_a_form_with_ajax?s=ajax%2Bupdate On Feb 27, 8:55 am, "Mech7" <[EMAIL PROTECTED]> wrote: > Does anybody know how i can reach the wiki? I found this link thru > google but i can't acces it :( > > http://cakeb

Re: Form validation + Ajax ?

2007-02-28 Thread mindcharger
AFAIK the wiki is off... Try: http://bakery.cakephp.org/ Good luck! On Feb 27, 11:55 am, "Mech7" <[EMAIL PROTECTED]> wrote: > Does anybody know how i can reach the wiki? I found this link thru > google but i can't acces it :( > > http://cakebaker.42dh.com/2005/12/31/form-validation-with-ajax/

Re: Missing Model error message on production server, but OK on localhost (development)

2007-02-28 Thread djiize
When you move your app from a place to another, don't forget to empty the /app/tmp subfolders (cache models, persistent) On 28 fév, 16:27, "Robson" <[EMAIL PROTECTED]> wrote: > i keep getting message on my production server, but it works ok on > developemnt > > Missing Model > > No class found fo

Re: changing ACL tablenames

2007-02-28 Thread Norman normal
you would have to search+replace in the code (it should not be much work though), it seems the tables names are hardcoded On Feb 28, 10:31 am, "symfony" <[EMAIL PROTECTED]> wrote: > Are there any possbilities for changing the tablenames of the acl > needed databasetables (aros, acos and so on) an

Re: findCount SQL errors

2007-02-28 Thread Christopher E. Franklin, Sr.
Ok, as it turns out, the array that AD7six suggested did not work for me personally with or without addslashes(), magic quotes on or off or any variation therein. That is not to say that it doesn't work, it just did not make a correct comparison for my purposes. On the other hand, bernardo, your

Re: baking the scaffolding

2007-02-28 Thread hydra12
I'm not sure where the documentation is, but here's how I do it: I added php.exe to my path in windows. That makes things a lot easier. My setup is like this: my webroot is in c:\web\projects. Cake is inside projects. I put my apps in my projects directory, too, not in cake. >From the command

Re: Question about pagination

2007-02-28 Thread nate
$object is used in cases where a controller uses more than one model, and you wish to paginate a model other than the default. "Allowed parameters" are pagination parameters which a user is allowed to pass in the URL. For any further questions about new 1.2 features, please see here: http://grou

Re: ajax editor and view

2007-02-28 Thread bernardo
Make sure the spaces are not in your source files (before or after the php tags) as these spaces will be added to the ajax response. On Feb 28, 10:13 am, "dhalsim" <[EMAIL PROTECTED]> wrote: > Hi, > > I've put an ajax editor in my view and the problem I have is when I > edit my field for the seco

Re: Please help me understand URL and Routes in Cake

2007-02-28 Thread Chris Lamb
> I understand that Cake does [routing] this in two phases, one > using apache mod rewrite to pass the rest of the path to cake and the > second one by "Routes" to further route the URL in cake internally. Is > this correct? Yes. > I assume that the major purpose of the Routes is to map URLs to

Missing Model error message on production server, but OK on localhost (development)

2007-02-28 Thread Robson
i keep getting message on my production server, but it works ok on developemnt Missing Model No class found for the Image model Notice: If you want to customize this error message, create app/views/ errors/missing_model.thtml. Fatal: Create the class below in file : app/models/image.php Im

newbie: register user

2007-02-28 Thread cbmeeks
Below is my function to register a new user. In the function, you will notice that I attempt to sha256 the password to store in the database. Works great. However, just before the data is saved, the password box gets the new sha256-ed password. In other words, if there is an error saving, you

Re: multi-page forms

2007-02-28 Thread lukemack
cool thanks, Chris. Toby - the formwizard seems to break validation. did you use it with validation? On 27 Feb, 15:04, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On 2/23/07,lukemack<[EMAIL PROTECTED]> wrote: > > > > > Chris - can you elaborate on the problem with the back button? I > > assume

Re: security - verify POST via submit button

2007-02-28 Thread Chris Lamb
> how can i make sure that user data have been submitted via > pressing a submit button instead of sending spagetti code > appended to the controller url ? Check out the Security Component page in the manual. [0] Kind wishes, -- Chris Lamb, Leamington Spa, UKGPG: 0x63

security - verify POST via submit button

2007-02-28 Thread jyrgen
Hi all, how can i make sure that user data have been submitted via pressing a submit button instead of sending spagetti code appended to the controller url ? I assume it is not sufficient to test for a submit value or hidden field. thank you ! jyrgen --~--~-~--~~~

ajax editor and view

2007-02-28 Thread dhalsim
Hi, I've put an ajax editor in my view and the problem I have is when I edit my field for the second or more time, the value in the text field is prefixed with sereval tabulation (I don't see directly the value in the input). I don't understand where they come from. this is a piece of my view :

Re: User Authentication

2007-02-28 Thread Digital Spaghetti
In Cake 1.2.x.x there is a new Auth component, however it may still be buggy and I've had issues with it already, but keep an eye on it as it should integrate with ACL (or so I have been told). -- Tane Piper Personal: http://digitalspaghetti.me.uk Work: http://nohalfmeasures.com This email

show page from tree with a for loop

2007-02-28 Thread Oneill
Hi guys, I am busy with my nodes controller... I forwarded each routing to nodes_controller -> show. Now I have my nodes table structure with a id, name, parent_id and url. The url is just the name which it should be accessible in the browser. Like about_us. Now you can see the parent_id is for

Re: variable number of items in one table

2007-02-28 Thread mike
Found this answer and seems to work. $sum = 0; foreach($result as $row) { $sum += $row['price']; } Thanks Mariano On Feb 28, 1:39 pm, "mike" <[EMAIL PROTECTED]> wrote: > Thanks very much fo the reply. > > I currently have the simple code below printing out of the values in > Orderlin

baking the scaffolding

2007-02-28 Thread xhenxhe
It seems when I first a cake quite a few months ago I remember reading on how to "bake" - which basically turns the scaffolding into editable code. Where do I find documentation on how to do this (in windows)? --~--~-~--~~~---~--~~ You received this message becaus

Re: variable number of items in one table

2007-02-28 Thread mike
Thanks very much fo the reply. I currently have the simple code below printing out of the values in Orderlines. foreach ($item as $index=>$row) { $price = $row['price']; $qty = $row['qty']; $total = $price*$qty; echo $price; echo $qty; echo $total; } What I'd like to do next is add all $tot

changing ACL tablenames

2007-02-28 Thread symfony
Are there any possbilities for changing the tablenames of the acl needed databasetables (aros, acos and so on) and of cause working with them correctly? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" gro

Re: User Authentication

2007-02-28 Thread xhenxhe
great, thanks! On Feb 28, 5:55 am, "Hubbo" <[EMAIL PROTECTED]> wrote: > Hi Dustin. > > I've just begun using dAuth 0.3http://bakery.cakephp.org/articles/view/152 > for a project and it seem to work really well and is easy to > configure. Read the dAuth articles and read up on "Simple User > Authe

Re: User Authentication

2007-02-28 Thread Hubbo
Hi Dustin. I've just begun using dAuth 0.3 http://bakery.cakephp.org/articles/view/152 for a project and it seem to work really well and is easy to configure. Read the dAuth articles and read up on "Simple User Authentication" and "Access Control Lists" in the Cake manual and you should be good t

User Authentication

2007-02-28 Thread xhenxhe
I'm completely new to this so please excuse my ignorance. I want to create a new site and start with user accounts, authentication, login form, logout, etc - all that you would expect from a user class. I would assume there are so many sites that have this that there is some sort of package I coul

Re: findAll with NOT LIKE

2007-02-28 Thread GreyCells
There is also the function model->escapeField() e.g.: $this->Article->escapeField('text')." NOT LIKE '%cheese%'" A very useful function for those awkward SQL conditions. ~GreyCells On Feb 28, 12:00 pm, "jyrgen" <[EMAIL PROTECTED]> wrote: > i found the solution right after a posted my question

Re: Integrating phpGACL with CakePHP

2007-02-28 Thread Digital Spaghetti
Hi Mariano, Absolutly - I've been looking for an ACL solution similar to this. I've had issues with CakePHP's own ACL system, and feel I do need more levels of control. Please keep me informed on your work and I'd be happy to do some testing. -- Tane Piper Personal: http://digitalspaghetti

Re: findAll with NOT LIKE

2007-02-28 Thread jyrgen
i found the solution right after a posted my question !! "and not" => array( array("Article.text" => "LIKE %cheese%"), ), thanks anyways :-) Jyrgen --~--~-~--~~~---~--~--

findAll with NOT LIKE

2007-02-28 Thread jyrgen
Hi all, i'm struggling with a complex find condition, containing several Arrays in this fashion: $conditions= Array( "Article.type" => "6", "and" => array( array("Arti

Re: findCount SQL errors

2007-02-28 Thread bernardo
On Feb 28, 7:50 am, "AD7six" <[EMAIL PROTECTED]> wrote: > On Feb 28, 10:15 am, "Christopher E. Franklin, Sr."<[EMAIL PROTECTED]> wrote: > > I will try that as well. I thought that's what the sanitize->sql() > > did > > . Maybe I am mistaken. > > If you use a string constraint, you are basicall

Re: findCount SQL errors

2007-02-28 Thread bernardo
On Feb 28, 6:15 am, "Christopher E. Franklin, Sr." <[EMAIL PROTECTED]> wrote: > I will try that as well. I thought that's what the sanitize->sql() > did If you look at the definitio of sanitize->sql(): function sql($string) { if (!ini_get('magic_quotes_gpc')) {

Re: findCount SQL errors

2007-02-28 Thread AD7six
On Feb 28, 10:15 am, "Christopher E. Franklin, Sr." <[EMAIL PROTECTED]> wrote: > I will try that as well. I thought that's what the sanitize->sql() > did > . Maybe I am mistaken. > If you use a string constraint, you are basically on your own from cake's perspective. If you use an array constr

Please help me understand URL and Routes in Cake

2007-02-28 Thread barduck
Hi, I am trying to understand how friendly URLs and "Routes" work in Cake and have few of questions that might be trivial but I can't seem to find an answer in the documentation. I am familiar with url rewriting from other platforms where I used a similar functionality of mod rewrite to map log

Re: Integrating phpGACL with CakePHP

2007-02-28 Thread Langdon Stevenson
Interesting project Mariano. I think it is probably over kill for my needs personally, but hope it works out. It will become one more reason for Cake to be your framework of choice :-) Langdon Mariano Iglesias wrote: > My fellow bakers, > > As I found myself in the need of having a highly

Re: findCount SQL errors

2007-02-28 Thread Christopher E. Franklin, Sr.
I will try that as well. I thought that's what the sanitize->sql() did . Maybe I am mistaken. On Feb 27, 6:22 pm, "bernardo" <[EMAIL PROTECTED]> wrote: > You don't need to escape html characters. In fact doing that will give > you incorrect results because the escaped string will never match. >

Re: Drake :: Drupal-CakePHP 1.0.1b Released

2007-02-28 Thread kiang
One more bug. The sorting function for each column wasn't work. The url became: http://localhost/drupal/drake?run=/modules/index?sor[0]=-2&sr=0 --- Finjon Kiang --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake

Integrating phpGACL with CakePHP

2007-02-28 Thread Mariano Iglesias
My fellow bakers, As I found myself in the need of having a highly customizable ACL system for a CakePHP application I'm developing, I'm going ahead with something some people asked in the past if it could be available. The issues with this application that prevented me from using CakePHP's buil