2013-03-19 6 views
1

나는 이것 같이 contoller가있다.codeigniter의 뷰에 데이터를 전달하는 방법은 무엇입니까?

$this->data['password'] = array(
    'name' => 'password', 
    'id' => 'password', 
    'type' => 'password' 
); 
$this->data['password_confirm'] = array(
    'name' => 'password_confirm', 
    'id' => 'password_confirm', 
    'type' => 'password' 
); 

이 데이터는 다음과 같이 필 철갑 상어 템플릿을 사용하여 뷰에 전달됩니다 : : 이제 때

Password: (if changing password)<br /> 
<?php echo form_input($password);?> 

Confirm Password: (if changing password)<br /> 
<?php echo form_input($password_confirm);?> 

:

$this->template 
     ->title("Edit your Profile") 
     ->set_theme('admin') 
     ->set_layout('dashboard') 
     ->set_partial('links','partials/links') 
     ->set_partial('header','partials/header') 
     ->set_partial('menu','partials/menu') 
     ->set_partial('footer','partials/footer') 
     ->build('auth/edit_user', $this->data); 

내보기 파일이이 여기에 나열보다 더 많은 배열을 가지고 페이지를 새로 고치면 입력란에 값이 표시되고 페이지 상단에도 오류 메시지가 표시됩니다.

Message: Object of class stdClass could not be converted to string 

아무도 나에게 뭐가 잘못 말할 수 있습니까 ?? codeingniter의 HMVC, 필의 철갑 상어 템플릿을 사용하여 PS 벤 에드 먼 즈 이온 인증 ....

+1

디버깅을 위해이 질문에서 허용되는 대답을 시도하십시오. http://stackoverflow.com/questions/9758185/object-of-class-stdclass-could-not-be-converted-to-string – Natrium

+0

상당히 도움이되었습니다. –

답변

0

나는 한 유사 뭔가이 문제를 해결하기 위해 다음

$this->data = (array) $this->data;

$this->template->build()

전에 배치
관련 문제