I'm currently having an Issue with Laravel (5), Its been a long time since I haven't touched laravel since the early versions of 4, and as soon as Laravel 5 was released I boarded the train and thought I would have a go with it, specifically with a Emote phraser.
Basically the over-all issue I'm having is Class "App\Libs\Emote is not found" although I think I've registered the alias correctly for us, but someone could prove me wrong.
<!DOCTYPE html>
<html>
<head>
<title>Laravel</title>
<link href="//fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css">
<style>
html, body {
height: 100%;
}
body {
margin: 0;
padding: 0;
width: 100%;
display: table;
font-weight: 100;
font-family: 'Lato';
}
.container {
text-align: center;
display: table-cell;
vertical-align: middle;
}
.content {
text-align: center;
display: inline-block;
}
.title {
font-size: 96px;
}
</style>
</head>
<body>
<div class="container">
{{
Emote::PhraseEmote()
}}
<div class="content">
<div class="title">(flag:gb) (flag:us)</div>
</div>
</div>
</body>
</html>
Class;
<?php
namespace Libs\Emotes;
class Emotes {
public static function PhraseEmote($value) {
$config = Config::get('emotes');
$smileys = $config['render_phrase'];
foreach($emotes as $key => $val) {
//$value = str_replace($key, '<img src="' . $config['path'] . $smileys[$key][0] . '" width="' . $smileys[$key][1] . '" height="' . $smileys[$key][2] . '" alt="' . $smileys[$key][3] . '" style="border:0;" />', $value);
$value = str_replace($key, $emotes[$key][0], $value);
}
return $value;
}
}
?>
Config;
<?php
return array(
'render_phrase' => array(
'(flag:gb)' => array('<i class="gb flag" data-content="United Kingdom" data-variation="tiny"></i>'),
'(flag:us)' => array('<i class="us flag" data-content="United States" data-variation="tiny"></i>'),
//'(flag:CN_Code)' => array('<i class="CN_CODE flag" data-content="United States" data-variation="tiny"></i>'),
)
);
Aucun commentaire:
Enregistrer un commentaire