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
import app from './app'; | |
app.$store.commit('setUser', {user: window.user}) | |
app.$store.state.features = window.features | |
app.$mount('#app') |
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 | |
require_once __DIR__ . '/../vendor/autoload.php'; | |
use Spatie\Ssr\Renderer; | |
use Spatie\Ssr\Engines\Node; | |
$features = [ | |
['id' => 1, 'name' => 'NVMe SSD Super Cepat', 'description' => '100% Enterprise NVMe SSD untuk performa website secepat kilat'], | |
['id' => 2, 'name' => 'Cloud Backup', 'description' => 'Backup harian ke Cloud menjamin keamanan data penting anda'] | |
]; | |
$engine = new Node("/home/andika/.nvm/versions/node/v14.17.1/bin/node", __DIR__.'/../dist'); |
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
import renderVueComponentToString from "vue-server-renderer/basic"; | |
import app from "./app"; | |
app.$store.commit("setUser", { user: context.user }); | |
app.$store.state.features = context.features; | |
renderVueComponentToString(app, (err, html) => { | |
if (err) { | |
throw new Error(err); | |
} |
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
// js/store.js | |
import Vue from 'vue' | |
import Vuex from 'vuex' | |
Vue.use(Vuex) | |
export function createStore() { | |
return new Vuex.Store({ | |
state: { |
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
// js/app.js | |
import Vue from 'vue' | |
import App from '../components/App.vue' | |
import { createStore } from './store' | |
const store = createStore() | |
const app = new Vue({ | |
store, | |
render: h => h(App) |
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
// FeatureItem.vue | |
<template> | |
<div v-bind:style="{ color: textColor }" v-on:click="toggleColor"> | |
<h2>{{ feature.name }}</h2> | |
<p>{{ feature.description }}</p> | |
</div> | |
</template> | |
<script> |
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
// App.vue | |
<template> | |
<div id="app"> | |
<sidebar title="Mantap"></sidebar> | |
<h1>{{message}}</h1> | |
<p class="good">{{count}}</p> | |
<button v-on:click="increment">increment</button> | |
<p>{{user.name}}</p> | |
<feature-item v-for="feature in features" :key="feature.id" :feature="feature"></feature-item> |
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
SELECT | |
MAX(CASE WHEN (pref_name = 'smtp_host') THEN pref_value ELSE NULL END) AS smtp_host, | |
MAX(CASE WHEN (pref_name = 'smtp_port') THEN pref_value ELSE NULL END) AS smtp_port, | |
MAX(CASE WHEN (pref_name = 'smtp_user') THEN pref_value ELSE NULL END) AS smtp_user, | |
MAX(CASE WHEN (pref_name = 'smtp_pass') THEN pref_value ELSE NULL END) AS smtp_pass | |
FROM preferences | |
WHERE pref_group = 'email'; |
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
<!DOCTYPE html> | |
<html lang="id" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<title>AJAX Submit Form</title> | |
</head> | |
<body> | |
<form action="kirim-proses.php" method="post" id="formulir"> | |
<input type="text" name="nama" placeholder="Nama Lengkap"><br> | |
<input type="email" name="email" placeholder="Email"><br> |
NewerOlder