Skip to content

Instantly share code, notes, and snippets.

@woody180
woody180 / library.php
Last active Jan 30, 2021
Codeigniter 4 helper functions set
View library.php
<?php namespace App\Helpers;
class Library {
// Page not found
public static function notFound($params = ["code" => 404, "url" => NULL, "text" => NULL]) {
$code = $params["code"] ?? 404;
$url = $params["url"] ?? NULL;
$text = $params["text"] ?? 'Sorry, but the page you are looking for is not found. Please make sure you have typed the correct url.';
View UIkit event emitter, event trigger
/*
Arguments list
1. class to watch
2. event type
3. callback
*/
UIkit.util.on('.uk-search-default', 'click', e => console.log(e.target.parentElement))