checking class variable if exists

2009-12-07 Thread mark_nsx
hey guys. i suppose this is just a question about PHP classes in general..i have a class called Store like so: class Store { public $id; public $name; public $url; public $email; function __construct($data) { } Check out the new CakePHP Questions site

Re: checking class variable if exists

2009-12-07 Thread mark_nsx
']))) { foreach ($data['Store'] as $key = $val) { if (isset($this-{$key})) { $this-{$key} = $val; } } } } } On Dec 8, 1:42 pm, mark_nsx djmar...@gmail.com

Re: checking class variable if exists

2009-12-07 Thread mark_nsx
VARIABLES as it parameters, but in this case, $foo-bar is NOT a VARIABLE. it is a VALUE returned from the __get() method of the class Foo. thus the isset ($foo-bar) expreesion will always equal 'false'. On Dec 8, 1:47 pm, mark_nsx djmar...@gmail.com wrote: Sorry, updating my post.. so im passing

Re: ambiguous routes

2009-07-16 Thread mark_nsx
Thank you very much Piotr! I'll give that a try tomorrow morning. Cheers! On Jul 16, 10:01 pm, Piotr Kilczuk kilc...@gmail.com wrote: Hello, I highly dislike working with routes, but there are few points where it can break. 1. What is the difference between the two rules you supplied? Any

ambiguous routes

2009-07-15 Thread mark_nsx
Hi there, The application im currently working on allows Users and Groups to select their unique personalized URLs i.e. www.site.com/my_own_url. I have specified the routes like so: $Route-connect('/:user_url', array('controller' = 'users', 'action' = 'view', 'url' = ':user_url'),

Invalidate without a model

2008-05-04 Thread mark_nsx
Hi all, Im working on a contact us/feedback form that doesn't have an underlying model. Basically what I'm trying to do is just to ensure that all the fields in the form aren't empty. In my class I have the function: class Report extends AppModel { var $name = 'Report'; } class

My simple form skips validation

2008-03-10 Thread mark_nsx
Hi there, Im new to cakePHP and only been playing around with it for a few days. I have made 2 simple tables just for me to have a feel of using cakePHP. table 1: (stores car makes) makes (id, make, created, modified) table 2: (stores car models, make_id foreign key) models (id, make_id,