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 9116365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:39:19+00:00 2026-06-17T04:39:19+00:00

My class: class mvc { public function home () { return ‘index’; } }

  • 0

My class:

class mvc {
    public function home () {
        return 'index';
    }
}

object:

include "./sys/controller/".$Current_page_Controller_name.".php";

        // making object of the controller class.
            $controller = new $Current_page_Controller_name;

        // Cheks if model is called, m stands for "model"
            if (isset($_GET['m'])) {

            }

            $method_name = $mvc->$Current_page_Controller_name.'()';

    // Cheks if default model exists, if not gives an error.
        if (method_exists($controller, $method_name)) {
            echo "+";
        } else {
            echo "-";
            //die("Lappas sledzis saplisis, gaidiet drizuma... (2)");
        }

I keepgetting this error

Notice: Undefined property: mvc::$home in /home/unusuallv/domains/.../public_html/sys/config.php on line 51

the problem is near $method_name = $mvc->$Current_page_Controller_name.'()’; i know it, but i cant figure it out:// tnx a lot !

  • 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-06-17T04:39:21+00:00Added an answer on June 17, 2026 at 4:39 am

    In the following expression:

    
    $method_name = $mvc->$Current_page_Controller_name.'()';
    

    The -> operator has higher precedence than the string concatenation operator (.). This means that PHP evaluates the expression $mvc->$Current_page_Controller_name first, so it tries to access the home property of the mvc class (which does not exist).

    Use this instead:

    
    $method_name = $mvc->$Current_page_Controller_name();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a ASP.NET MVC controller like this [Authorize] public class ObjectController : Controller
earlier I use Spring MVC and annotation @ModelAttribute. @Controller public class ArticleController { @ModelAttribute(articles)
I use Spring MVC 3.0 and JSP. I have an object: public class ObjectWrapper
I need some help with asp.net mvc Controller: <HandleError()> _ Public Class HomeController Inherits
class for MVC to return fetch_array/object results class DbDriver{ private $connection; private $query; private
This is an example of using ThrowawayController in Spring MVC: public class DisplayCourseController implements
See the following Mock Test by using Spring/Spring-MVC public class OrderTest { // SimpleFormController
I have the following types and classes: namespace MVC.Models public class Page { public
ASP.NET MVC 2 will support validation based on DataAnnotation attributes like this: public class
In an ASP.NET MVC application where I have the following model.. public class EventViewModel

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.