Code Monkey home page Code Monkey logo

idnavalidator-laravel's Introduction

idnavalidator-laravel

Updated URL validation methods for Laravel that allow linking to International Domain Names (IDN)

NOTE: this bundle is currently unavailable/nonfunctional

Installation

Install the bundle

php artisan bundle:install idnavalidator

Activate in application/bundles.php

return array(
	...
	'idnavalidator' => array('auto' => 'true')
	...
);

Usage

IDNAValidator can be used just like any Laravel\URL method;

print IDNAValidator\URL::to('http://äöü.com/');

Replacing Laravel\URL

Since IDNAValidator\URL directly extends Laravel\URL, you can alias it so that any Laravel class that uses URL will use IDNAValidator\URL instead. This is necessary if you want HTML::link (or others) to use international validation as well.

To do the alias replacement, find the 'aliases' array in application/config/application.php, and comment out

'URL'        => 'Laravel\\URL',

and then add the following

'URL'        => 'IDNAValidator\\URL',

Once you've replaced the alias, you should be able to use URL methods like normal:

URL::to_route($route);

And things like

HTML::link('http://äöü.com/','Link');

will work with IDN urls

idnavalidator-laravel's People

Contributors

tcql avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.