a couple of potentially useful helpers |
These two helpers are a couple i use in my projects. Not sure if anyone will find them useful or not, but thought i would share them just in case.
the first one is an alias function for both the php functions is_null() and empty() path/file name: application/helpers/variable_helper.php PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); the next one contains two files. a config file and a helper file. It converts html to bbcode and bbcode to html. config file: in application/config/autoload.php add the below config file to your autoload config array. path/file name: application/config/bbcode.php PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); add the below file to your autoload helpers array. path/file name: application/helpers/bbcode_helper.php PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); well there you go, hopefully someone finds them useful
First helper is kinda pointless.
Website: marcomonteiro.net | Blog: blog.marcomonteiro.net | Twitter: @marcogmonteiro | TILThings: tilthings.com
i created that helper quite awhile ago when i was getting errors passing nulls into the empty function. It was quite irritating, so basically it was put in as a work around for the problem. Still to this day not sure why i was getting that error with the empty function but yeah, that is why i wrote it.
(10-31-2014, 07:59 AM)Hobbes Wrote: i created that helper quite awhile ago when i was getting errors passing nulls into the empty function. It was quite irritating, so basically it was put in as a work around for the problem. Still to this day not sure why i was getting that error with the empty function but yeah, that is why i wrote it. You might've had problems with passing function return values directly to empty(): PHP Code: // This only works on PHP 5.5+ This has nothing to do with nulls though.
Maybe the problem then (and now) was that what is considered an empty variable is not necessarily a null one.
![]()
no i do not typically pass a function call to the empty function. just variables.
Plus, for me mainly being a C# and VB.Net developer using is_null_or_empty() is more natural. Even though at this point it is a useless function. lol |
Welcome Guest, Not a member yet? Register Sign In |