0

I want to call function from other php file

Here is my code | but its not working for me,

Configuration file

 <?php class config { public static function get($param) { $config = array( // language selection, 'language' => 'english', // allow users to sign up (true/false) 'allow_signup' => true, ); /** * * End of configuration options * */ } } 

Other File I want to call a function in this file that If "allow-signup" is true it should show a button to signup

<?php require_once "configuration.php"; $app = new gator(); ?> <?php if (config::get('allow_signup')):?> <input class="nice radius secondary button" style="float:left;" type="Submit" value="Sign up"> <?php endif;?> ?> 
6
  • 2
    Take a look at How to Ask Commented May 4, 2017 at 1:58
  • What is the problem with question... Commented May 4, 2017 at 2:00
  • Please read the linked docs, they cover that stuff in detail. Commented May 4, 2017 at 2:00
  • In echo lang::get("Sign up"), what is lang? Commented May 4, 2017 at 2:02
  • lang removed. Still nothing Commented May 4, 2017 at 2:06

1 Answer 1

1

you're not returning a value in your get config

<?php class config { $config = array( 'language' => 'english', 'allow_signup' => true, ); public static function get($param) { return $config[$param]; } } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.