access from helper |
[eluser]ranjitbd[/eluser]
[code] //ok i already add two files in my helper folder that is needed_variable_helper.php and //common_function_helper.php //and change the autoload.php in config $autoload['helper'] = array('url', 'file', 'form', 'html', 'text','needed_variable','common_function'); // needed_variable_helper.php file <?php $day_array = array() $day_array[0] = "Monday"; $day_array[1] = "Tuesday"; $day_array[2] = "Wednesday"; $day_array[3] = "Thursday"; $day_array[4] = "Friday"; $day_array[5] = "Saturday"; $day_array[6] = "Sunday"; $day_array[7] = "Daily"; ?> Q1. now i want to use $day_array from that needed_variable file to my views/index page then what will be the code in the index.php Q2. if i want to use $day_array in a method name get_day() from that needed_variable file to my controllers/flight.php then what will be the access code in the get_day() method [code]
[eluser]überfuzz[/eluser]
First of all, theres good functions handling dates, day, months etc in the core functions of php. Look it up in www.php.net/date and start from there. Next question, where do you put things that aren't covered by core functions? Do you have a MY_controller? You could fetch the all-out-system-info with it. |
Welcome Guest, Not a member yet? Register Sign In |