public function getTitle()
 {
     $title = Utf8::ucfirst($this->title['parent']);
     if ($this->title['child']) {
         $title .= ' – ' . Utf8::ucfirst($this->title['child']);
     }
     $title .= ' – ' . $this->appname;
     return $title;
 }
 public function __construct($repository = null)
 {
     $this->repository = $repository;
     $this->applicationName = Config::get('typicms.' . App::getLocale() . '.websiteTitle');
     $instance = $this;
     View::composer($this->layout, function (\Illuminate\View\View $view) use($instance) {
         $view->withTitle(Utf8::ucfirst(implode(' ', $instance->title)) . ' – ' . $instance->applicationName);
     });
     $bodyClass = ['lang-' . App::getLocale(), $repository->getModel()->getTable()];
     if (Sentry::getUser() && !Input::get('preview')) {
         $bodyClass[] = 'has-navbar';
     }
     View::share('lang', App::getLocale());
     View::share('bodyClass', implode(' ', $bodyClass));
 }
/**
 * Makes a string's first character uppercase.
 * @param string $string				The input string.
 * @param string $encoding (optional)	The used internally by this function character encoding.
 * If it is omitted, the platform character set will be used by default.
 * @return string						Returns a string with the first character capitalized, if that character is alphabetic.
 * This function is aimed at replacing the function ucfirst() for human-language strings.
 * @link http://php.net/manual/en/function.ucfirst
 */
function api_ucfirst($string, $encoding = null)
{
    return Utf8::ucfirst($string);
}
Beispiel #4
0
 public function upperFirst()
 {
     $this->string = u::ucfirst($this->string);
     return $this;
 }
Beispiel #5
0
/**
 * Make sure the first letter is uppercase
 *
 * @param string $str
 *
 * @return string
 *
 * @deprecated Deprecated since Contao 4.0, to be removed in Contao 5.0.
 *             Use Patchwork\Utf8::ucfirst() instead.
 */
function utf8_ucfirst($str)
{
    @trigger_error('Using utf8_ucfirst() has been deprecated and will no longer work in Contao 5.0. Use Patchwork\\Utf8::ucfirst() instead.', E_USER_DEPRECATED);
    return Utf8::ucfirst($str);
}
Beispiel #6
0
 /**
  * Request forgot password
  * @param $email string
  * @return redirect
  */
 public function postForgotPassword()
 {
     $valid = Validator::make(Input::all(), array('email' => 'required|email|exists:users'), array('exists' => \Patchwork\Utf8::ucfirst(trans('larauth::larauth.account_with_email_not_exist'))));
     if (!$valid->passes()) {
         return Redirect::route('larauth.forgot_password')->with('errors', $valid->errors())->with(Input::all());
     }
     $user = Sentry::findUserByCredentials(['email' => Input::get('email')]);
     $key = $user->getResetPasswordCode();
     $data = ['key' => $key, 'email' => Input::get('email'), 'subject' => trans('larauth::larauth.password_recovery')];
     $this->sendMail(Config::get('larauth::views.mail_forgotpassword'), $data);
     return Redirect::route('larauth.forgot_password')->with('processed', true);
 }
Beispiel #7
0
 public function added()
 {
     setlocale(LC_TIME, 'fr_FR.utf8', 'fra');
     $dt = Carbon::parse($this->created_at);
     return Utf8::ucfirst($dt->formatLocalized('%A %d %B %Y'));
 }
 public function test_linefeed()
 {
     $str = "ñtërn\nâtiônàlizætiøn";
     $ucfirst = "Ñtërn\nâtiônàlizætiøn";
     $this->assertEquals($ucfirst, u::ucfirst($str));
 }