Skip to content

Instantly share code, notes, and snippets.

View jovanialferez's full-sized avatar

jovanialferez

  • Hoogly
  • Davao City, Philippines
View GitHub Profile
function myAutocomplete ($document, $timeout, $compile) {
return {
restrict: 'A',
scope: {
onSelectModel: '='
},
template: require('./autocomplete.html'),
transclude: true,
link: (scope, element, attrs) => {
$document.ready(() => {
<?php
/**
* @author: [email protected]
*/
namespace common\components\storage;
/**
* A component to Store File into local storage/path.
* Just add this component to your configuration providing this class,
add_action('add_meta_boxes', 'gov_meta_box_add');
function gov_meta_box_add()
{
add_meta_box('post-meta-box-id', 'Event Type', 'gov_meta_box_cb', 'post', 'side', 'high');
add_meta_box('page-meta-box-id', 'Event Type', 'gov_meta_box_cb', 'page', 'side', 'high');
}
function gov_meta_box_cb($post)
{
$values = get_post_custom($post->ID); // error_log(json_encode($values));
// have this inside your Users model
public function getUserType()
{
return $this->type == 1 ? "Administrator" : "User";
}
// modify your grid as this
<?php