Skip to content

Instantly share code, notes, and snippets.

/**
* @privateRemarks
* This file was generated by the FormKit CLI and should not be manually
* edited unless you’d like to "eject" from the CLI’s ability to update it.
*
* @checksum - c3f440bec7e87e08e78fe13f705b1c6d4bcb73f98ad8c5ca86f05f1dd1646156
* @variables - radius=rounded,accentColor=indigo,colorTemperature=slate,spacing=2.5,scale=base,inputShadow=shadow-sm,baseColorShade=500,borderShadeLightMode=300,borderShadeDarkMode=700,inputMaxWidth=max-w-none,tagRadius=rounded,swatchRadius=rounded
* @theme - regenesis
**/
<?php namespace ProcessWire;
class MenuPage extends Page
{
protected $menu_items;
public function getDepthStructure(): array
{
$repeater_structure = [];
@Lazerproof
Lazerproof / CachableComponent.php
Created May 12, 2020 21:41 — forked from khoatran/CachableComponent.php
OctoberCMS - CachableComponent
<?php
use Cache;
use Cms\Classes\ComponentBase;
abstract class CachableComponentBase extends ComponentBase
{
/**
* Build cache configuration which is an array: ['cachedKey' => 'The cache key value', 'cachedTimeInMinutes' => 'Cached time in minutes']
* @return mixed
@Lazerproof
Lazerproof / export_csv.php
Created February 25, 2020 18:03
Processwire CSV Import/Export
<?php
/**
* Export CSV
*
* @author Ivan Milincic <lokomotivan@gmail.com>
* @copyright 2017 Ivan Milincic
*
*/
if($input->post->export_csv) {
æ=ae
å=a
ä=a
ã=a
ß=ss
ö=o
ü=u
đ=dj
ж=zh
х=kh
$module: 'mainmenu';
/* critical:start */
.#{$module} {
@include grid-column(9.3, 0);
&__inner {
position: relative;
// text-align: center;
<?php namespace Processwire;
$menuModule = $modules->get('MarkupMenuBuilder');
$lang_name = user("language")->name;
$menu_page = pages()->get(2092);
if($lang_name == "english") {
$menu_page = pages()->get(2095);
} elseif ($lang_name == "russian") {
@mixin fill($offset: 0) {
// get a list with 4 numbers
@if type_of($offset) == 'number' {
$offset: ($offset $offset $offset $offset);
} @else if type_of($offset) == 'list' {
@if length($offset) == 2 {
$offset: join($offset, $offset);
} @else if length($offset) == 3 {
@Lazerproof
Lazerproof / ProcessDashboard.module.php
Created August 23, 2017 11:15 — forked from abdusco/ProcessDashboard.module.php
A simple dashboard module for ProcessWire 3.0+
<?php namespace ProcessWire;
class ProcessDashboard extends Process implements Module
{
public static function getModuleInfo()
{
return [
'title' => 'Orders Dashboard',
'summary' => 'Shows latest orders',
/**
* Adds file modified date as query string and returns URL to given asset.
*
*
* @param $relPath string File path relative to /site/templates/, such as "assets/css/style.css"
* @return string URL with cache busting query parameter
*/
function assetUrl($relPath)
{
$fullPath = wire()->config->paths->templates . $relPath;