Welcome Guest, Not a member yet? Register   Sign In
Should the variable type for language keywords be static or const?
#1
Question 
(This post was last modified: 11-11-2024, 01:04 AM by kuzeyybora.)

Hello everyone,

I'm designing a multilingual project, and I created a folder named Constants with a file called LanguageKeys.php inside it. The structure looks like this:
PHP Code:
namespace App\Constants
class 
LanguageKeys 
  public const ALLOWED_LOCALS = ["tr""en""de"]; 
  public const SUCCESS 'RESPONSE_SUCCESSFULLY_MESSAGE'
  public const FAIL 'RESPONSE_UNSUCCESSFULLY_MESSAGE'
  public const CREATE_SUCCESS 'RESPONSE_CREATE_SUCCESSFULLY_MESSAGE'

Do you think these should stay as they are, or would it be better to make them
public static instead? These keys are saved to Redis from the database, and unless revalidation is done, the data is queried from Redis.
Do you have any suggestions or thoughts on this?
Reply


Messages In This Thread
Should the variable type for language keywords be static or const? - by kuzeyybora - 11-11-2024, 12:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB