Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7417743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:45:24+00:00 2026-05-29T07:45:24+00:00

page.php (Example Controller Page) opened as http://page/view/ class page extends fwcontroller { public function

  • 0

page.php (Example Controller Page) opened as http://page/view/

class page extends fwcontroller
{
    public function __construct()
    {
        parent::__construct();

    }

    public function view()
    {       
        $this->load->library("uri");  #DOESN'T WORK
        var_dump($this->load->library("uri"));  #DOESN'T WORK
    }
}   

fwcontroller.php (Controller Hook, (it’s on /fw/fwcontroller.php), I wan’t move on another folder!)

class fwcontroller extends core
{
    public $load;

    public function __construct()
    {
        $this->load = new loader;

        var_dump($this->load->library("uri")); #OK

    }
}

loader.php (Loader library, (it’s on /fw/loader.php), I wan’t move on another folder!)

class function loader
{
    public function library($url)
    {
        return $url;
    }
}

I wan’t loading instance on page controller via $this->load->library("uri") and return it’s “ok”. But works if I instance like “$this->loader = new loader” but only on a page.php not on fwcontroller.php

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:45:25+00:00Added an answer on May 29, 2026 at 7:45 am

    First: Please enable error reporting. Your syntax is way off.

    public function page extends fwcontroller
    

    Should be:

    class page extends fwcontroller
    

    And

    public fwcontroller extends core
    

    Should be:

    class fwcontroller extends core
    

    And

    public function loader
    

    Should be:

    class loader
    

    Another thing, it is better to do:

    public function __construct(loader $loader) // or even better create a interface
    {
        $this->load = $loader; // dependency injection is always better for among other thing testability
    
        var_dump($this->load->library("uri")); #OK
    
    }
    

    EDIT

    How do you create an instance of the page class?

    My guess is you do something like: $instance = new page; instead of doing: $instance = new page();. Because it just works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a PHP Model-View-Controller framework that maps an address like http://example.com/admin/posts/edit/5
When I use CakePHP Paging I get an url like this: http://example.com/php/page:2 What do
I have a controller for example: class Users extends CI_Controller { function index() {
Below is my example script: <li><a <?php if ($_GET['page']=='photos' && $_GET['view']!==projects||!==forsale) { echo (href=\#\
I have a site with URLs like this: http://domain.co.uk/subdir/page.php I have redesigned the site
How do PHP programs pass values between model, view, and controller pages? For example,
I have the following in a .htaccess file redirect 301 /page.php http://domain.com/page Which works
RewriteEngine on RewriteRule ^page/?$ page.php [L] This ends up matching the url www.site.com/page// but
this is a General Question about MVC .. I wrote a PHP Class that
Can I put this in my HTML <head> ? <link rel=stylesheet href=http://site.com/some/php/script/userid/style.php /> Basically,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.