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 namespace Your\Plugin; | |
use Event; | |
use System\Classes\PluginBase; | |
class Plugin extends PluginBase | |
{ | |
// [...] | |
/** |
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 | |
use RainLab\Location\Models\Country; | |
Route::get('generate-country-translations', function () { | |
$countries = Country::all(); | |
$countries->each(function (Country $country) { | |
$response = file_get_contents("https://restcountries.com/v2/alpha/{$country->code}"); |
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 | |
/* | |
* | |
* Generate RainLab translation index | |
* @see https://github.com/rainlab/translate-plugin#indexed-attributes | |
* | |
*/ | |
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_DEBUG=true | |
APP_URL=http://example.local | |
APP_KEY= | |
DB_CONNECTION=mysql | |
DB_HOST=localhost | |
DB_PORT=3306 | |
DB_DATABASE=website-oc-example-LOCAL | |
DB_USERNAME=homestead | |
DB_PASSWORD=secret |
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
#!/bin/bash | |
# Start horizon supervisord if not already started | |
if pgrep -f 'php /var/www/artisan horizon'; then | |
echo "Horizon already run" | |
else |
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 | |
/** | |
* This script convert a model using | |
* \October\Rain\Database\Traits\SimpleTree to | |
* \October\Rain\Database\Traits\NestedTree | |
* | |
* Before run create required fields in your DB for NestedTree | |
* ( https://octobercms.com/docs/database/traits#nested-tree ) | |
*/ |
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 | |
use League\Csv\Writer; | |
use League\Csv\AbstractCsv; | |
$csv = Writer::createFromFileObject(new \SplTempFileObject()); | |
$csv->setDelimiter(';'); | |
$csv->setOutputBOM(AbstractCsv::BOM_UTF8); // compatibility with Excel | |
$csv->insertOne(['1', 'é', 'à']); |
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
<?= $this->relationRender($field->fieldName, ['readOnly' => $formContext == 'preview']) ?> |
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
{% if posts.lastPage > 1 %} | |
<ul class="pagination"> | |
{% if posts.currentPage > 1 %} | |
{% if (posts.currentPage == 2) %} | |
<li><a href="{{ listPage|page({ (pageParam): null }) }}">← </a></li> | |
{% else %} | |
<li><a href="{{ listPage|page({ (pageParam): (posts.currentPage - 1) }) }}">← </a></li> | |
{% endif %} | |
{% endif %} | |
NewerOlder