This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
companion object { | |
lateinit var mAppComponent: AppComponent | |
} | |
override fun onCreate() { | |
super.onCreate() | |
mAppComponent = DaggerAppComponent | |
.builder() | |
.appModule(AppModule(this)) | |
.build() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PrefsUtil @Inject constructor(private val sharedPreferences: SharedPreferences) { | |
fun putBoolean(key: String, value: Boolean): Boolean { | |
val editor: SharedPreferences.Editor = sharedPreferences.edit() | |
editor.putBoolean(key, value) | |
return editor.commit() | |
} | |
fun getBoolean(key: String, defaultValue: Boolean): Boolean = | |
sharedPreferences.getBoolean(key, defaultValue) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule . index.php [L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use \Psr\Http\Message\ServerRequestInterface as Request; | |
use \Psr\Http\Message\ResponseInterface as Response; | |
//dengan adanya bagian ini qt dapat menggunakan library2 yang tersedia pada folder vendor | |
require __DIR__ . ('../vendor/autoload.php'); | |
//pada bagian ini kita membuat pengaturan dimana ketika | |
//ada kesalahan akan ditampilkan secara menyeluruh pada browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
|----------------------------------------------------- | |
| Register file app.php | |
|----------------------------------------------------- | |
*/ | |
require_once __DIR__ . '/bootstrap/app.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
|---------------------------------------------------- | |
| Register The Auto Loader | |
|---------------------------------------------------- | |
*/ | |
require __DIR__ . ('/../vendor/autoload.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
'settings' => [ | |
'displayErrorDetails' => true, | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
|---------------------------------------------------- | |
| Container | | |
|---------------------------------------------------- | |
*/ | |
$container = $app->getContainer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Controllers; | |
class Controller { | |
protected $container; | |
public function __construct($container) { | |
$this->container = $container; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Controllers; | |
class TestController extends Controller { | |
public function index($request, $response) { | |
$response->getBody()->write("Hello Slim With Controller"); | |
return $response; |