I set up all the basic setup for Codeigniter Framework.
My Code:
controllers/index.php:
include "file_name.php"; //In my case APPPATH . "controllers/user/user_data.php"
controllers/user/file_name.php: //In my case controllers/user/user_data.php
<?php
echo "Welcome";
class File_name
{
function index()
{
echo "this is index";
# code...
}
}
Output: What I getting:
welcome
What I need:
welcome this is index
My problem is I have file_path instead of file_name in include, so I am unable to create Object for the file.?