Results: 1580
Notes
  • Newest first
  • Oldest first
  • Newest first(All)
  • Oldest first(All)
Large, medium and small button groups
<div class="btn-group btn-group-lg" role="group" aria-label="Basic example">
    <button type="button" class="btn btn-secondary">Left</button>
    <button type="button" class="btn btn-secondary">Middle</button>
    <button type="button" class="btn btn-secondary">Right</button>
</div>

<div class="btn-group" role="group" aria-label="Basic example">
    <button type="button" class="btn btn-secondary">Left</button>
    <button type="button" class="btn btn-secondary">Middle</button>
    <button type="button" class="btn btn-secondary">Right</button>
</div>

<div class="btn-group btn-group-sm" role="group" aria-label="Basic example">
    <button type="button" class="btn btn-secondary">Left</button>
    <button type="button" class="btn btn-secondary">Middle</button>
    <button type="button" class="btn btn-secondary">Right</button>
</div>
by Valeri Tandilashvili
4 years ago
0
Bootstrap
button group
Bootstrap official doc
1
const cloneObj = function(obj){ 
    // return JSON.parse(JSON.stringify(obj));  // "JSON"
    // return {...obj} // "Spread"
   // return Object.assign({}, obj);  // "Object.assign"
};
by Luka Tatarishvili
4 years ago
0
JavaScript
objects
1
Makes our code more modular and reusable
Makes our code easier to maintain
Makes it easier to debug when things go wrong
Makes it possible to hide / protect CLASS properties / methods (encapsulation)
Makes it possible to use other class properties / methods (inheritance)
Makes it possible to use polymorphism
by Valeri Tandilashvili
4 years ago
0
PHP
OOP
Object Oriented PHP Tutorial
1
Properties (attributes):
color
,
length
,
top speed
Methods (behavior):
start
,
stop
,
accelerate
signal
by Valeri Tandilashvili
4 years ago
0
PHP
OOP
Object Oriented PHP Tutorial
1
Returns the name of the class that is used to create the object passed to the
get_class
function
class User {
    public $username;
    public $friends;
    
    public function addFriend($friend_name) {
        $this->friends[] = $friend_name;
    }
}
$user1 = new User();
echo get_class($user1);
by Valeri Tandilashvili
4 years ago
0
PHP
OOP
Object Oriented PHP Tutorial
1
Returns an array with properties of the class
class User {
    public $username;
    public $friends;
    
    public function addFriend($friend_name) {
        $this->friends[] = $friend_name;
    }
}
$user1 = new User();
print_r( get_class_vars('User') );
by Valeri Tandilashvili
4 years ago
0
PHP
OOP
Object Oriented PHP Tutorial
1
Returns a list of methods of the class being passed to the function
class User {
    public $username = 'George';
    public $friends = ['Tom','David'];
    
    public function addFriend($friend_name) {
        $this->friends[] = $friend_name;
    }
}
$user1 = new User();

print_r( get_class_methods('User') );
by Valeri Tandilashvili
4 years ago
0
PHP
OOP
Object Oriented PHP Tutorial
1
Magic method
__construct
gets called when a new object of the class gets created
class User {
    public $username;
    public $friends = ['Tom','David'];

    function __construct($name) {
        $this->username = $name;
        // print "In BaseClass constructor\n";
    }
    
    public function addFriend($friend_name) {
        $this->friends[] = $friend_name;
    }
}
$user1 = new User('George');
echo $user1->username;
by Valeri Tandilashvili
4 years ago
0
PHP
OOP
Object Oriented PHP Tutorial
1
Magic method
__destruct
gets called when we delete an object manually. If we don't delete the object during the code execution, it will be called automatically at the end of the code execution
class User {
    public $username;
    public $friends = ['Tom','David'];

    function __construct($name) {
        $this->username = $name;
        print $this->username . "'s object is created'\n";
    }

    function __destruct() {
        print $this->username . "'s object is deleted'\n";
    }
}
$user1 = new User('George');
$user2 = new User('David');
echo $user1->username . "\n";
by Valeri Tandilashvili
4 years ago
0
PHP
OOP
Object Oriented PHP Tutorial
1
Assigning new object to a variable causes
__destruct
method to call and the old object gets deleted (the same result when we run
unset($old_object)
)
class User {
    public $username;
    public $friends = ['Tom','David'];

    function __construct($name) {
        $this->username = $name;
        print $this->username . "'s object is created'\n";
    }

    function __destruct() {
        print $this->username . "'s object is deleted'\n";
    }
}
$user1 = new User('Tom');
$user1 = new User('George');
unset($user1);
$user2 = new User('David');

echo "\n\n";
After executing the above code the result will be the following:
Tom's object is created'
George's object is created'
Tom's object is deleted'
George's object is deleted'
David's object is created'


David's object is deleted'
In this example when George's object gets created, Tom's object gets deleted immediately. The reason is that we no longer have Tom's object in
$user1
variable
by Valeri Tandilashvili
4 years ago
0
PHP
OOP
Object Oriented PHP Tutorial
1
Results: 1580