Skip to content

Instantly share code, notes, and snippets.

<?php
public function dayFilter($day)
{
if ($day <= 0) {
return '0 дней';
}
if ($day <= 10 || $day >= 20) {
switch ($day % 10) {
@iboved
iboved / Plugin.php
Last active October 11, 2017 19:48
Extend form fields with Yaml Parser
<?php
namespace Vitae\Vita;
use System\Classes\PluginBase;
use Backend\Models\User as BackendUserModel;
use Backend\Controllers\Users as BackendUsersController;
use Vitae\Vita\Controllers\MyAccount;
use Yaml;
use Event;
<?php
namespace Some\Namespace\Models;
use Model;
use Vitae\Account\Traits\ModelTrait;
/**
* Product Model
*/
<?php
trait A {
public function smallTalk() {
echo 'a';
}
public function bigTalk() {
echo 'A';
}
}
@iboved
iboved / mail.php
Last active December 3, 2017 11:51
<?php
try {
Mail::send('vitae.application::mail.application', $data, function ($message) use ($application) {
$message->to($application->email, 'Nuts vH');
});
Flash::success('Message sent successfully');
} catch (\Exception $exception) {
Log::error(sprintf('Failed to send email. Error details: %s', $exception));
@iboved
iboved / routes.php
Last active December 9, 2017 19:49
<?php
namespace Octobase\Mediamanager;
use Route;
use BackendAuth;
Route::group(['middleware' => 'web'], function() {
Route::get('/sso/{slug}', function($slug) {
$user = BackendAuth::findUserByLogin($slug);
/*
* Copyright (c) 2011 Jonathan Perkin <[email protected]>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
<!doctype html>
<html lang="en">
<head>
<title>Chordpro</title>
</head>
<body>
<input type="hidden" value="[C]Twinkle [C/E]twinkle [F]little [C]star [F]How I [C]wonder [G]what you [C]are" id="song">
<h2>Output:</h2>
<?php namespace Octobase\Advertising;
use Backend;
use Octobase\Advertising\Controllers\Banners;
use System\Classes\PluginBase;
/**
* Advertising Plugin Information File
*/
class Plugin extends PluginBase
swiper:
name: Swiper
description: Swiper Section
icon: icon-file-image-o
fields:
_group:
default: swiper
cssClass: hide
section_swiper_section:
label: Swiper