Tag Archive for require

Require a checkbox to be checked:

<asp:CustomValidator runat="server" ID="rfvMember" OnServerValidate="cbMember_Validate" ValidateEmptyText="true" ErrorMessage="Member coverage is required." Display="None"></asp:CustomValidator>


protected void cbMember_Validate(object sender, ServerValidateEventArgs e)
	{
		e.IsValid = cbMember.Checked;
	}

source

Scan and Require Ruby Files in Directory

class Dir
def self.require_all(directory)
self.entries(directory).each do |file|
if file =~ /.rb/
require directory + file
end
end
end
end

source

Add paths to Ruby ‘require’

export RUBYLIB=$RUBYLIB:/home/foo/ruby/mylib

source

PHP – Require Dir Files .php

function require_once_dir( $path ){
$dir = dir($path);
while(($file = $dir->read()) !== false)
if( is_file($path .'/'. $file) and preg_match('/^(.+).php$/i', $file) )
require_once($path .'/'. $file);
$dir->close();
}
#Example
require_once_dir( 'lib/db' );
require_once_dir( 'lib/email' );

source