Commit 0762050c by Van

feat(all): Filters done. ReadMe done. Templates by type done

parent 2c5f16bd
...@@ -17,7 +17,7 @@ In file **extensions/composer.json** add this following line: ...@@ -17,7 +17,7 @@ In file **extensions/composer.json** add this following line:
in this block: in this block:
```json ```json
"repositories": { "repositories" : {
"packagist": false, "packagist": false,
"bolt": { "bolt": {
"type": "composer", "type": "composer",
...@@ -39,14 +39,16 @@ Change this keys in configuration: ...@@ -39,14 +39,16 @@ Change this keys in configuration:
- ot_key - ot_key
- cdn_url - cdn_url
## Twig Filter ## Twig Filters
In order to parse data, you can use twig filter In order to parse data, you can use twig filter
******************************************************************************************************** ********************************************************************************************************
#### TourinsoftFilter :
###### Transforme les "#" en lignes et les "|" en items d'un même tableau
###### Exemple
####TourinsoftFilter :
######Exemple
``` ```
Valeur en entrée : Valeur en entrée :
...@@ -72,47 +74,73 @@ array:2 [▼ ...@@ -72,47 +74,73 @@ array:2 [▼
] ]
] ]
``` ```
********************************************************************************************************
#### HashtagFilter :
###### Transforme les données séparées que par un hashtag en tableau
###### Exemple
```
Valeur en entrée :
"Foie gras du Sud-Ouest#Volaille de Gascogne#Volaille du Béarn"
```
```
Application du filtre :
{% for igp in record.igp|hashtag %}
{{ igp }}
{% endfor %}
```
```
Valeur en sortie :
array:3 [▼
0 => "Foie gras du Sud-Ouest"
1 => "Volaille de Gascogne"
2 => "Volaille du Béarn"
]
```
******************************************************************************************************** ********************************************************************************************************
####FullOpeningFilter : ####LabelFilter :
######Date d'ouverture | Date de fermeture. Pour chaque jour de la semaine à partir de Lundi, Heure d'ouverture 1 | Heure de fermeture 1| Heure d'ouverture 2 | Heure de fermeture 2 (au format hh:mm) puis jours de fermeture. ###### Liste d'item séparés par # à transformer en icone par le biais d'un switch
######Exemple ######Exemple
``` ```
Valeur en entrée : Valeur en entrée :
"01/01/2018|31/12/2018|08:00|12:00|14:00|18:00|08:00|12:00|14:00|18:00|08:00|12:00|14:00|18:00|08:00|12:00|14:00|18:00|08:00|12:00|14:00|18:00|||||||||Samedi-Dimanche" "Hébergement pêche#Qualité Tourisme"
``` ```
``` ```
Application du filtre : Application du filtre :
{% for open in record.ouverture|tourinsoft|opening %} <div class="labels">
{{open}} {% for label in record.labels|hashtag %}
{% endfor %} {{ label |label }}
{% endfor %}
</div>
``` ```
``` ```
Valeur en sortie : Valeur en sortie :
Ouverture du 01/01/2018 au 31/12/2018 Soit le logo renseigné dans le filtre, soit l'intitulé du label
Lundi 08:00-12:00, 14:00-18:00
Mardi 08:00-12:00, 14:00-18:00
Mercredi 08:00-12:00, 14:00-18:00
Jeudi 08:00-12:00, 14:00-18:00
Vendredi 08:00-12:00, 14:00-18:00
Jours de fermeture : Samedi-Dimanche
``` ```
******************************************************************************************************** ********************************************************************************************************
####TarifFilter : ####TarifFilter :
###### Intitulé du tarif | Tarif minimum | Tarif maximum | Complément d'information ###### Intitulé du tarif | Tarif minimum | Tarif maximum | Complément d'information
######Exemple ######Exemple
``` ```
...@@ -124,7 +152,9 @@ Valeur en entrée : ...@@ -124,7 +152,9 @@ Valeur en entrée :
``` ```
Application du filtre : Application du filtre :
{{ record.tarifs|tourinsoft|tarif}} {% for tarif in record.tarifs|tourinsoft|tarif %}
{{ tarif|raw }} <br />
{% endfor %}
``` ```
``` ```
...@@ -140,6 +170,30 @@ Autre tarif (insolite by logis chalet) : de 68,00 € à 88,00 € ...@@ -140,6 +170,30 @@ Autre tarif (insolite by logis chalet) : de 68,00 € à 88,00 €
******************************************************************************************************** ********************************************************************************************************
####SimpleOpeningFilter :
######Date d'ouverture | Date de fermeture
######Exemple
```
Valeur en entrée :
"01/01/2018|31/12/2018"
```
```
Application du filtre :
<strong> Ouverture du {{ record.ouverturesimple|tourinsoft|simpleOpening }} </strong
```
```
Valeur en sortie :
Ouverture du
* 01/01/2018 au 31/12/2018
```
********************************************************************************************************
####ValidatedDateFilter : ####ValidatedDateFilter :
######Date de début de validité de la promo | Date de fin de validité de la promo ######Date de début de validité de la promo | Date de fin de validité de la promo
...@@ -191,8 +245,40 @@ Le 04/11/2018 à partir de 10:00 ...@@ -191,8 +245,40 @@ Le 04/11/2018 à partir de 10:00
Du 06/07/2018 au 28/10/2018 de 15:00 à 19:00 Du 06/07/2018 au 28/10/2018 de 15:00 à 19:00
``` ```
********************************************************************************************************
####FullOpeningFilter :
######Date d'ouverture et Date de fermeture (au format jj/mm/aaa), pour chaque jour de la semaine à partir du lundi : Heure d'ouverture 1 | Heure de fermeture 1 | Heure d'ouverture 2 | Heure de fermeture 2 (au format hh:mm) puis jours de fermeture.
######Exemple
```
Valeur en entrée :
"01/01/2018|31/12/2018|08:00|12:00|14:00|18:00|08:00|12:00|14:00|18:00|08:00|12:00|14:00|18:00|08:00|12:00|14:00|18:00|08:00|12:00|14:00|18:00|||||||||Samedi-Dimanche"
```
```
Application du filtre :
{% for open in record.ouverturecomplet|tourinsoft|opening %}
{{ open }} <br />
{% endfor %}
```
```
Valeur en sortie :
Ouverture du 01/01/2018 au 31/12/2018
Lundi 08:00-12:00, 14:00-18:00
Mardi 08:00-12:00, 14:00-18:00
Mercredi 08:00-12:00, 14:00-18:00
Jeudi 08:00-12:00, 14:00-18:00
Vendredi 08:00-12:00, 14:00-18:00
Jours de fermeture : Samedi-Dimanche
```
******************************************************************************************************** ********************************************************************************************************
####CommunicationFilter : ####CommunicationFilter :
###### ######
######Exemple ######Exemple
...@@ -241,6 +327,128 @@ Tél. +33 5 59 46 37 00 ...@@ -241,6 +327,128 @@ Tél. +33 5 59 46 37 00
``` ```
******************************************************************************************************** ********************************************************************************************************
####MeetingRoomFilter :
###### Nom | Capacité | Surface | Descriptif | Equipements (Liste d'items)
######Exemple
```
Valeur en entrée :
"Salle réunion 1|15|15|Salle ton violet|Ecran Paper-board Rétro-projecteur Télévision Vidéo-projecteur Wifi gratuit#Salle de réunion 2|25|25|Salle grise|Ecran Paper-board Rétro-projecteur Télévision Vidéo-projecteur Wifi gratuit"
```
```
Application du filtre :
{% for meetingroom in record.sallereunion|tourinsoft|meetingRoom %}
{{ meetingroom|raw }}
{% endfor %}
```
```
Valeur en sortie :
Nom : Salle réunion 1
Capacité : 15 places
Surface : 15 m2
Descriptif : Salle ton violet
Equipements : Ecran Paper-board Rétro-projecteur Télévision Vidéo-projecteur Wifi gratuit
--------------------------------------------------------------------------------------------
Nom : Salle de réunion 2
Capacité : 25 places
Surface : 25 m2
Descriptif : Salle grise
Equipements : Ecran Paper-board Rétro-projecteur Télévision Vidéo-projecteur Wifi gratuit
--------------------------------------------------------------------------------------------
```
********************************************************************************************************
####AttentionItiFilter :
###### Type de point d'attention | Latitude | Longitude
######Exemple
```
Valeur en entrée :
"Les chiens patous à la ferme Gacié|43.122540|-0.322556#Clôtures ferme Landiste - ne pas hésiter à les franchir|43.125958|-0.317513#Clôtures ferme Gacié - ne pas hésiter à les franchir|43.122540|-0.322556#Portions de route|43.126915|-0.304038#Portions de route|43.114786|-0.318156#Attention aux passages sur le gué, pierres glissantes par temps humide||"```
```
```
Application du filtre :
<strong>Points d'intérêts sur le parcours :</strong>
{% for attention in record.attentioniti|tourinsoft|attention %}
{{ attention |raw }}
{% endfor %}
```
```
Valeur en sortie :
Points d'intérêts sur le parcours :
Les chiens patous à la ferme Gacié ( Lat. : 43.122540 ; Lon. : -0.322556).
Clôtures ferme Landiste - ne pas hésiter à les franchir ( Lat. : 43.125958 ; Lon. : -0.317513).
Clôtures ferme Gacié - ne pas hésiter à les franchir ( Lat. : 43.122540 ; Lon. : -0.322556).
Portions de route ( Lat. : 43.126915 ; Lon. : -0.304038).
Portions de route ( Lat. : 43.114786 ; Lon. : -0.318156).
Attention aux passages sur le gué, pierres glissantes par temps humide
```
********************************************************************************************************
####PhotoFilter :
###### Récupère le chemin vers la photo principale ou toutes les photos
######Exemple
```
Valeur en entrée :
"2017-Le-Vieux-logis-Vieux-Logis--11-.jpg#2017-Le-Vieux-logis-Vieux-Logis--10-.jpg#2017-Le-Vieux-logis-Vieux-Logis--12-.jpg#2016-Chalet-Vieux-Logis-2-Vieux-Logis.jpg"
```
```
Application du filtre :
1- Si on ne souhaite que la photo principale, à savoir la première :
<img class="main-photo" src="{{ record.photo|mainPhoto }}"
2- Si on souhaite toutes les photos du champ :
{# Autres photos #}
{% set photos = record.photo|photos %}
{% if photos %}
{% for photo in photos %}
<img class="main-photo" src="{{ photo }}" />
{% endfor %}
{% endif %}
```
```
Valeur en sortie :
1 -
"http://cdt64.media.tourinsoft.eu/upload/2017-Le-Vieux-logis-Vieux-Logis--11-.jpg"
2 -
array:4 [▼
0 => "http://cdt64.media.tourinsoft.eu/upload/2017-Le-Vieux-logis-Vieux-Logis--11-.jpg"
1 => "http://cdt64.media.tourinsoft.eu/upload/2017-Le-Vieux-logis-Vieux-Logis--10-.jpg"
2 => "http://cdt64.media.tourinsoft.eu/upload/2017-Le-Vieux-logis-Vieux-Logis--12-.jpg"
3 => "http://cdt64.media.tourinsoft.eu/upload/2016-Chalet-Vieux-Logis-2-Vieux-Logis.jpg"
]
```
********************************************************************************************************
......
...@@ -60,19 +60,28 @@ class CronCommand extends Command ...@@ -60,19 +60,28 @@ class CronCommand extends Command
/** @var Flux $flux */ /** @var Flux $flux */
$flux = $app['storage']->getRepository(Flux::class)->findAll(); $flux = $app['storage']->getRepository(Flux::class)->findAll();
$output->writeln([
'CRON RUN',
'============'
]);
/** @var Flux $item */ /** @var Flux $item */
foreach ($flux as $item) foreach ($flux as $item)
{ {
$output->writeln([
$item->getTitle(),
'--------------',
]);
$item->setSynchronizedAt(new \DateTime()); $item->setSynchronizedAt(new \DateTime());
$app['storage']->getRepository(Flux::class)->update($item); $app['storage']->getRepository(Flux::class)->update($item);
$sync = new Synchronisation($this->config, $app, $item); $sync = new Synchronisation($this->config, $app, $item);
$sync->cron(); $sync->cron();
} }
$output->writeln([ $output->writeln([
'CRON RUN',
'============',
"<comment>Synchronisation terminée</comment>" "<comment>Synchronisation terminée</comment>"
]); ]);
} }
......
...@@ -6,11 +6,14 @@ use Bolt\Asset\File\JavaScript; ...@@ -6,11 +6,14 @@ use Bolt\Asset\File\JavaScript;
use Bolt\Asset\File\Stylesheet; use Bolt\Asset\File\Stylesheet;
use Bolt\Controller\Zone; use Bolt\Controller\Zone;
use Bolt\Events\CronEvents; use Bolt\Events\CronEvents;
use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\AttentionItiFilter;
use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\CommunicationFilter; use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\CommunicationFilter;
use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\FilesFilter; use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\FilesFilter;
use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\FullDatesFilter; use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\FullDatesFilter;
use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\FullOpeningFilter; use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\FullOpeningFilter;
use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\MeetingRoomFilter;
use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\PhotoFilter; use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\PhotoFilter;
use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\SimpleOpeningFilter;
use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\TelFilter; use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\TelFilter;
use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\ValidatedDateFilter; use Bolt\Extension\Appolo\Tourinsoft\TwigFilters\ValidatedDateFilter;
use Bolt\Extension\DatabaseSchemaTrait; use Bolt\Extension\DatabaseSchemaTrait;
...@@ -97,6 +100,7 @@ class TourinsoftExtension extends SimpleExtension ...@@ -97,6 +100,7 @@ class TourinsoftExtension extends SimpleExtension
'tourinsoft' => [[TourinsoftFilter::class, 'run']], 'tourinsoft' => [[TourinsoftFilter::class, 'run']],
'tarif' => [[TarifFilter::class, 'run'], ['is_safe' => ['html'] ]], 'tarif' => [[TarifFilter::class, 'run'], ['is_safe' => ['html'] ]],
'communication' => [[CommunicationFilter::class, 'run'], ['is_safe' => ['html'] ]], 'communication' => [[CommunicationFilter::class, 'run'], ['is_safe' => ['html'] ]],
'meetingRoom' => [[MeetingRoomFilter::class, 'run'], ['is_safe' => ['html'] ]],
'label' => [[LabelFilter::class, 'run'], ['is_safe' => ['html'] ]], 'label' => [[LabelFilter::class, 'run'], ['is_safe' => ['html'] ]],
'hashtag' => [[HashtagToArray::class, 'run']], 'hashtag' => [[HashtagToArray::class, 'run']],
'pipe' => [[PipeToArray::class, 'run']], 'pipe' => [[PipeToArray::class, 'run']],
...@@ -105,7 +109,9 @@ class TourinsoftExtension extends SimpleExtension ...@@ -105,7 +109,9 @@ class TourinsoftExtension extends SimpleExtension
'files' => [[new FilesFilter($this->getConfig(), false), 'run']], ['is_safe' => ['html']], 'files' => [[new FilesFilter($this->getConfig(), false), 'run']], ['is_safe' => ['html']],
'opening' => [[FullOpeningFilter::class, 'run'], ['is_safe' => ['html'] ]], 'opening' => [[FullOpeningFilter::class, 'run'], ['is_safe' => ['html'] ]],
'fullDates' => [[FullDatesFilter::class, 'run'], ['is_safe' => ['html'] ]], 'fullDates' => [[FullDatesFilter::class, 'run'], ['is_safe' => ['html'] ]],
'validatedDate' => [[ValidatedDateFilter::class, 'run'], ['is_safe' => ['html']]] 'validatedDate' => [[ValidatedDateFilter::class, 'run'], ['is_safe' => ['html']]],
'simpleOpening' => [[SimpleOpeningFilter::class, 'run'], ['is_safe' => ['html']]],
'attention' => [[AttentionItiFilter::class, 'run'], ['is_safe' => ['html'] ]],
]; ];
} }
...@@ -117,7 +123,7 @@ class TourinsoftExtension extends SimpleExtension ...@@ -117,7 +123,7 @@ class TourinsoftExtension extends SimpleExtension
{ {
$this->extendDatabaseSchemaServices(); $this->extendDatabaseSchemaServices();
$this->extendRepositoryMapping(); $this->extendRepositoryMapping();
parent::registerServices($app); // TODO: Change the autogenerated stub parent::registerServices($app);
} }
/** /**
......
<?php
namespace Bolt\Extension\Appolo\Tourinsoft\TwigFilters;
class AttentionItiFilter
{
/**
* @param $input
* @return array
*/
public static function run($input)
{
$data = [];
foreach ($input as $item) {
$type = '';
if (!empty($item[0])) {
$type = $item[0];
}
$lat = '';
if (!empty($item[1])) {
$lat = ' ( Lat. : ' . $item[1];
}
$lon = '';
if (!empty($item[2])){
$lon = ' ; Lon. : ' .$item[2] . ').';
}
$data[] = $type .$lat .$lon. ' <br />' ;
}
return $data;
}
}
\ No newline at end of file
...@@ -16,21 +16,16 @@ class LabelFilter ...@@ -16,21 +16,16 @@ class LabelFilter
{ {
$html = ''; $html = '';
if(!is_array($input)) { switch ($input)
return $input; {
}
foreach ($input as $item) {
foreach ($item as $key => $value){
switch ($value) {
case 'Hébergement pêche' : case 'Hébergement pêche' :
$html .= '<img src="http://tourisme-bearn-paysdenay.com/templates/otpaysdenay/img/labels/hebergement-peche.jpg">'; $html .= '<img src="http://tourisme-bearn-paysdenay.com/templates/otpaysdenay/img/labels/hebergement-peche.jpg">';
break; break;
case 'Qualité Tourisme' : case 'Qualité Tourisme' :
$html .= '<img src="http://tourisme-bearn-paysdenay.com/templates/otpaysdenay/img/labels/qualite-tourisme.jpg">'; $html .= '<img src="http://tourisme-bearn-paysdenay.com/templates/otpaysdenay/img/labels/qualite-tourisme.jpg">';
break; break;
} default:
} $html .= $input;
} }
return $html; return $html;
......
<?php
namespace Bolt\Extension\Appolo\Tourinsoft\TwigFilters;
class MeetingRoomFilter
{
/**
* @param $input
* @return array
*/
public static function run($input)
{
$data = [];
foreach ($input as $item) {
$nom = '';
if (!empty($item[0])) {
$nom = 'Nom : ' . $item[0];
}
$capacite = '';
if (!empty($item[1])) {
$capacite = 'Capacité : ' . $item[1] . ' places';
}
$surface = '';
if (!empty($item[2])){
$surface = 'Surface : ' .$item[2] . ' m2';
}
$descriptif = '';
if (!empty($item[3])){
$descriptif = 'Descriptif : ' .$item[3];
}
$equipements = '';
if (!empty($item[4])){
$equipements = ' Equipements : ' .$item[4];
}
$data[] = $nom. '<br />' .$capacite. '<br />' .$surface. '<br />' .$descriptif. '<br />' .$equipements. '<hr>';
}
return $data;
}
}
\ No newline at end of file
<?php
namespace Bolt\Extension\Appolo\Tourinsoft\TwigFilters;
class SimpleOpeningFilter
{
/**
* @param $input
* @return string
*/
public static function run($input)
{
$html = '';
if(!is_array($input)) {
return $input;
}
foreach ($input as $item){
$html .= '<li > '.$item[0]. ' au '.$item[1]. '</li>';
}
return $html;
}
}
\ No newline at end of file
...@@ -59,7 +59,9 @@ class ContentTypeFile ...@@ -59,7 +59,9 @@ class ContentTypeFile
'record_template' => strtolower('tourinsoft/'.$this->flux->getCode().'/record.twig'), 'record_template' => strtolower('tourinsoft/'.$this->flux->getCode().'/record.twig'),
'listing_template' => strtolower('tourinsoft/'.$this->flux->getCode().'/listing_record.twig'), 'listing_template' => strtolower('tourinsoft/'.$this->flux->getCode().'/listing_record.twig'),
'viewless' => $this->flux->isViewless(), 'viewless' => $this->flux->isViewless(),
'searchable' => $this->flux->isSearchable() 'searchable' => $this->flux->isSearchable(),
'default_status' => 'published',
'show_in_menu' => 'Tourinsoft'
] ]
]; ];
...@@ -95,7 +97,12 @@ class ContentTypeFile ...@@ -95,7 +97,12 @@ class ContentTypeFile
]; ];
} }
if (!empty($fields['nomoffre'])) { $fields['slug'] = [
'type' => 'slug',
'uses' => 'syndicobjectname'
];
/*if (!empty($fields['nomoffre'])) {
$fields['slug'] = [ $fields['slug'] = [
'type' => 'slug', 'type' => 'slug',
'uses' => 'nomoffre' 'uses' => 'nomoffre'
...@@ -105,7 +112,7 @@ class ContentTypeFile ...@@ -105,7 +112,7 @@ class ContentTypeFile
'type' => 'slug', 'type' => 'slug',
'uses' => 'listingnom' 'uses' => 'listingnom'
]; ];
} }*/
if(!empty($this->options['locales'])) { if(!empty($this->options['locales'])) {
foreach ($this->options['locales'] as $locale) { foreach ($this->options['locales'] as $locale) {
......
...@@ -94,13 +94,16 @@ class Data ...@@ -94,13 +94,16 @@ class Data
$data[$key] = $v; $data[$key] = $v;
} }
$data['title'] = $data['syndicobjectname']; $data['title'] = $data['syndicobjectname'];
if (!empty($data['nomoffre'])){ $data['slug'] = Slugify::create()->slugify($data['syndicobjectname']);
/* if (!empty($data['nomoffre'])){
$data['slug'] = Slugify::create()->slugify($data['nomoffre']); $data['slug'] = Slugify::create()->slugify($data['nomoffre']);
}else{ }else{
dump('1');
$data['slug'] = Slugify::create()->slugify($data['listingnom']); $data['slug'] = Slugify::create()->slugify($data['listingnom']);
} }*/
$data['status'] = 'published'; $data['status'] = 'published';
$data['datepublish'] = new \DateTimeImmutable(); $data['datepublish'] = new \DateTimeImmutable();
$data['ownerid'] = 1;
$this->getTranslatedItem($data); $this->getTranslatedItem($data);
array_push($items, $data); array_push($items, $data);
...@@ -121,11 +124,13 @@ class Data ...@@ -121,11 +124,13 @@ class Data
if ($locale == $this->options['default_locale']) { if ($locale == $this->options['default_locale']) {
$data[$dataKey] = json_encode([]); $data[$dataKey] = json_encode([]);
if (!empty($data['nomoffre'])){ $data[$slugKey] = Slugify::create()->slugify($data['syndicobjectname']);
/*if (!empty($data['nomoffre'])){
$data[$slugKey] = Slugify::create()->slugify($data['nomoffre']); $data[$slugKey] = Slugify::create()->slugify($data['nomoffre']);
}else{ }else{
dump('2');
$data[$slugKey] = Slugify::create()->slugify($data['listingnom']); $data[$slugKey] = Slugify::create()->slugify($data['listingnom']);
} }*/
} else { } else {
$dataLocale = $this->getDataForLocales($locale, $data['syndicobjectid']); $dataLocale = $this->getDataForLocales($locale, $data['syndicobjectid']);
if(!empty($dataLocale)) { if(!empty($dataLocale)) {
...@@ -133,11 +138,13 @@ class Data ...@@ -133,11 +138,13 @@ class Data
$data[$slugKey] = $dataLocale['slug']; $data[$slugKey] = $dataLocale['slug'];
} else { } else {
$data[$dataKey] = json_encode([]); $data[$dataKey] = json_encode([]);
if (!empty($data['nomoffre'])){ $data[$slugKey] = Slugify::create()->slugify($data['syndicobjectname']);
/*if (!empty($data['nomoffre'])){
$data[$slugKey] = Slugify::create()->slugify($data['nomoffre']); $data[$slugKey] = Slugify::create()->slugify($data['nomoffre']);
}else{ }else{
dump('3');
$data[$slugKey] = Slugify::create()->slugify($data['listingnom']); $data[$slugKey] = Slugify::create()->slugify($data['listingnom']);
} }*/
} }
} }
...@@ -161,11 +168,14 @@ class Data ...@@ -161,11 +168,14 @@ class Data
$data[$key] = $v; $data[$key] = $v;
} }
$data['title'] = $data['syndicobjectname']; $data['title'] = $data['syndicobjectname'];
if (!empty($data['nomoffre'])){ $data['slug'] = Slugify::create()->slugify($locale. '-' .$data['syndicobjectname']);
/* if (isset($data['nomoffre'])){
$data['slug'] = Slugify::create()->slugify($locale. '-' .$data['nomoffre']); $data['slug'] = Slugify::create()->slugify($locale. '-' .$data['nomoffre']);
}else{ }else{
dump('4');
$data['slug'] = Slugify::create()->slugify($locale. '-' .$data['listingnom']); $data['slug'] = Slugify::create()->slugify($locale. '-' .$data['listingnom']);
} }*/
return $data; return $data;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment