skip to Main Content

Not sure if i'm using oop in javascript correctly

Im learning OOP and decided to create a project using it. I feel like I'm not sure if I'm using it correctly. const btnCalculate = document.getElementById('work'); const spanOne = document.querySelector('.first'); const spanTwo = document.querySelector('.second'); class PayDay{ constructor(hours, payRate){ this.hours =…

VIEW QUESTION

PHP Include All Functions in Directory Inside Class

Is there a possibility of including all functions within directory within a class. For example: class.php class all_functions{ foreach(glob(__DIR__.'/functions/*.php') as $file){include($file);} } functions/function1.php function hello(){ echo 'hello'; } functions/function2.php function goodbye(){ echo 'goodbye'; } Result would be a class all_functions()…

VIEW QUESTION

Javascript – A Dialog Controller

I have a dialog in my html with id="divMyDialog1". This is associated with a javascript class with a name MyDialog1. (These names are just for illustration only.) MyDialog1 = function(divStr){ this.divStr = divStr; ... } I have loads of these…

VIEW QUESTION
Back To Top
Search