Welcome Guest, Not a member yet? Register   Sign In
global problem in helper
#1

[eluser]Gurkan OLUC[/eluser]
Hi,
I'm developing a web application and it requires to write my own helpers. So I create a new file named emlak_helper.php in system/helpers/ directory and write codes inside it. I have used global keyword to access variables that defined out of the function. But when I try to access variable after writing global $variable_name it returns nothing. Why it could be? Anyone have a idea?

helper file :

Code:
<?php

// Murat Arif ÇELİKER, [email protected]

// emlak helper dosyası
//

$durum_listesi = array('kiralik' => 'Kiralık', 'satilik' => 'Satılık');
$tip_listesi = array('daire' => 'Daire', 'villa' => 'Villa', 'dukkan' => 'Dükkan', 'buro' => 'Büro', 'mustakil' => 'Müstakil Ev',
                                                    'fabrika' => 'Fabrika', 'arsa' => 'Arsa', 'tarla' => 'Tarla', 'depo' => 'Depo', 'yazlik' => 'Yazlık',
                                                    'devremulk' => 'Devremülk', 'otel' => 'Otel', 'esyali' => 'Eşyalı Daire', 'devren' => 'Devren');
$doviz_listesi = array('ytl' => 'YTL', 'dolar' => '($) Amerikan Doları', 'euro' => '(E) Euro');
// durum listesini döndürür
//
function durum_liste($isim = 'durum', $secili = '')
{
    global $durum_listesi;
    
    print_r( $durum_listesi );
    
    // return (form_dropdown($isim, $durum_listesi, $secili));
}


Messages In This Thread
global problem in helper - by El Forum - 12-13-2007, 09:29 AM
global problem in helper - by El Forum - 12-13-2007, 02:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB