Page 387 of 211,272, showing 20 records out of 4,225,435 total, starting on record 7,721, ending on 7,740
# | Username | Text | |
---|---|---|---|
# | Aug 9th 2008, 18:04 | jaredhoyt | TommyO: right, his problem is... if you do $this->User = ClassRegistry::init('User'); in Component::startup() and call the method that uses $this->User in AppController::beforeFilter ... the User model isn't loaded |
# | Aug 9th 2008, 18:04 | jaredhoyt | if you do it in a normal controller's beforeFilter(), it is |
# | Aug 9th 2008, 18:04 | jezek | mm |
# | Aug 9th 2008, 18:04 | jaredhoyt | well actually i take that back |
# | Aug 9th 2008, 18:04 | jaredhoyt | i haven't tried calling the method from a normal controller's beforeFilter... just a controller's method |
# | Aug 9th 2008, 18:05 | TommyO | don't assign it to a class value like that as it will interfere with the controller's expectation of that member |
# | Aug 9th 2008, 18:05 | TommyO | $User = instead of $this->User = |
# | Aug 9th 2008, 18:05 | jaredhoyt | TommyO: he's wanting to be able to use it class-wide though w/o having to instantiate it everytime |
# | Aug 9th 2008, 18:05 | TommyO | and use it right away |
# | Aug 9th 2008, 18:05 | TommyO | that is dangerous |
# | Aug 9th 2008, 18:05 | TommyO | why? what's the purpose? |
# | Aug 9th 2008, 18:06 | jaredhoyt | components don't normal hold models, so i didn't see the harm :) |
# | Aug 9th 2008, 18:06 | TommyO | sounds like a design flaw |
# | Aug 9th 2008, 18:06 | jaredhoyt | dunno, he's wanting to use a model in a component |
# | Aug 9th 2008, 18:06 | jaredhoyt | it's warned against in the manual, but shows you how |
# | Aug 9th 2008, 18:06 | TommyO | this is in a component or beforeFilter? |
# | Aug 9th 2008, 18:06 | jaredhoyt | in a component, but the method in the component that uses the model is called from AppController's beforeFilter |
# | Aug 9th 2008, 18:07 | jezek | i want to be able to protect my admin area |
# | Aug 9th 2008, 18:07 | jaredhoyt | jezek: is that all you're doing, there's probalby a simpler way than this =P |
# | Aug 9th 2008, 18:07 | jezek | well i have quite a few functions |