I hereby claim:
- I am ChVuagniaux on github.
- I am chvuagniaux (https://keybase.io/chvuagniaux) on keybase.
- I have a public key whose fingerprint is 7475 D4C9 3F61 946A 4046 24E3 5567 8CE8 E56B 1DD7
To claim this, I am signing this object:
<?php | |
class K2Helper | |
{ | |
/** | |
* Convert K2 extra fields to an object | |
* | |
* Selectable extra fields ever return values inside an array | |
* same if only one value is selected | |
* |
I hereby claim:
To claim this, I am signing this object:
<?php | |
/** | |
* Cut HTML string before a max number of X chars without cutting a words or breaking the HTML markup. | |
* | |
* Try to cut after a </p> tag after 2/3 of the max length (for avoid to display only the first paraph) and if | |
* this fail Cut after the position of the last char of the last word just before the max length and add '...' | |
* at the end of the string | |
* | |
* usage : StrHelper::splitHtmlString($html, 1000); // For get a string that will never be bigger than 1000 chars | |
* |
{% 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 %} | |
<?= $this->relationRender($field->fieldName, ['readOnly' => $formContext == 'preview']) ?> |
<?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', 'é', 'à']); |
<?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 ) | |
*/ |
#!/bin/bash | |
# Start horizon supervisord if not already started | |
if pgrep -f 'php /var/www/artisan horizon'; then | |
echo "Horizon already run" | |
else |
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 |