Hejsa.
Jeg er ved at skrive lidt på nogle funktioner i mit system.
Jeg undre mig over at jeg skal skrive den så mange gange, jeg kan bare ikke lige finde en måde hvorpå jeg kan gøre det langt nemmere.
- <?php
-
- class Personal extends Admin_Controller{
- public function __construct(){
- parent::__construct();
- }
-
- public function index(){
-
- }
-
- public function bank(){
- $this->data['banks'] = $this->file_model->get_by(array('type' => config_item('file_type_bank'), 'uacc_id' => $this->flexi_auth->get_user_id()));
-
- render_view('Bank', 'personal/bank', $this->data['view'], TRUE);
- }
-
- public function save_bank(){}
-
- public function edit_bank(){}
-
- public function delete_bank(){}
-
- public function pension(){
- $this->data['pensions'] = $this->file_model->get_by(array('type' => config_item('file_type_pension'), 'uacc_id' => $this->flexi_auth->get_user_id()));
-
- render_view('Pension', 'personal/pension', $this->data['view'], TRUE);
- }
-
- public function save_pension(){}
-
- public function edit_pension(){}
-
- public function delete_pension(){}
-
- public function insurance(){
- $this->data['insurances'] = $this->file_model->get_by(array('type' => config_item('file_type_insurances'), 'uacc_id' => $this->flexi_auth->get_user_id()));
-
- render_view('Forsikring', 'personal/insurance', $this->data['view'], TRUE);
- }
-
- public function save_insurance(){}
-
- public function edit_insurance(){}
-
- public function delete_insurance(){}
-
- public function contracts(){
- $this->data['contracts'] = $this->file_model->get_by(array('type' => config_item('file_type_contracts'), 'uacc_id' => $this->flexi_auth->get_user_id()));
-
- render_view('Kontrakter', 'personal/contract', $this->data['view'], TRUE);
- }
-
- public function save_contracts(){}
-
- public function edit_contracts(){}
-
- public function delete_contracts(){}
-
- public function house(){
- $this->data['houses'] = $this->file_model->get_by(array('type' => config_item('file_type_house'), 'uacc_id' => $this->flexi_auth->get_user_id()));
-
- render_view('Bolig', 'personal/house', $this->data['view'], TRUE);
- }
-
- public function save_house(){}
-
- public function edit_house(){}
-
- public function delete_house(){}
-
- public function tax(){
- $this->data['taxes'] = $this->file_model->get_by(array('type' => config_item('file_type_tax'), 'uacc_id' => $this->flexi_auth->get_user_id()));
-
- render_view('Skat', 'personal/tax', $this->data['view'], TRUE);
- }
-
- public function save_tax(){}
-
- public function edit_tax(){}
-
- public function delete_tax(){}
-
- public function public_paper(){
- $this->data['public_papers'] = $this->file_model->get_by(array('type' => config_item('file_type_public'), 'uacc_id' => $this->flexi_auth->get_user_id()));
-
- render_view('Offentlige papirer', 'personal/public', $this->data['view'], TRUE);
- }
-
- public function save_bank(){}
-
- public function edit_bank(){}
-
- public function delete_bank(){}
-
- }
Kunne være jeg også kunne klare det med en enkelt view file istedet for 10, hvor de stortset gør det samme
Er der en der har en løsning eller en ide til en løsning?
Indlæg senest redigeret d. 10.01.2014 22:20 af Bruger #15663