# |
Aug 7th 2008, 14:21 |
lqdice__ |
used both contain and regular conditions |
# |
Aug 7th 2008, 14:20 |
lqdice__ |
TommyO: http://bin.cakephp.org/view/577899715 .. users have groups so this is what nodes the group has access to |
# |
Aug 7th 2008, 14:19 |
TommyO |
lqdice__: cool. the kind of conditions that containable might help with? |
# |
Aug 7th 2008, 14:12 |
lqdice__ |
TommyO: I got it .. the tree thing.. it's a bit of work but not tooo bad.. you do have to do custom conditions on left/right nodes |
# |
Aug 7th 2008, 14:10 |
TommyO |
iirc |
# |
Aug 7th 2008, 14:10 |
TommyO |
as far as views/layous are concerned, it used the app's where necessary |
# |
Aug 7th 2008, 14:09 |
TommyO |
mandys: sorry, I thought you were talking solely about unit testing |
# |
Aug 7th 2008, 14:09 |
TommyO |
oh I see. hmmm. |
# |
Aug 7th 2008, 14:08 |
mandys |
and it doesn't create the views directory under app/tests/ |
# |
Aug 7th 2008, 14:08 |
mandys |
not web testing |
# |
Aug 7th 2008, 14:08 |
mandys |
the caketest examples are all for unit testing |
# |
Aug 7th 2008, 14:08 |
mandys |
i just am confused whether to use caketest or cakewebtest for web page testing |
# |
Aug 7th 2008, 14:08 |
mandys |
i even wrote sample tests |
# |
Aug 7th 2008, 14:08 |
mandys |
and run tests |
# |
Aug 7th 2008, 14:08 |
mandys |
i can view /tests.php |
# |
Aug 7th 2008, 14:08 |
mandys |
i have setup everything |
# |
Aug 7th 2008, 14:08 |
mandys |
TommyO: i am passed that stage |
# |
Aug 7th 2008, 14:06 |
TommyO |
*let |
# |
Aug 7th 2008, 14:06 |
TommyO |
your app will have a url that will elt you run the core tests and your custom app tests |
# |
Aug 7th 2008, 14:05 |
TommyO |
mandys: then look into how the core tests are written to write tests for your own app |
# |
Aug 7th 2008, 14:04 |
TommyO |
mandys: bake an app skeleton and it will bake the proper test directory structure for you. bake a model and it bakes the model test file skeleton for you, etc |
# |
Aug 7th 2008, 13:58 |
mandys |
anyone on my question? |
# |
Aug 7th 2008, 13:57 |
ethanm |
is there a way to specify that? |
# |
Aug 7th 2008, 13:57 |
ethanm |
I am providing $form->input with an array of $options that are numerically indexed, but the form helper doesn't preserve the keys when it makes a select box |
# |
Aug 7th 2008, 13:56 |
mandys |
or should they be under controllers? |
# |
Aug 7th 2008, 13:45 |
darkangel |
Hi. If you are using a multi-select box for a HABTM, and therefore the field name is Category.Category, for example, where do you perform the validation? As a 'Category' validation rule in the Category model? |
# |
Aug 7th 2008, 13:44 |
jaredhoyt |
beatzombies: the easiest way to perform that in the controller is add if(empty($this->data)) { $this->data = load some data here ... } else { process submitted data } |
# |
Aug 7th 2008, 13:37 |
beatzombies |
jaredhoyt: wait, so when i reference ContributorsItem as in $form->checkbox('ContributorsItem.contributed'); what does cakephp look at to get that value? |
# |
Aug 7th 2008, 13:36 |
beatzombies |
jaredhoyt: thanks, ill definitely be back with more questions |
# |
Aug 7th 2008, 13:36 |
beatzombies |
jaredhoyt: alright, i see i need to think about this some more |
# |
Aug 7th 2008, 13:35 |
jaredhoyt |
you're view variables are lost ;) |
# |
Aug 7th 2008, 13:35 |
jaredhoyt |
beatzombies: when you hit submit, only form data is passed into the controller action |
# |
Aug 7th 2008, 13:35 |
beatzombies |
i see |
# |
Aug 7th 2008, 13:35 |
beatzombies |
jaredhoyt: so when i submit i wouldnt be able to just do a save() because the submitted data to the controller would not be model information |
# |
Aug 7th 2008, 13:35 |
jaredhoyt |
if you're setting db data into a view var, then you'd do something like <?php echo $form->checkbox('Model.fieldname', array('value' => $view_var['path_to_field']); ?> |
# |
Aug 7th 2008, 13:33 |
jaredhoyt |
beatzombies: well, save them as you would any other form data |
# |
Aug 7th 2008, 13:33 |
beatzombies |
jaredhoyt: and then manually set the values in the database when im updated those values? |
# |
Aug 7th 2008, 13:32 |
jaredhoyt |
beatzombies: then you're going to have to manually set the checkbox value |
# |
Aug 7th 2008, 13:32 |
beatzombies |
jaredhoyt: is that the wrong way to do things? |
# |
Aug 7th 2008, 13:32 |
jaredhoyt |
if you just want to display data in text form, then do $this->set('some_var', $this->Model->find()) |
# |
Aug 7th 2008, 13:32 |
beatzombies |
jaredhoyt: i am kind of making my own array of values from various models in my controller and setting that for my view to use |