Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [CI]nie włącza helpera
HaMtAr0
post
Post #1





Grupa: Zarejestrowani
Postów: 25
Pomógł: 0
Dołączył: 29.12.2006

Ostrzeżenie: (0%)
-----


Nie chcę żeby helper form był ładowany automatycznie, wolę go uruchamiać sam. Gdy go jednak umieściłem w funkcji __construct wyświetla się error:
Cytat
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Formularz::$load

Filename: controllers/formularz.php

Line Number: 10

Fatal error: Call to a member function helper() on a non-object in /home/adam/public_html/workspace/CodeIgniter/system/application/controllers/formularz.php on line 10

Kod
<?php
class Formularz extends Controller
{
    function Formularz()
    {
        parent::Controller();
    }
    function __construct()
    {
        $this->load->helper('form');
    }
    
    function index()
    {
        // załadowanie formularza
    
        $view_form = $this->load->view('form','', True);
        $this->load->view('metrohacker/index', array('galeria' =>$view_form));
    }
    function submit()
    {
        // załadowanie wynikowego formularza, przekazanie danych
        $view_submit = $this->load->view('wynik', array('czas' => $this->input->post('czas'), 'login' => $this->input->post('login'), 'password' => $this->input->post('password'), 'plec' => $this->input->post('plec'), 'zainteresowania' => $this->input->post('zainteresowania')), TRUE);
        $this->load->view('metrohacker/index', array('galeria' =>$view_submit));
    }
}
?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
grzesiek_g
post
Post #2





Grupa: Zarejestrowani
Postów: 249
Pomógł: 30
Dołączył: 18.07.2007

Ostrzeżenie: (0%)
-----


  1. <?php
  2. class Formularz extends Controller
  3. {
  4.  
  5. function __construct()
  6. {
  7. parent::__construct();
  8. $this->load->helper('form');
  9. }
  10. ?>


--------------------
Warsztat: Ubuntu 12.10, PHPStorm
http://vertoo.pl
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 01:36