Re: A question about validation

2008-01-06 Thread citrus
Thanks a lot. I should have thought about the tempdocs ;) --~--~-~--~~~---~--~~ 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

A question about validation

2008-01-05 Thread citrus
I'm using CakePHP 1.2 beta. For example, I have an 'url' row in my table which can be empty. However, if $validate['url'] is set to array('url'), a blank value will not validate. Is this possible to have the data validate if and only if it is not blank? --~--~-~--~~~-

Re: Index Function

2007-09-03 Thread citrus
Try the tutorial in CakePHP manual and you'll know how to get started with Cake quickly. On Sep 4, 8:44 am, SpyderDriver <[EMAIL PROTECTED]> wrote: > Hello, I am new to Cake and I keep running into little catches that I > cant figure out. How do I create a default action for a controller? I > th

Re: 1.2 resources

2007-08-30 Thread citrus
Nice article. It's definitely a must read for me! I've just stumbled upon it while trying the Tag Surfer of WordPress.com before seeing your post here ;) On Aug 30, 3:48 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi folks! > > I have tried to compile an article about all the present re

Re: Display field ID (primary key) when scaffolding 'add' action

2007-08-29 Thread citrus
Normally, ID is the primary field and it's auto incremented. I can't see the point of displaying this field on the add form. In addition, scaffolding isn't meant to be customized extensively, thus in case you want to change the look and feel of it, as well as the way users interact with the it, c

Re: define('DEBUG', 0) problem

2007-08-23 Thread citrus
It might not be the reason. I always use relative path while referencing js, css, etc. The trouble seems to go away after I restarted my local Apache server, but I can't figure out why. On Aug 23, 3:33 pm, Alan Ford <[EMAIL PROTECTED]> wrote: > I've had a similar problem once, maybe that's it. >

Re: define('DEBUG', 0) problem

2007-08-23 Thread citrus
I also notice a problem with DEBUG = 0 today. When I turn off DEBUG, my pages (including home.ctp) renders with no layout. Just a simple message, telling me that "Sweet, [my app] is successfully baked with CakePHP" or so. Turning on DEBUG solves it immediately, the page comes back with the defau

Re: How to write codes in Vendor to save time?

2007-08-17 Thread citrus
vendor directory is used for third-party app that you want to integrate with your Cake app. in this case, you can use Cake's built-in function wrapper: pr(); which does the same thing as you want. check out basics.php for more stuff like that: a(), aa(), up(), etc. happy baking! On Aug 17, 11:

Re: Newbie: Is there a manual for Bake?

2007-08-16 Thread citrus
Have a look at these helpful articles: http://cakebaker.42dh.com/results?cx=001708348340724185334%3Ajyhafixs7hu&q=bake&sa=search+this+site&cof=FORID%3A9#936 On Aug 17, 9:52 am, Aaron Roberson <[EMAIL PROTECTED]> wrote: > Yes, I've looked the cheatsheet over. I am looking at it now in fact > but

Re: Trouble with the translate function "__()"

2007-08-16 Thread citrus
I have the same problem while trying to use __() in my validation message. --~--~-~--~~~---~--~~ 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 unsubsc

Re: CakePHP installed, but i only get text - no colors or fonts

2007-08-03 Thread citrus
Are you sure that mod_rewrite is enabled in your setup? On Aug 3, 8:52 pm, walterbyrd <[EMAIL PROTECTED]> wrote: > Trying to learn cake. I installed cake on my local debian system in / > var/www/cake. I have apache 1.3 installed. When I go tohttp://localhost/cake/, > I the intro page, but there i

Re: Form checkbox?

2007-07-29 Thread citrus
Have you enabled the Form Helper? $helpers = array('Html', 'Form', 'Session'); On Jul 30, 4:49 am, Mech7 <[EMAIL PROTECTED]> wrote: > I this allready in 1.2 i see in the > API..http://api.cakephp.org/1.2/class_form_helper.html#b8d997c3ed8911e37bf... > > But when i use it like: > > checkbox('Art

Re: controller name

2007-07-27 Thread citrus
I think your problem can be solved by editting inflections.php, which is located in app/config directory. To be more precisely, add niche - niches to your $irregularPlural array like this: $irregularPlural = array('niche' => 'niches'); It would work seamlessly then. --~--~-~--~~---

Re: Is it possible to use components in helper?

2007-07-26 Thread citrus
After having a quick chat with gwoo, I figured it out. Just add one line to my component: $this->controller->params['auth'] = $this; Then the component is available to use in the helper via $this- >params['auth']. Not sure it's the proper way or not, but at least it works. --~--~-~--

Is it possible to use components in helper?

2007-07-26 Thread citrus
Say, I have a component named Auth to check if the current logged in user is able to perform an action or not. Now I want to write a helper function that does the same as $html->link, but only printing the link after making sure that the user is able to perform the action. It'll be something like

Re: change view of scaffolding

2007-07-25 Thread citrus
Just use bake to generate your scaffolding view. On Jul 25, 9:23 pm, rtanz <[EMAIL PROTECTED]> wrote: > hi im still building my system using scaffolding, was wondering > whether i could change the fields that are displayed by scaffolding. > for example i would like to drop the display of the id f

Re: N/A option in select (dropdown) element

2007-07-24 Thread citrus
/** * Returns a formatted SELECT element. * * @param mixed $showEmpty If true, the empty select option is shown. If a string, * that string is displayed as the empty element. */ function select($fieldName, $options = array(), $selected = null,

Re: 1.1 or 1.2

2007-07-23 Thread citrus
Which Cake should you eat? http://cakebaker.42dh.com/2007/05/25/which-cake-should-you-eat/ This article, published at cakebaker, is worth reading. On Jul 24, 7:04 am, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > BUT REMEMBER IT HAS NO MANUAL OR DOCUMENTATION other > thenhttp://api.cakephp.org/

Re: webbaker functions

2007-07-23 Thread citrus
In the Screencase section of CakePHP site, there's a good tutorial telling you how to set up cake console properly. Hope it will help you. On Jul 23, 7:33 pm, rtanz <[EMAIL PROTECTED]> wrote: > im using latest version 1.16 seems to be a problem with webbaker then, > pity it was a useful utility.

Re: help: constant variables in the layout

2007-07-23 Thread citrus
I'm not sure, but why don't you try putting $category_list in your session variable? $this->Session->write('List', $category_list) would work fine. On Jul 23, 7:47 pm, eiji <[EMAIL PROTECTED]> wrote: > hi everyone, > > help. this is my first time to post here and i have just run out of > thought

Re: selectTag confusion

2007-07-22 Thread citrus
Also, remember that the usage of Model/field is deprecated in Cake 1.2 Use Model.field instead. --~--~-~--~~~---~--~~ 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@google

How to use Sanitize correctly?

2007-07-22 Thread citrus
I have a small question with Sanitize library, as I'm not really good at solving security problems that may arise in my application. As I've already know, Sanitize comes with lots of method: paranoid, escape, html, etc. But I wonder when to use which method, and I'm really confused with it. For

Re: FormHelper checkboxes

2007-07-22 Thread citrus
Just a small question, how can I use a Yes/No radio instead of the checkbox? I managed to use $this->radio('something', array(1 => 'Yes', 0 => 'No')) but I'm unable to get it automatically populated. If I change the order of options, that means $this->radio('something', array(0 => 'No', 1 => 'Yes

Re: Allowing Text Selections In Children Of Sortables

2007-07-22 Thread citrus
Is this what you want to achieve? handle V1.0(none) Makes the created Draggables use handles, see the handle option on Draggables. Go to http://wiki.script.aculo.us/scriptaculous/show/Sortable.create There're lots of options listed there. On Jul 23, 2:09 am, cake_n00b <[

Re: Sortable.create

2007-07-21 Thread citrus
Make sure you include both prototype and scriptaculous. Try this tutorial if you're confused: http://www.dustinweber.com/cakephp/cakephp-sortable-ajax-drag-drops-the-basics/ On Jul 21, 6:30 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Has anyone successfully used Sortable.create with ca

Re: Validation

2007-07-18 Thread citrus
I also use Cake 1.2.0.5427alpha. My password validation doesn't work, either. Even if I try the simplest rule ever: VALID_NOT_EMPTY. No error message is fired when I leave the password field blank. On Jul 18, 4:58 pm, pihentagy <[EMAIL PROTECTED]> wrote: > Hi! > > I've validation rules in my mod

Re: symfony

2007-07-16 Thread citrus
Well, before choosing Cake as my favourite framework, i've have a look at symfony, codeigniter and of course, cakephp. symfony seems to be great, but it's far more complex than cake. even its directory structure scared me. codeigniter's documentation is better than cakephp, and (it is said that)

Re: Security Best Practice

2007-07-15 Thread citrus
To deal with CSRF, I think we could use Cake's Security component - the requirePost function. On Jul 16, 2:52 am, keymaster <[EMAIL PROTECTED]> wrote: > Would be nice to get a quick cheatsheet together with two columns: > > column A: Security Risk > column B: Best Practise (using cake). > > I'll

Re: $form not recognized in 1.2 blog tutorial?

2007-07-12 Thread citrus
Open app_controller.php and add the following line: var $helpers = array('Html', 'Form', 'Session'); On Jul 12, 8:01 pm, sologroupmc <[EMAIL PROTECTED]> wrote: > I've got cake 1.2 installed and am trying the 15 min blog tutorial. > When I originally set up the add() in the post view, it barked a

Re: Unlimited Inserts

2007-07-11 Thread citrus
What about validation? How can I handle it? On Jul 11, 5:51 am, Geoff Ford <[EMAIL PROTECTED]> wrote: > If every filed (or at least one of them) in the repeating region is > required then you can simply make the arrays (name="fieldName[]") and > then loop over them in the back end with > > for ($

Re: Fatal error: Class 'Trace' not found

2007-07-07 Thread citrus
Use $this->Trace->save() instead. On Jul 7, 10:31 pm, M <[EMAIL PROTECTED]> wrote: > hello, > > I have this call in the model shop.php: > > var $uses = array ('User', 'Item', 'Trace' ); > ... > $trace = new Trace(); > $trace->save( $userdata['User']['id'], 'user bought a ' . > $i

Re: ACL

2007-07-07 Thread citrus
I'm not sure, but in my opinion, ACL in Cake 1.2 doesn't work properly. Correct me if I'm wrong. On Jul 7, 9:18 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On 7/7/07, sTb <[EMAIL PROTECTED]> wrote: > > > > > It seems that cake isnt inserting the stuff in the database. > > There are two grea

Re: Edit Functionality

2007-07-07 Thread citrus
To save a single field, use $this->User->saveField($name, $value, $validate) To save more than one field but not all, specify them in your $fieldList array: $this->User->save($data, $validate, $fieldList) Cake API is your best friend ;) http://api.cakephp.org/1.2/class_model.html#ba917bb43f3eef

Re: using Scaffold

2007-07-07 Thread citrus
As far as I know, scaffold isn't for customization. If you want to format the form to meet your need, go ahead and create your own view. On Jul 7, 3:41 pm, salahuddin66 <[EMAIL PROTECTED]> wrote: > hello there, > > I am new to cakephp still learning. > > Scaffold create Form from my database, it

Re: Validating data always fails, why?

2007-07-06 Thread citrus
if you want to do the validation manually, in CakePHP 1.2 use the following: if ($this->User->create($this->data) && $this->User->validates()) { // validation ok } else { // validation failed } otherwise, use $this->User->save($this->data) directly as Grant Cox pointed out. On Jul 7, 4:18 a

Re: Newbie Sessions ?

2007-07-05 Thread citrus
When you add values to the session, the old one will be overwritten (if exists) On Jul 6, 6:35 am, r557 <[EMAIL PROTECTED]> wrote: > Creating a Shopping Cart, and am wondering if when you add values to a > session, does it overwrite the current contents in the session? > > For example: > >

Re: 1.2 manaul

2007-07-05 Thread citrus
You can get an updated version of Cake 1.2 manual here: https://cakeforge.org/plugins/scmsvn/viewcvs.php/sandbox/1.2/?root=cakedocs It isn't complete, though. > + there will be a book coming out, but who knows when (it was expected this July) As far as I know, CakePHP Recipe will never be publ

Re: admin backend best practice

2007-07-04 Thread citrus
I also prefer approach #1. Actually I use it in all of my mini projects. To know exactly which actions a user is able to perform, I take advantages of SimpleAcl by Felix. Regards, On Jul 5, 3:09 am, danfreak <[EMAIL PROTECTED]> wrote: > Hey guys, > > I saw a couple of different approaches for b

Re: Shopping Cart

2007-07-04 Thread citrus
To write some data to the session, use $this->Session->write(name, data) To read from the session: $this->Session->read(name) To check if a variable exists in the session or not: $this->Session- >check(name) For more info, have a look at Cake's API. On Jul 5, 7:36 am, r557 <[EMAIL PROTECTED]> wr

Re: Redirect user after logging in

2007-07-01 Thread citrus
Never mind, I figured it out. On Jul 1, 3:03 pm, Grant Cox <[EMAIL PROTECTED]> wrote: > You want to use $this->redirect("/users/startpage"), not requestAction. If I use $this->redirect(), the whole view will be rendered. The following function (placed in app_controller.php) would work *nearly*

Re: Redirect user after logging in

2007-07-01 Thread citrus
I made a mistake in the above post. Actually the code is: $this->setAction('index'); $this->render('index', 'ajax'); Sorry for that On Jul 1, 11:04 am, citrus <[EMAIL PROTECTED]> wrote: > Hello, > > Currently I'm using Cake 1.2 and I

Redirect user after logging in

2007-06-30 Thread citrus
Hello, Currently I'm using Cake 1.2 and I have a small problem. Basically I want to redirect the user to his current page after he logged in. Here's my attempt so far: First, when the user click the Login link, I write $this->params['url'] ['url'] (the current URL, I suppose) to the session and

Re: difference between $this->data and $this->set('data')

2007-06-30 Thread citrus
$this->set('data', array()) will make $data available in your view. That means, you can write something like echo $data; in your view file. On the other hands, $this->data contains submitted data from your form. On Jul 1, 3:22 am, bingo <[EMAIL PROTECTED]> wrote: > hi, > > Can someone can tell m

Re: difference between $this->data and $this->set('data')

2007-06-30 Thread citrus
$this->set('data', array()) will make $data available in your view. That means, you can write something like echo $data; in your view file. On the other hand, $this->data contains submitted data from your form. On Jul 1, 3:22 am, bingo <[EMAIL PROTECTED]> wrote: > hi, > > Can someone can tell me