Go to the source code of this file.
Functions | |
| url ($controller, $action='') | |
| absolute_url ($controller, $action='') | |
| debug ($var, $queue=true) | |
| error ($message) | |
| backtrace () | |
| pronto_exception ($e) | |
| pronto_error ($errno, $message, $file, $line, $context=null, $backtrace=null) | |
| array_hash ($arr) | |
| array_yesno () | |
| yesno ($int) | |
| array_extract ($arr, $key) | |
| array_sub ($arr, $key) | |
| array_divide ($arr, $size) | |
| array_insert (&$arr, $key, $val, $after) | |
| assert_type (&$var, $type) | |
| a ($key) | |
| a | ( | $ | key | ) |
Shortcut function for Web::has_access()
Definition at line 444 of file util.php.
References Registry::get().
Referenced by tpNavigation::_submenu().
| absolute_url | ( | $ | controller, | |
| $ | action = '' | |||
| ) |
Build an absolute URL. See the prototype for the url() function for a description of the two contexts for which this function can be called.
| string | $controller Either the name of the controller, or the URL fragment. | |
| mixed | $action Either the name of the action, or blank/unused. If called via method (2), then this may be set to FALSE, which will ignore DISPATCH_URL even if it's set. This is needed for building URLs to static resources, such as images, JS, CSS, things that shouldn't be routed through the DISPATCH_URL. |
Definition at line 112 of file util.php.
Referenced by tpHtml::full_url(), and Web::require_https().
| array_divide | ( | $ | arr, | |
| $ | size | |||
| ) |
| array_extract | ( | $ | arr, | |
| $ | key | |||
| ) |
Return an array consisting of a specific element of each sub-array.
| array | $arr A 2-d array. | |
| string | $key The key of the element to fetch. | |
| array | A 1-d array. |
Definition at line 356 of file util.php.
Referenced by array_sub().
| array_hash | ( | $ | arr | ) |
Convert a numeric array into an associative one.
Definition at line 321 of file util.php.
Referenced by tpTable::build_grid().
| array_insert | ( | &$ | arr, | |
| $ | key, | |||
| $ | val, | |||
| $ | after | |||
| ) |
Insert a new element in an associative array. The element will be inserted directly after the $after element.
| array | $arr Array to insert the new element in. | |
| string | $key The key of the new element. | |
| mixed | $val The value of the new element. | |
| string | $after The key of the element that the new element will be inserted after. |
| array_sub | ( | $ | arr, | |
| $ | key | |||
| ) |
| array_yesno | ( | ) |
| assert_type | ( | &$ | var, | |
| $ | type | |||
| ) |
Check and enforce a variable's data type.
| mixed | $var The variable | |
| mixed | $type One of: array, string, int, float |
Definition at line 418 of file util.php.
Referenced by RecordSelector::_get_ids(), tpjqGrid::build(), tpGrid::build(), tpForm::build_form(), and SQL_Generator::enumerate().
| backtrace | ( | ) |
| debug | ( | $ | var, | |
| $ | queue = true | |||
| ) |
Output a string or variable for debugging purposes.
| boolean | $queue If false, output data directly to browser. Otherwise, queue it and output it in the designated debug panel. |
Definition at line 144 of file util.php.
References $web, and Registry::get().
| error | ( | $ | message | ) |
Trigger an error through PHP's E_USER_ERROR level. Errors will only be triggered if Debug mode is enabled.
| string | $message |
Definition at line 168 of file util.php.
Referenced by Web::run().
| pronto_error | ( | $ | errno, | |
| $ | message, | |||
| $ | file, | |||
| $ | line, | |||
| $ | context = null, |
|||
| $ | backtrace = null | |||
| ) |
Default error handler.
Definition at line 209 of file util.php.
References $web, DS, and Registry::get().
Referenced by pronto_exception().
| pronto_exception | ( | $ | e | ) |
Default exception handler. This function just proxies the error through to pronto_error().
Definition at line 201 of file util.php.
References pronto_error().
| url | ( | $ | controller, | |
| $ | action = '' | |||
| ) |
PRONTO WEB FRAMEWORK Copyright (C) 2006, Judd Vinet
Description: Utility functions that are available to all Pronto components. Build a relative URL. This function can be called in two different ways.
(1) If called with (controller,action) parameters, it will scan through the URL routing table and find the first match (multiple routes can point to the same controller/action), using that for the resulting URL.
(2) If called with an URL fragment (eg, /blog/post), it will build a relative URL using the DIR_WS_BASE constant, set in your app/config/config.php.
The context of the function parameters varies based on the context with which this function is called.
| string | $controller Either the name of the controller, or the URL fragment. | |
| mixed | $action Either the name of the action, or blank/unused. If called via method (2), then this may be set to FALSE, which will ignore DISPATCH_URL even if it's set. This is needed for building URLs to static resources, such as images, JS, CSS, things that shouldn't be routed through the DISPATCH_URL. |
Definition at line 46 of file util.php.
References $urls, and Registry::get().
Referenced by tpNavigation::_is_active(), tpPager::_pagelink(), tpNavigation::_submenu(), tpTable::build_grid(), Web::check_access(), Web::enable_debug(), Web::redirect(), and Page_Base::redirect_to_referrer().
| yesno | ( | $ | int | ) |
Similar to array_yesno(), but returns the actual string value ("Yes" or "No") based on the integer provided.
Definition at line 343 of file util.php.
References __().
1.6.1