difference betwern require __DIR__ and __DIR__

474 views Asked by At

i a new yii developer and i do not understand one thing. In common/config/params.php file, i have following code:

<?php
return [
    'adminEmail' => '[email protected]',
    'supportEmail' => '[email protected]',
    'user.passwordResetTokenExpire' => 3600,
    'regions' => require __DIR__ . '/region.php',
];

what is the difference between 'regions' => require __DIR__ . '/region.php', and 'regions' => __DIR__ . '/region.php',

1

There are 1 answers

0
Stephan Yamilov On BEST ANSWER

In 'regions' => __DIR__ . '/region.php' regions will contain a string variable (path to region.php based on current dir)

In 'regions' => require __DIR__ . '/region.php' regions will contain an object of region.php class