Name

Web::Components::Util - Functions used in this distribution

Synopsis

use Web::Components::Util qw( load_components );

Description

Functions used in this distribution

Configuration and Environment

Defines no attributes

Subroutines/Methods

deref

$value = deref $object_or_hash_ref, $key, $optional_default;

Returns the value associated with the supplied key. Accepts either an object or hash reference as the first argument. Returns the default if the result is otherwise undefined

exception

$e = exception $error;

Expose the catch method in the exception class Class::Usul::Exception. Returns a new error object

first_char

$single_char = first_char $some_string;

Returns the first character of $string

is_arrayref

$bool = is_arrayref $scalar_variable;

Tests to see if the scalar variable is an array ref

load_components

$hash_ref_of_objects = load_components $search_path, @options_list;

Load and instantiates MVC components. The search path is appended to the applications classname to define the package namespace that is searched for components

The options list is a list of keys and values. Either application or, config and log must be specified. If application is specified it must define config and log attributes

The configuration object or hash reference must define the appclass and components attributes

The components attribute (one of the collection references held by Web::Components::Loader) is passed to the component constructor method and is used by a component to discover it's dependencies

An adaptor pattern is possible using the config_comps attribute

throw

throw 'message', [ 'arg1', 'arg2' ];

Expose "throw" in Web::ComposableRequest::Util. Web::ComposableRequest::Constants has a class attribute Exception_Class which can be set change the class of the thrown exception

Diagnostics

None

Dependencies

Module::Pluggable
Web::ComposableRequest
Unexpected

Incompatibilities

There are no known incompatibilities in this module

Bugs and Limitations

There are no known bugs in this module. Please report problems to http://rt.cpan.org/NoAuth/Bugs.html?Dist=Web-Components. Patches are welcome

Acknowledgements

Larry Wall - For the Perl programming language

Author

Peter Flanigan, <pjfl@cpan.org>

License and Copyright

Copyright (c) 2017 Peter Flanigan. All rights reserved

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic

This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE