For Blogs
class it would be on the class boundaries.
But you are extending
Controller
class also. So with $this
you can access all the public
& protected
members of Controller
class.
In the above code - $this->loadmodel('articlesmodel');
is accessing the method of Controller
class(if Controller
class is not extending any other class that contains the method).
Update
You cannot have expressions or function calls in the variable declarations.For the error do -
class Blogs extends Controller
{
public $articlesmodel;
function __construct()
{
$this->articlesmodel = $this->loadmodel('articlesmodel');
}
public function index()
{
if(!isset($_SESSION['user']['login_id'])){
header("location:".URL);
}
}
}