Cambios en diseño
This commit is contained in:
@ -13,7 +13,22 @@ class Nosotros {
|
||||
'nosotros.json'
|
||||
]);
|
||||
$nosotros = json_decode(trim(file_get_contents($filename)));
|
||||
$nosotros = $this->str_split_unicode($nosotros, strlen($nosotros) / 2, '-');
|
||||
$min = 200;
|
||||
$max_phrase = 50;
|
||||
if (strlen($nosotros) > $min) {
|
||||
$half = strlen($nosotros) / 2;
|
||||
$pos = strpos($nosotros, '.', $half);
|
||||
if ($pos > $half + $max_phrase) {
|
||||
$pos = strrpos($nosotros, '.', -$half);
|
||||
}
|
||||
$nosotros = $this->str_split_unicode($nosotros, $pos, '-');
|
||||
if (count($nosotros) > 2) {
|
||||
$s1 = array_shift($nosotros);
|
||||
$nosotros = [$s1, implode('', $nosotros)];
|
||||
}
|
||||
} else {
|
||||
$nosotros = [$nosotros];
|
||||
}
|
||||
return $view->render($response, 'nosotros', compact('nosotros'));
|
||||
}
|
||||
protected function str_split_unicode($str, $l = 0) {
|
||||
|
Reference in New Issue
Block a user