Skip to content

humanize function not found #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
FiloSpaTeam opened this issue Jul 2, 2015 · 6 comments
Closed

humanize function not found #15

FiloSpaTeam opened this issue Jul 2, 2015 · 6 comments

Comments

@FiloSpaTeam
Copy link

When i use image_tag, i have this in console:
err

@tortuetorche
Copy link
Contributor

Hi @FiloSpaTeam,

You're right, I'm going to add this helper.

Cheers,
Tortue Torche

@FiloSpaTeam
Copy link
Author

;-) I found this function and added in my global.php

    function humanize($str) {

    $str = trim(strtolower($str));
    $str = preg_replace('/[^a-z0-9\s+]/', '', $str);
    $str = preg_replace('/\s+/', ' ', $str);
    $str = explode(' ', $str);

    $str = array_map('ucwords', $str);

    return implode(' ', $str);
    }

@tortuetorche
Copy link
Contributor

Good catch, but it'll be easier for other users to have it bundled into Larasset.

@FiloSpaTeam
Copy link
Author

yeah ;D when bundled, i'll remove my function! thanks!

@FiloSpaTeam
Copy link
Author

Thanks! 💃

@tortuetorche
Copy link
Contributor

You're welcome, I'm going to backport this fix for Larasset 0.9 and 1.0

tortuetorche pushed a commit that referenced this issue Nov 27, 2015
Laravel 5.1 support!
CoffeeScript compile now the JavaScript without the top-level function safety wrapper (non-bare mode) via larasset-js 1.2.0
ECMAScript 2015 (ES6) support with Babel via larasset-js 1.1.1
Add the humanize() function helper to fix the image_tag() helper (fix #15).
Add a larasset.port config option. For handling correctly the --larasset-port option of the php artisan server command. Useful for your development environment when you run the assets server. The default port value is 3000. You can change it in the config/larasset.php file of your Laravel application.
Replace the deprecated illuminate/html package by the laravelcollective/html package.

Upgrade Notes (if you used previously this package with Laravel 4.x or 5.0):
  You should replace in the config/app.php file of your Laravel application:
    'Illuminate\Html\HtmlServiceProvider', by 'Collective\Html\HtmlServiceProvider',
    'Form' => 'Illuminate\Html\FormFacade', by 'Form' => 'Collective\Html\FormFacade',
    'HTML' => 'Illuminate\Html\HtmlFacade', by 'HTML' => 'Collective\Html\HtmlFacade',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants