productOptions = $this->fetchOptions(); $this->set('productOptions', $this->productOptions); } function __validateLoginStatus() { if ( $this->action != 'login' ) { echo '1'; if( $this->Session->check('User') ) { $this->redirect('/users/login'); $this->Session->setFlash('The URL you\'ve followed requires you login.'); } } } function fetchOptions() { $result = $this->setting->findall(); foreach ( $result as $key => $value ) { $value = $value['setting']; $settings[$value['option']] = $value['value']; } if ( !isset($settings) ) { return False; } return $settings; } ?>