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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:33:20+00:00 2026-06-07T20:33:20+00:00

I have an issue in PHP. In my php file, i created the following

  • 0

I have an issue in PHP.
In my php file, i created the following line:

$foo = $wke->template->notify()
                     ->type("ERROR")
                     ->errno("0x14")
                     ->msg("You are not logged.")
                     ->page("login.tpl");

In the end, I need my $foo variable will return this:

$foo->type = "ERROR" 
$foo->errno= "0x14" 
$foo->msg= "You are not logged." 
$foo->page= "login.tpl"

Please note that the $wke->template is where i need call the notify() element.

  • 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-07T20:33:22+00:00Added an answer on June 7, 2026 at 8:33 pm

    The way of calling function of class one by one just by “->” because the function returning the same object of the class. See the example below. You will get this

    class Wke {
    
        public $type;
        public $errno;
        public $msg;
        public $page;
    
        public $template = $this;
    
        public function notify(){
            return $this;
        }
    
        public function errorno($error){
            $this->errno = $error;
            return $this; // returning same object so you can call the another function in sequence by just ->
        }
        public function type($type){
            $this->type = $type;
            return $this;
        }
        public function msg($msg){
            $this->msg = $msg;
            return $this;
        }
        public function page($page){
            $this->page = $page;
            return $this;
        }
    }
    

    The whole magic is of return $this;

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

Sidebar

Related Questions

I have this common issue of 'new line' in php-csv which is making me
I'm just starting with Object Oriented PHP and I have the following issue: I
I'm new to doctrine. I created an bootstrap file like the following one: require_once(dirname(__FILE__)./../conf/general.php);
have a help file which i have created in Notepad++ with the following syntax
I have created a function within my themes functions.php file in order to persist
I am learning file handling in php. I have written the following code to
I have a study logout.php file which works fantastically, the issue I am faced
I am experiencing the following error with uploadify and uploadifive: PHP Warning: File upload
I have some issues with a PHP file that is not working properly. The
I have an issue with php where code works on on computer but wont

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.