local mymodule = {}
function mymodule.foo()
print("Hello World!")
end
function mymodule.validatePossibleValidUser(valua,userName,password)
print(valua)
if(valua:new().type("string").len(3,5)(userName)) then
if(valua:new().type("string").len(3,5)(password)) then
return true;
else
return false,"password doesn't match"
end
else
return false, "name doesn't match"
end
end
return mymodule
function main.index(page)
--currently it gets loaded in a controller but it should work the same inside a model (or even view)
local valua = require "valua"
local test = require "test"
test.foo()
local possible,error=test.validatePossibleValidUser(valua,"test","lol")
print(possible,error)
page:render("index")
end
<?lua@client
local valua = require "valua"
local test= require "test"
local possible,error=test.validatePossibleValidUser(valua,"some","awekdwkdwkldw")
print(possible,error)
?>