id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
6,300
teeebor/decoy-framework
Application.php
Application.getInvokablesFromModule
private function getInvokablesFromModule(array $invokable) { foreach ($invokable as $key => $path) { $this->invokable[$key] = $path; } }
php
private function getInvokablesFromModule(array $invokable) { foreach ($invokable as $key => $path) { $this->invokable[$key] = $path; } }
[ "private", "function", "getInvokablesFromModule", "(", "array", "$", "invokable", ")", "{", "foreach", "(", "$", "invokable", "as", "$", "key", "=>", "$", "path", ")", "{", "$", "this", "->", "invokable", "[", "$", "key", "]", "=", "$", "path", ";", ...
Get all invokable from a module, then assign it to a global list. @param array $invokable
[ "Get", "all", "invokable", "from", "a", "module", "then", "assign", "it", "to", "a", "global", "list", "." ]
3881ae63a7d13088efda5afd3932c1af1fc18b23
https://github.com/teeebor/decoy-framework/blob/3881ae63a7d13088efda5afd3932c1af1fc18b23/Application.php#L323-L328
6,301
teeebor/decoy-framework
Application.php
Application.getViewsFromModule
private function getViewsFromModule(array $views) { foreach ($views as $key => $path) $this->views[$key] = $path; }
php
private function getViewsFromModule(array $views) { foreach ($views as $key => $path) $this->views[$key] = $path; }
[ "private", "function", "getViewsFromModule", "(", "array", "$", "views", ")", "{", "foreach", "(", "$", "views", "as", "$", "key", "=>", "$", "path", ")", "$", "this", "->", "views", "[", "$", "key", "]", "=", "$", "path", ";", "}" ]
Get all view from a module, then assign it to a global list. @param array $views
[ "Get", "all", "view", "from", "a", "module", "then", "assign", "it", "to", "a", "global", "list", "." ]
3881ae63a7d13088efda5afd3932c1af1fc18b23
https://github.com/teeebor/decoy-framework/blob/3881ae63a7d13088efda5afd3932c1af1fc18b23/Application.php#L334-L338
6,302
indigophp-archive/fuel-dependency
classes/Container.php
Container.setDic
public static function setDic(DiC $dic = null) { // if a custom DiC is passed, use that if ($dic) { static::$dic = $dic; } // else set one up if not done yet elseif ( ! static::$dic) { // get us a Dependency Container instance static::$dic = new DiC; // register the DiC on classname so it c...
php
public static function setDic(DiC $dic = null) { // if a custom DiC is passed, use that if ($dic) { static::$dic = $dic; } // else set one up if not done yet elseif ( ! static::$dic) { // get us a Dependency Container instance static::$dic = new DiC; // register the DiC on classname so it c...
[ "public", "static", "function", "setDic", "(", "DiC", "$", "dic", "=", "null", ")", "{", "// if a custom DiC is passed, use that", "if", "(", "$", "dic", ")", "{", "static", "::", "$", "dic", "=", "$", "dic", ";", "}", "// else set one up if not done yet", "...
Sets the DiC @param DiC $dic @return DiC
[ "Sets", "the", "DiC" ]
ce482a2c660ce6325ebed4c7c068119a538913f2
https://github.com/indigophp-archive/fuel-dependency/blob/ce482a2c660ce6325ebed4c7c068119a538913f2/classes/Container.php#L131-L159
6,303
matryoshka-model/service-api
library/Service/HttpClientServiceFactory.php
HttpClientServiceFactory.createService
public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Config'); $client = new Client(); if (!empty($config[$this->configKey])) { $clientOptions = $config[$this->configKey]; if (isset($clientOptions['uri'])) { ...
php
public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Config'); $client = new Client(); if (!empty($config[$this->configKey])) { $clientOptions = $config[$this->configKey]; if (isset($clientOptions['uri'])) { ...
[ "public", "function", "createService", "(", "ServiceLocatorInterface", "$", "serviceLocator", ")", "{", "$", "config", "=", "$", "serviceLocator", "->", "get", "(", "'Config'", ")", ";", "$", "client", "=", "new", "Client", "(", ")", ";", "if", "(", "!", ...
Create a http client service @param ServiceLocatorInterface $serviceLocator @return Client
[ "Create", "a", "http", "client", "service" ]
c188baa8bf4ec8827fde2a9ea1851880778c32c9
https://github.com/matryoshka-model/service-api/blob/c188baa8bf4ec8827fde2a9ea1851880778c32c9/library/Service/HttpClientServiceFactory.php#L32-L60
6,304
unyx/diagnostics
Debug.php
Debug.enable
public static function enable(interfaces\handlers\Error $error = null, interfaces\handlers\Exception $exception = null, $threshold = null) : bool { // Only enable the Handlers once. See the class description for more on this. if (static::$enabled) { return false; } // Re...
php
public static function enable(interfaces\handlers\Error $error = null, interfaces\handlers\Exception $exception = null, $threshold = null) : bool { // Only enable the Handlers once. See the class description for more on this. if (static::$enabled) { return false; } // Re...
[ "public", "static", "function", "enable", "(", "interfaces", "\\", "handlers", "\\", "Error", "$", "error", "=", "null", ",", "interfaces", "\\", "handlers", "\\", "Exception", "$", "exception", "=", "null", ",", "$", "threshold", "=", "null", ")", ":", ...
Enables the bundled Error and Exception Handlers by registering them with PHP. Important note: The return values. When this method returns false, it merely means that the Handlers are already registered and therefore could not be enabled again. This method will only return true for the call that actually enables them....
[ "Enables", "the", "bundled", "Error", "and", "Exception", "Handlers", "by", "registering", "them", "with", "PHP", "." ]
024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e
https://github.com/unyx/diagnostics/blob/024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e/Debug.php#L64-L76
6,305
unyx/diagnostics
Debug.php
Debug.setDumper
public static function setDumper($dumper) { if (!$dumper instanceof interfaces\Dumper && !is_callable($dumper)) { throw new \InvalidArgumentException('Expected an instance of ['.interfaces\Dumper::class.'] or a callable, got ['.static::getTypeName($dumper).'] instead.'); } stati...
php
public static function setDumper($dumper) { if (!$dumper instanceof interfaces\Dumper && !is_callable($dumper)) { throw new \InvalidArgumentException('Expected an instance of ['.interfaces\Dumper::class.'] or a callable, got ['.static::getTypeName($dumper).'] instead.'); } stati...
[ "public", "static", "function", "setDumper", "(", "$", "dumper", ")", "{", "if", "(", "!", "$", "dumper", "instanceof", "interfaces", "\\", "Dumper", "&&", "!", "is_callable", "(", "$", "dumper", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentExcepti...
Sets the Dumper to be used. @param interfaces\Dumper|callable $dumper
[ "Sets", "the", "Dumper", "to", "be", "used", "." ]
024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e
https://github.com/unyx/diagnostics/blob/024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e/Debug.php#L141-L148
6,306
laravelflare/media
src/Media/Media.php
Media.size
public function size($width = null, $height = null) { foreach (\Config::get('flare-config.media.resize') as $sizeArray) { if ($width && $height && ($width == $sizeArray[0]) && ($height == $sizeArray[1])) { return $this->path ? url('uploads/media/'.$sizeArray[0].'-'.(array_key_exi...
php
public function size($width = null, $height = null) { foreach (\Config::get('flare-config.media.resize') as $sizeArray) { if ($width && $height && ($width == $sizeArray[0]) && ($height == $sizeArray[1])) { return $this->path ? url('uploads/media/'.$sizeArray[0].'-'.(array_key_exi...
[ "public", "function", "size", "(", "$", "width", "=", "null", ",", "$", "height", "=", "null", ")", "{", "foreach", "(", "\\", "Config", "::", "get", "(", "'flare-config.media.resize'", ")", "as", "$", "sizeArray", ")", "{", "if", "(", "$", "width", ...
Returns the media link in the requested size. @return
[ "Returns", "the", "media", "link", "in", "the", "requested", "size", "." ]
380a9d3f7c2fc370c2cbd34a77ced87675fc8491
https://github.com/laravelflare/media/blob/380a9d3f7c2fc370c2cbd34a77ced87675fc8491/src/Media/Media.php#L41-L54
6,307
laravelflare/media
src/Media/Media.php
Media.getHumanSizeAttribute
public function getHumanSizeAttribute() { $size = (int) $this->size; if ($size >= 1 << 30) { return number_format($size / (1 << 30), 2).'GB'; } if ($size >= 1 << 20) { return number_format($size / (1 << 20), 2).'MB'; } if ($size >= 1 << 10) ...
php
public function getHumanSizeAttribute() { $size = (int) $this->size; if ($size >= 1 << 30) { return number_format($size / (1 << 30), 2).'GB'; } if ($size >= 1 << 20) { return number_format($size / (1 << 20), 2).'MB'; } if ($size >= 1 << 10) ...
[ "public", "function", "getHumanSizeAttribute", "(", ")", "{", "$", "size", "=", "(", "int", ")", "$", "this", "->", "size", ";", "if", "(", "$", "size", ">=", "1", "<<", "30", ")", "{", "return", "number_format", "(", "$", "size", "/", "(", "1", ...
Convert Media Size to a Human Readable Format. @return string
[ "Convert", "Media", "Size", "to", "a", "Human", "Readable", "Format", "." ]
380a9d3f7c2fc370c2cbd34a77ced87675fc8491
https://github.com/laravelflare/media/blob/380a9d3f7c2fc370c2cbd34a77ced87675fc8491/src/Media/Media.php#L71-L88
6,308
webfactorybulgaria/Attributes
src/Http/Controllers/AttributeGroupsAdminController.php
AttributeGroupsAdminController.index
public function index() { $models = $this->repository->all([], true); app('JavaScript')->put('models', $models); return view('attributes::admin.index-groups'); }
php
public function index() { $models = $this->repository->all([], true); app('JavaScript')->put('models', $models); return view('attributes::admin.index-groups'); }
[ "public", "function", "index", "(", ")", "{", "$", "models", "=", "$", "this", "->", "repository", "->", "all", "(", "[", "]", ",", "true", ")", ";", "app", "(", "'JavaScript'", ")", "->", "put", "(", "'models'", ",", "$", "models", ")", ";", "re...
List models. @return \Illuminate\View\View
[ "List", "models", "." ]
217739dfe7b974a1806d6baf4ea1e1861df24f5f
https://github.com/webfactorybulgaria/Attributes/blob/217739dfe7b974a1806d6baf4ea1e1861df24f5f/src/Http/Controllers/AttributeGroupsAdminController.php#L22-L28
6,309
Niirrty/Niirrty.Web
src/Url.php
Url.checkForOpenRedirect
public function checkForOpenRedirect( $urlForTestContents, $testContents, $useAsRegex = false ) { if ( \count( $this->openRedirectionURLs ) < 1 ) { // If no open redirection URLs was found by isPossibleOpenRedirect(…) we are already done here return false; } // Remember th...
php
public function checkForOpenRedirect( $urlForTestContents, $testContents, $useAsRegex = false ) { if ( \count( $this->openRedirectionURLs ) < 1 ) { // If no open redirection URLs was found by isPossibleOpenRedirect(…) we are already done here return false; } // Remember th...
[ "public", "function", "checkForOpenRedirect", "(", "$", "urlForTestContents", ",", "$", "testContents", ",", "$", "useAsRegex", "=", "false", ")", "{", "if", "(", "\\", "count", "(", "$", "this", "->", "openRedirectionURLs", ")", "<", "1", ")", "{", "// If...
Checks, if possible open redirection bug URLs are defined, if one of it its a real open redirection usage. Attention. It sends a real request to each URL. Do'nt use it inside you're main web application because it blocks it as long if it gets a answer. Maybe better use it in cron jobs or inside a very low frequenced a...
[ "Checks", "if", "possible", "open", "redirection", "bug", "URLs", "are", "defined", "if", "one", "of", "it", "its", "a", "real", "open", "redirection", "usage", "." ]
66185109561e734f8a45e626369de5ac05afc2d5
https://github.com/Niirrty/Niirrty.Web/blob/66185109561e734f8a45e626369de5ac05afc2d5/src/Url.php#L442-L550
6,310
Niirrty/Niirrty.Web
src/Url.php
Url.getScheme
public function getScheme() : string { if ( null === $this->scheme ) { $this->scheme = static::$fallbackScheme; } return $this->scheme; }
php
public function getScheme() : string { if ( null === $this->scheme ) { $this->scheme = static::$fallbackScheme; } return $this->scheme; }
[ "public", "function", "getScheme", "(", ")", ":", "string", "{", "if", "(", "null", "===", "$", "this", "->", "scheme", ")", "{", "$", "this", "->", "scheme", "=", "static", "::", "$", "fallbackScheme", ";", "}", "return", "$", "this", "->", "scheme"...
Gets the URL scheme. Default is 'http' @return string
[ "Gets", "the", "URL", "scheme", ".", "Default", "is", "http" ]
66185109561e734f8a45e626369de5ac05afc2d5
https://github.com/Niirrty/Niirrty.Web/blob/66185109561e734f8a45e626369de5ac05afc2d5/src/Url.php#L583-L593
6,311
Niirrty/Niirrty.Web
src/Url.php
Url.setScheme
public function setScheme( ?string $scheme = null ) : Url { if ( null === $scheme || ! \preg_match( '~^[a-z]{3,7}$~i', $scheme ) ) { $this->scheme = 'http'; return $this; } $this->scheme = $scheme; return $this; }
php
public function setScheme( ?string $scheme = null ) : Url { if ( null === $scheme || ! \preg_match( '~^[a-z]{3,7}$~i', $scheme ) ) { $this->scheme = 'http'; return $this; } $this->scheme = $scheme; return $this; }
[ "public", "function", "setScheme", "(", "?", "string", "$", "scheme", "=", "null", ")", ":", "Url", "{", "if", "(", "null", "===", "$", "scheme", "||", "!", "\\", "preg_match", "(", "'~^[a-z]{3,7}$~i'", ",", "$", "scheme", ")", ")", "{", "$", "this",...
Sets the URL scheme. Default is 'http' if none is defined @param string|null $scheme @return \Niirrty\Web\Url
[ "Sets", "the", "URL", "scheme", ".", "Default", "is", "http", "if", "none", "is", "defined" ]
66185109561e734f8a45e626369de5ac05afc2d5
https://github.com/Niirrty/Niirrty.Web/blob/66185109561e734f8a45e626369de5ac05afc2d5/src/Url.php#L728-L741
6,312
qq1060656096/brief-db
src/Database/Query/Condition.php
Condition.mapConditionOperator
protected function mapConditionOperator($operator) { // $specials does not use drupal_static as its value never changes. static $specials = array( 'BETWEEN' => array('delimiter' => ' AND '), 'IN' => array('delimiter' => ', ', 'prefix' => '(', 'postfix' => ')'), 'NOT I...
php
protected function mapConditionOperator($operator) { // $specials does not use drupal_static as its value never changes. static $specials = array( 'BETWEEN' => array('delimiter' => ' AND '), 'IN' => array('delimiter' => ', ', 'prefix' => '(', 'postfix' => ')'), 'NOT I...
[ "protected", "function", "mapConditionOperator", "(", "$", "operator", ")", "{", "// $specials does not use drupal_static as its value never changes.", "static", "$", "specials", "=", "array", "(", "'BETWEEN'", "=>", "array", "(", "'delimiter'", "=>", "' AND '", ")", ",...
Gets any special processing requirements for the condition operator. Some condition types require special processing, such as IN, because the value data they pass in is not a simple value. This is a simple overridable lookup function. @param $operator The condition operator, such as "IN", "BETWEEN", etc. Case-sensiti...
[ "Gets", "any", "special", "processing", "requirements", "for", "the", "condition", "operator", "." ]
19f693cc107cd6db677aa8385502310526395c7b
https://github.com/qq1060656096/brief-db/blob/19f693cc107cd6db677aa8385502310526395c7b/src/Database/Query/Condition.php#L170-L203
6,313
oaugustus/direct-silex-provider
src/Direct/Router/Call.php
Call.getResponse
public function getResponse($result) { $content = $result->getContent(); if ($result->headers->get('content-type') == 'application/json'){ $content = json_decode($result->getContent(),true); } return array( 'type' => 'rpc', 'tid' => $this->tid, ...
php
public function getResponse($result) { $content = $result->getContent(); if ($result->headers->get('content-type') == 'application/json'){ $content = json_decode($result->getContent(),true); } return array( 'type' => 'rpc', 'tid' => $this->tid, ...
[ "public", "function", "getResponse", "(", "$", "result", ")", "{", "$", "content", "=", "$", "result", "->", "getContent", "(", ")", ";", "if", "(", "$", "result", "->", "headers", "->", "get", "(", "'content-type'", ")", "==", "'application/json'", ")",...
Return a result wrapper to ExtDirect method call. @param array $result @return array
[ "Return", "a", "result", "wrapper", "to", "ExtDirect", "method", "call", "." ]
8d92afdf5ede04c3048cde82b9879de7e1d6c153
https://github.com/oaugustus/direct-silex-provider/blob/8d92afdf5ede04c3048cde82b9879de7e1d6c153/src/Direct/Router/Call.php#L114-L129
6,314
oaugustus/direct-silex-provider
src/Direct/Router/Call.php
Call.getException
public function getException($exception) { return array( 'type' => 'exception', 'tid' => $this->tid, 'action' => $this->action, 'method' => $this->method, 'message' => $exception->getMessage(), 'where' => $exception->getTraceAsString() ); ...
php
public function getException($exception) { return array( 'type' => 'exception', 'tid' => $this->tid, 'action' => $this->action, 'method' => $this->method, 'message' => $exception->getMessage(), 'where' => $exception->getTraceAsString() ); ...
[ "public", "function", "getException", "(", "$", "exception", ")", "{", "return", "array", "(", "'type'", "=>", "'exception'", ",", "'tid'", "=>", "$", "this", "->", "tid", ",", "'action'", "=>", "$", "this", "->", "action", ",", "'method'", "=>", "$", ...
Return an exception to ExtDirect call stack @param \Exception $exception @return array
[ "Return", "an", "exception", "to", "ExtDirect", "call", "stack" ]
8d92afdf5ede04c3048cde82b9879de7e1d6c153
https://github.com/oaugustus/direct-silex-provider/blob/8d92afdf5ede04c3048cde82b9879de7e1d6c153/src/Direct/Router/Call.php#L137-L147
6,315
oaugustus/direct-silex-provider
src/Direct/Router/Call.php
Call.initializeFromSingle
private function initializeFromSingle($call) { $this->action = $call['action']; $this->method = $call['method']; $this->type = $call['type']; $this->tid = $call['tid']; $this->data = (array)$call['data'][0]; }
php
private function initializeFromSingle($call) { $this->action = $call['action']; $this->method = $call['method']; $this->type = $call['type']; $this->tid = $call['tid']; $this->data = (array)$call['data'][0]; }
[ "private", "function", "initializeFromSingle", "(", "$", "call", ")", "{", "$", "this", "->", "action", "=", "$", "call", "[", "'action'", "]", ";", "$", "this", "->", "method", "=", "$", "call", "[", "'method'", "]", ";", "$", "this", "->", "type", ...
Initialize the call properties from a single call. @param array $call
[ "Initialize", "the", "call", "properties", "from", "a", "single", "call", "." ]
8d92afdf5ede04c3048cde82b9879de7e1d6c153
https://github.com/oaugustus/direct-silex-provider/blob/8d92afdf5ede04c3048cde82b9879de7e1d6c153/src/Direct/Router/Call.php#L154-L161
6,316
oaugustus/direct-silex-provider
src/Direct/Router/Call.php
Call.initializeFromForm
private function initializeFromForm($call) { $this->action = $call['extAction']; unset($call['extAction']); $this->method = $call['extMethod']; unset($call['extMethod']); $this->type = $call['extType']; unset($call['extType']); $this->tid = $call['extTID']; unset($call[...
php
private function initializeFromForm($call) { $this->action = $call['extAction']; unset($call['extAction']); $this->method = $call['extMethod']; unset($call['extMethod']); $this->type = $call['extType']; unset($call['extType']); $this->tid = $call['extTID']; unset($call[...
[ "private", "function", "initializeFromForm", "(", "$", "call", ")", "{", "$", "this", "->", "action", "=", "$", "call", "[", "'extAction'", "]", ";", "unset", "(", "$", "call", "[", "'extAction'", "]", ")", ";", "$", "this", "->", "method", "=", "$",...
Initialize the call properties from a form call. @param array $call
[ "Initialize", "the", "call", "properties", "from", "a", "form", "call", "." ]
8d92afdf5ede04c3048cde82b9879de7e1d6c153
https://github.com/oaugustus/direct-silex-provider/blob/8d92afdf5ede04c3048cde82b9879de7e1d6c153/src/Direct/Router/Call.php#L168-L180
6,317
meliorframework/melior
Classes/Registry/SimpleRegistry.php
SimpleRegistry.push
public function push(string $key, $data, bool $override = false) { if (!array_key_exists($key, $this->data) || $override) { $this->data[$key] = $data; return $this->data[$key]; } return false; }
php
public function push(string $key, $data, bool $override = false) { if (!array_key_exists($key, $this->data) || $override) { $this->data[$key] = $data; return $this->data[$key]; } return false; }
[ "public", "function", "push", "(", "string", "$", "key", ",", "$", "data", ",", "bool", "$", "override", "=", "false", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "data", ")", "||", "$", "override", ")", ...
Pushs a value into the registry. @param string $key The registry key to store the value in @param mixed $data The data to store @param bool $override (optional) Whether to override existing keys @return mixed
[ "Pushs", "a", "value", "into", "the", "registry", "." ]
f6469fa6e85f66a0507ae13603d19d78f2774e0b
https://github.com/meliorframework/melior/blob/f6469fa6e85f66a0507ae13603d19d78f2774e0b/Classes/Registry/SimpleRegistry.php#L53-L62
6,318
meliorframework/melior
Classes/Registry/SimpleRegistry.php
SimpleRegistry.get
public function get(string $key) { if (array_key_exists($key, $this->data)) { return $this->data[$key]; } return false; }
php
public function get(string $key) { if (array_key_exists($key, $this->data)) { return $this->data[$key]; } return false; }
[ "public", "function", "get", "(", "string", "$", "key", ")", "{", "if", "(", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "data", ")", ")", "{", "return", "$", "this", "->", "data", "[", "$", "key", "]", ";", "}", "return", "false...
Gets a value from the registry. @param string $key The registry key to retrieve @return mixed
[ "Gets", "a", "value", "from", "the", "registry", "." ]
f6469fa6e85f66a0507ae13603d19d78f2774e0b
https://github.com/meliorframework/melior/blob/f6469fa6e85f66a0507ae13603d19d78f2774e0b/Classes/Registry/SimpleRegistry.php#L71-L78
6,319
easy-system/es-http
src/Uri.php
Uri.encode
public static function encode($value, $ignore = null) { if (null === $ignore) { $ignore = static::CHAR_UNRESERVED . static::CHAR_GEN_DELIMS . static::CHAR_SUB_DELIMS; } $rawurlencode = function (array $matches) { return rawurlen...
php
public static function encode($value, $ignore = null) { if (null === $ignore) { $ignore = static::CHAR_UNRESERVED . static::CHAR_GEN_DELIMS . static::CHAR_SUB_DELIMS; } $rawurlencode = function (array $matches) { return rawurlen...
[ "public", "static", "function", "encode", "(", "$", "value", ",", "$", "ignore", "=", "null", ")", "{", "if", "(", "null", "===", "$", "ignore", ")", "{", "$", "ignore", "=", "static", "::", "CHAR_UNRESERVED", ".", "static", "::", "CHAR_GEN_DELIMS", "....
URI-encode according to RFC 3986. @param string $value The string to be encoded @param string $ignore Optional; service symbols by default. Characters that will not encoded @return string The encoded string
[ "URI", "-", "encode", "according", "to", "RFC", "3986", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uri.php#L110-L126
6,320
easy-system/es-http
src/Uri.php
Uri.withPort
public function withPort($port) { $new = clone $this; try { $new->setPort($port); } catch (InvalidArgumentException $ex) { throw new InvalidArgumentException('Invalid port provided.', null, $ex); } return $new; }
php
public function withPort($port) { $new = clone $this; try { $new->setPort($port); } catch (InvalidArgumentException $ex) { throw new InvalidArgumentException('Invalid port provided.', null, $ex); } return $new; }
[ "public", "function", "withPort", "(", "$", "port", ")", "{", "$", "new", "=", "clone", "$", "this", ";", "try", "{", "$", "new", "->", "setPort", "(", "$", "port", ")", ";", "}", "catch", "(", "InvalidArgumentException", "$", "ex", ")", "{", "thro...
Return an instance with the provided port. A null value provided for the port is equivalent to removing the port information. @param null|int $port The port to use with the new instance; a null value removes the port information @throw \InvalidArgumentException If invalid port provided @return Uri The instance with ...
[ "Return", "an", "instance", "with", "the", "provided", "port", ".", "A", "null", "value", "provided", "for", "the", "port", "is", "equivalent", "to", "removing", "the", "port", "information", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uri.php#L253-L263
6,321
easy-system/es-http
src/Uri.php
Uri.withQuery
public function withQuery($query) { $new = clone $this; try { $new->setQuery($query); } catch (InvalidArgumentException $ex) { throw new InvalidArgumentException('Invalid query provided.', null, $ex); } return $new; }
php
public function withQuery($query) { $new = clone $this; try { $new->setQuery($query); } catch (InvalidArgumentException $ex) { throw new InvalidArgumentException('Invalid query provided.', null, $ex); } return $new; }
[ "public", "function", "withQuery", "(", "$", "query", ")", "{", "$", "new", "=", "clone", "$", "this", ";", "try", "{", "$", "new", "->", "setQuery", "(", "$", "query", ")", ";", "}", "catch", "(", "InvalidArgumentException", "$", "ex", ")", "{", "...
Return an instance with the provided query string. @param string $query The query string to use with the new instance @throws \InvalidArgumentException If invalid query provided @return Uri The instance with the provided query string
[ "Return", "an", "instance", "with", "the", "provided", "query", "string", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uri.php#L378-L388
6,322
easy-system/es-http
src/Uri.php
Uri.fromString
protected function fromString($uri) { if (! is_string($uri)) { throw new InvalidArgumentException(sprintf( '"%s()" expects string; "%s" received.', __METHOD__, is_object($uri) ? get_class($uri) : gettype($uri) )); } $th...
php
protected function fromString($uri) { if (! is_string($uri)) { throw new InvalidArgumentException(sprintf( '"%s()" expects string; "%s" received.', __METHOD__, is_object($uri) ? get_class($uri) : gettype($uri) )); } $th...
[ "protected", "function", "fromString", "(", "$", "uri", ")", "{", "if", "(", "!", "is_string", "(", "$", "uri", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "sprintf", "(", "'\"%s()\" expects string; \"%s\" received.'", ",", "__METHOD__", ",",...
Forms the an object from an URI string. @param string $uri The URI string @throws InvalidArgumentException On non-string $uri argument @return Uri The current instance
[ "Forms", "the", "an", "object", "from", "an", "URI", "string", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uri.php#L499-L525
6,323
easy-system/es-http
src/Uri.php
Uri.setScheme
protected function setScheme($scheme) { $this->uriString = null; $this->scheme = strtolower(rtrim($scheme, ':/')); return $this; }
php
protected function setScheme($scheme) { $this->uriString = null; $this->scheme = strtolower(rtrim($scheme, ':/')); return $this; }
[ "protected", "function", "setScheme", "(", "$", "scheme", ")", "{", "$", "this", "->", "uriString", "=", "null", ";", "$", "this", "->", "scheme", "=", "strtolower", "(", "rtrim", "(", "$", "scheme", ",", "':/'", ")", ")", ";", "return", "$", "this",...
Sets the URI scheme to current instance. @param string $scheme The URI scheme @return Uri The current instance with the provided scheme
[ "Sets", "the", "URI", "scheme", "to", "current", "instance", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uri.php#L534-L541
6,324
easy-system/es-http
src/Uri.php
Uri.setUserInfo
protected function setUserInfo($user = '', $password = '') { $this->uriString = null; if (! $user) { $this->userInfo = ''; return $this; } $this->userInfo = rtrim($user, '@'); if ($password) { $this->userInfo .= ':' . $password; ...
php
protected function setUserInfo($user = '', $password = '') { $this->uriString = null; if (! $user) { $this->userInfo = ''; return $this; } $this->userInfo = rtrim($user, '@'); if ($password) { $this->userInfo .= ':' . $password; ...
[ "protected", "function", "setUserInfo", "(", "$", "user", "=", "''", ",", "$", "password", "=", "''", ")", "{", "$", "this", "->", "uriString", "=", "null", ";", "if", "(", "!", "$", "user", ")", "{", "$", "this", "->", "userInfo", "=", "''", ";"...
Sets the provided user information to current instance. @param string $user The user name to use for authority @param string $password The password associated with $user @return Uri The current instance with the provided user information
[ "Sets", "the", "provided", "user", "information", "to", "current", "instance", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uri.php#L551-L567
6,325
easy-system/es-http
src/Uri.php
Uri.setHost
protected function setHost($host) { $this->uriString = null; $this->host = (string) $host; return $this; }
php
protected function setHost($host) { $this->uriString = null; $this->host = (string) $host; return $this; }
[ "protected", "function", "setHost", "(", "$", "host", ")", "{", "$", "this", "->", "uriString", "=", "null", ";", "$", "this", "->", "host", "=", "(", "string", ")", "$", "host", ";", "return", "$", "this", ";", "}" ]
Sets the provided host to current instance. @param string $host The hostname @return Uri The current instance with the provided host
[ "Sets", "the", "provided", "host", "to", "current", "instance", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uri.php#L576-L583
6,326
easy-system/es-http
src/Uri.php
Uri.setPort
protected function setPort($port) { $this->uriString = null; if (null === $port) { $this->port = null; return $this; } if (! $this->isPortValid($port)) { throw new InvalidArgumentException(sprintf( 'Invalid port "%s" provided.', ...
php
protected function setPort($port) { $this->uriString = null; if (null === $port) { $this->port = null; return $this; } if (! $this->isPortValid($port)) { throw new InvalidArgumentException(sprintf( 'Invalid port "%s" provided.', ...
[ "protected", "function", "setPort", "(", "$", "port", ")", "{", "$", "this", "->", "uriString", "=", "null", ";", "if", "(", "null", "===", "$", "port", ")", "{", "$", "this", "->", "port", "=", "null", ";", "return", "$", "this", ";", "}", "if",...
Sets the provided port to current instance. @param null|int $port The port; a null value removes the port information @throw \InvalidArgumentException For invalid ports @return Uri The current instance with the provided port
[ "Sets", "the", "provided", "port", "to", "current", "instance", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uri.php#L594-L613
6,327
easy-system/es-http
src/Uri.php
Uri.setPath
protected function setPath($path) { $this->uriString = null; $path = (string) $path; if (strpos($path, '?') !== false) { throw new InvalidArgumentException( 'Invalid path provided; must not contain a query string.' ); } if (strpos($p...
php
protected function setPath($path) { $this->uriString = null; $path = (string) $path; if (strpos($path, '?') !== false) { throw new InvalidArgumentException( 'Invalid path provided; must not contain a query string.' ); } if (strpos($p...
[ "protected", "function", "setPath", "(", "$", "path", ")", "{", "$", "this", "->", "uriString", "=", "null", ";", "$", "path", "=", "(", "string", ")", "$", "path", ";", "if", "(", "strpos", "(", "$", "path", ",", "'?'", ")", "!==", "false", ")",...
Sets the provided path to current instance. @param string $path The path @throws \InvalidArgumentException If path contain query string or URI fragment @return Uri The current instance with the provided path
[ "Sets", "the", "provided", "path", "to", "current", "instance", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uri.php#L625-L646
6,328
easy-system/es-http
src/Uri.php
Uri.setQuery
protected function setQuery($query) { $this->uriString = null; $query = ltrim($query, '?'); if (strpos($query, '#') !== false) { throw new InvalidArgumentException( 'Query string must not include a URI fragment.' ); } $this->query = ...
php
protected function setQuery($query) { $this->uriString = null; $query = ltrim($query, '?'); if (strpos($query, '#') !== false) { throw new InvalidArgumentException( 'Query string must not include a URI fragment.' ); } $this->query = ...
[ "protected", "function", "setQuery", "(", "$", "query", ")", "{", "$", "this", "->", "uriString", "=", "null", ";", "$", "query", "=", "ltrim", "(", "$", "query", ",", "'?'", ")", ";", "if", "(", "strpos", "(", "$", "query", ",", "'#'", ")", "!==...
Sets the provided query string to current instance. @param string $query The query string @throws \InvalidArgumentException If query string contain URI fragment @return Uri The current instance with the provided query string
[ "Sets", "the", "provided", "query", "string", "to", "current", "instance", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uri.php#L657-L672
6,329
easy-system/es-http
src/Uri.php
Uri.setFragment
protected function setFragment($fragment) { $this->uriString = null; $fragment = ltrim($fragment, '#'); $this->fragment = static::encode($fragment); return $this; }
php
protected function setFragment($fragment) { $this->uriString = null; $fragment = ltrim($fragment, '#'); $this->fragment = static::encode($fragment); return $this; }
[ "protected", "function", "setFragment", "(", "$", "fragment", ")", "{", "$", "this", "->", "uriString", "=", "null", ";", "$", "fragment", "=", "ltrim", "(", "$", "fragment", ",", "'#'", ")", ";", "$", "this", "->", "fragment", "=", "static", "::", "...
Sets the provided URI fragment to current instance. @param type $fragment The URI fragment @return Uri The current instance with the provided URI fragment
[ "Sets", "the", "provided", "URI", "fragment", "to", "current", "instance", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uri.php#L681-L690
6,330
wasabi-cms/cms
src/Controller/SettingsController.php
SettingsController.theme
public function theme() { $keys = [ 'Theme_id' ]; /** @var ThemeSettingsTable $ThemeSettings */ $ThemeSettings = $this->loadModel('Wasabi/Cms.ThemeSettings'); $settings = $ThemeSettings->getKeyValues(new GeneralSetting(), $keys); if ($this->request->is(...
php
public function theme() { $keys = [ 'Theme_id' ]; /** @var ThemeSettingsTable $ThemeSettings */ $ThemeSettings = $this->loadModel('Wasabi/Cms.ThemeSettings'); $settings = $ThemeSettings->getKeyValues(new GeneralSetting(), $keys); if ($this->request->is(...
[ "public", "function", "theme", "(", ")", "{", "$", "keys", "=", "[", "'Theme_id'", "]", ";", "/** @var ThemeSettingsTable $ThemeSettings */", "$", "ThemeSettings", "=", "$", "this", "->", "loadModel", "(", "'Wasabi/Cms.ThemeSettings'", ")", ";", "$", "settings", ...
theme action GET | POST
[ "theme", "action", "GET", "|", "POST" ]
2787b6422ea1d719cf49951b3253fd0ac31d22ca
https://github.com/wasabi-cms/cms/blob/2787b6422ea1d719cf49951b3253fd0ac31d22ca/src/Controller/SettingsController.php#L19-L48
6,331
wasabi-cms/cms
src/Controller/SettingsController.php
SettingsController.seo
public function seo() { $keys = [ 'SEO__application-name', 'SEO__google-site-verification', 'SEO__meta-robots-index', 'SEO__meta-robots-follow', 'SEO__meta-robots-noodp', 'SEO__display-search-box', 'SEO__Social__facebook_url...
php
public function seo() { $keys = [ 'SEO__application-name', 'SEO__google-site-verification', 'SEO__meta-robots-index', 'SEO__meta-robots-follow', 'SEO__meta-robots-noodp', 'SEO__display-search-box', 'SEO__Social__facebook_url...
[ "public", "function", "seo", "(", ")", "{", "$", "keys", "=", "[", "'SEO__application-name'", ",", "'SEO__google-site-verification'", ",", "'SEO__meta-robots-index'", ",", "'SEO__meta-robots-follow'", ",", "'SEO__meta-robots-noodp'", ",", "'SEO__display-search-box'", ",", ...
seo action GET | POST
[ "seo", "action", "GET", "|", "POST" ]
2787b6422ea1d719cf49951b3253fd0ac31d22ca
https://github.com/wasabi-cms/cms/blob/2787b6422ea1d719cf49951b3253fd0ac31d22ca/src/Controller/SettingsController.php#L54-L97
6,332
Fenzland/Htsl.php
libs/Parser/Node/TagNode.php
TagNode.open
public function open():string { if( isset($this->config['opener']) ) { return $this->config['opener']; } $this->parsePrivateAttributes(); $this->parseCommonAttributes(); if( isset($this->config['in_scope']) && isset($this->config['scope_function']) && is_callable($this->config['scope_function']) ) { $t...
php
public function open():string { if( isset($this->config['opener']) ) { return $this->config['opener']; } $this->parsePrivateAttributes(); $this->parseCommonAttributes(); if( isset($this->config['in_scope']) && isset($this->config['scope_function']) && is_callable($this->config['scope_function']) ) { $t...
[ "public", "function", "open", "(", ")", ":", "string", "{", "if", "(", "isset", "(", "$", "this", "->", "config", "[", "'opener'", "]", ")", ")", "{", "return", "$", "this", "->", "config", "[", "'opener'", "]", ";", "}", "$", "this", "->", "pars...
Opening this tag node, and returning node opener. @access public @return string
[ "Opening", "this", "tag", "node", "and", "returning", "node", "opener", "." ]
28ecc4afd1a5bdb29dea3589c8132adba87f3947
https://github.com/Fenzland/Htsl.php/blob/28ecc4afd1a5bdb29dea3589c8132adba87f3947/libs/Parser/Node/TagNode.php#L84-L98
6,333
Fenzland/Htsl.php
libs/Parser/Node/TagNode.php
TagNode.sectionLedBy
protected function sectionLedBy( string$leader, bool$allowSpace=false ):string { return $this->line->pregGet(...[ ( '/ '.preg_quote($leader) . ($allowSpace? '((?!\()(?:[^ ]| (?=[a-zA-Z0-9]))+' : '([^ ]+' ) . '|(?<exp>\((?:[^()]+|(?&exp)?)+?\)))(?= |$)/' ), 1, ]); }
php
protected function sectionLedBy( string$leader, bool$allowSpace=false ):string { return $this->line->pregGet(...[ ( '/ '.preg_quote($leader) . ($allowSpace? '((?!\()(?:[^ ]| (?=[a-zA-Z0-9]))+' : '([^ ]+' ) . '|(?<exp>\((?:[^()]+|(?&exp)?)+?\)))(?= |$)/' ), 1, ]); }
[ "protected", "function", "sectionLedBy", "(", "string", "$", "leader", ",", "bool", "$", "allowSpace", "=", "false", ")", ":", "string", "{", "return", "$", "this", "->", "line", "->", "pregGet", "(", "...", "[", "(", "'/ '", ".", "preg_quote", "(", "$...
Getting tag section with given leader. @access protected @param string $leader @param boool $allowSpace @return string
[ "Getting", "tag", "section", "with", "given", "leader", "." ]
28ecc4afd1a5bdb29dea3589c8132adba87f3947
https://github.com/Fenzland/Htsl.php/blob/28ecc4afd1a5bdb29dea3589c8132adba87f3947/libs/Parser/Node/TagNode.php#L215-L231
6,334
Fenzland/Htsl.php
libs/Parser/Node/TagNode.php
TagNode.setMultinameAttribute
private function setMultinameAttribute( string$name, string$value, callable$processer=null ):self { if( strlen($value) && !empty($this->config[$name]) ){ return $this->setAttribute($this->config[$name],call_user_func($processer??[$this,'checkExpression',],$value)); } return $this; }
php
private function setMultinameAttribute( string$name, string$value, callable$processer=null ):self { if( strlen($value) && !empty($this->config[$name]) ){ return $this->setAttribute($this->config[$name],call_user_func($processer??[$this,'checkExpression',],$value)); } return $this; }
[ "private", "function", "setMultinameAttribute", "(", "string", "$", "name", ",", "string", "$", "value", ",", "callable", "$", "processer", "=", "null", ")", ":", "self", "{", "if", "(", "strlen", "(", "$", "value", ")", "&&", "!", "empty", "(", "$", ...
Setting attribute whitch has same name in HTSL but different name in HTML. @access private @param string $name Attribute name of HTSL @param string $value Attribute value @param callable|null $processer @return \Htsl\Parser\Node\TagNode
[ "Setting", "attribute", "whitch", "has", "same", "name", "in", "HTSL", "but", "different", "name", "in", "HTML", "." ]
28ecc4afd1a5bdb29dea3589c8132adba87f3947
https://github.com/Fenzland/Htsl.php/blob/28ecc4afd1a5bdb29dea3589c8132adba87f3947/libs/Parser/Node/TagNode.php#L290-L297
6,335
Fenzland/Htsl.php
libs/Parser/Node/TagNode.php
TagNode.checkExpression
protected function checkExpression( string$value ):string { return preg_match('/^\(.*\)$/',$value) ? '<?=str_replace(\'"\',\'&quot;\','.substr($value,1,-1).')?>' : str_replace('"','&quot;',$value); }
php
protected function checkExpression( string$value ):string { return preg_match('/^\(.*\)$/',$value) ? '<?=str_replace(\'"\',\'&quot;\','.substr($value,1,-1).')?>' : str_replace('"','&quot;',$value); }
[ "protected", "function", "checkExpression", "(", "string", "$", "value", ")", ":", "string", "{", "return", "preg_match", "(", "'/^\\(.*\\)$/'", ",", "$", "value", ")", "?", "'<?=str_replace(\\'\"\\',\\'&quot;\\','", ".", "substr", "(", "$", "value", ",", "1", ...
Checking and parse PHP expressions. @access protected @param string $value @return string
[ "Checking", "and", "parse", "PHP", "expressions", "." ]
28ecc4afd1a5bdb29dea3589c8132adba87f3947
https://github.com/Fenzland/Htsl.php/blob/28ecc4afd1a5bdb29dea3589c8132adba87f3947/libs/Parser/Node/TagNode.php#L348-L351
6,336
Fenzland/Htsl.php
libs/Parser/Node/TagNode.php
TagNode.getAttributesString
protected function getAttributesString():string { ksort($this->attributes); return implode('',array_map(static function( string$key, array$data ){ return (isset($data['condition'])&&strlen($data['condition'])? "<?php if( {$data['condition']} ){?> $key=\"{$data['value']}\"<?php }?>" : " $key=\"{$data...
php
protected function getAttributesString():string { ksort($this->attributes); return implode('',array_map(static function( string$key, array$data ){ return (isset($data['condition'])&&strlen($data['condition'])? "<?php if( {$data['condition']} ){?> $key=\"{$data['value']}\"<?php }?>" : " $key=\"{$data...
[ "protected", "function", "getAttributesString", "(", ")", ":", "string", "{", "ksort", "(", "$", "this", "->", "attributes", ")", ";", "return", "implode", "(", "''", ",", "array_map", "(", "static", "function", "(", "string", "$", "key", ",", "array", "...
Getting attribute string with HTML syntax. @access protected @return string
[ "Getting", "attribute", "string", "with", "HTML", "syntax", "." ]
28ecc4afd1a5bdb29dea3589c8132adba87f3947
https://github.com/Fenzland/Htsl.php/blob/28ecc4afd1a5bdb29dea3589c8132adba87f3947/libs/Parser/Node/TagNode.php#L360-L370
6,337
Fenzland/Htsl.php
libs/Parser/Node/TagNode.php
TagNode.setAttribute
protected function setAttribute( string$key, string$value, string$condition=null ):self { if( isset($this->attributes[$key]) ) { $this->document->throw("Attribute $key of $this->name cannot redeclare."); } $this->attributes[$key]=[ 'value'=> $value, 'condition'=> $condition, ]; return $this; }
php
protected function setAttribute( string$key, string$value, string$condition=null ):self { if( isset($this->attributes[$key]) ) { $this->document->throw("Attribute $key of $this->name cannot redeclare."); } $this->attributes[$key]=[ 'value'=> $value, 'condition'=> $condition, ]; return $this; }
[ "protected", "function", "setAttribute", "(", "string", "$", "key", ",", "string", "$", "value", ",", "string", "$", "condition", "=", "null", ")", ":", "self", "{", "if", "(", "isset", "(", "$", "this", "->", "attributes", "[", "$", "key", "]", ")",...
Setting attribute. @access protected @param string $key Attribute name. @param string $value Attribute value @param string|null $condition Optional condition, If given, attribute will seted only when condition is true.
[ "Setting", "attribute", "." ]
28ecc4afd1a5bdb29dea3589c8132adba87f3947
https://github.com/Fenzland/Htsl.php/blob/28ecc4afd1a5bdb29dea3589c8132adba87f3947/libs/Parser/Node/TagNode.php#L381-L392
6,338
agalbourdin/agl-core
src/Data/String.php
String.toCamelCase
public static function toCamelCase($pStr, $pCapitaliseFirstChar = true) { if (empty($pStr)) { return $pStr; } $pStr = strtolower($pStr); if ($pCapitaliseFirstChar) { $pStr[0] = strtoupper($pStr[0]); } return preg_replace_callback('/_([a-z])/...
php
public static function toCamelCase($pStr, $pCapitaliseFirstChar = true) { if (empty($pStr)) { return $pStr; } $pStr = strtolower($pStr); if ($pCapitaliseFirstChar) { $pStr[0] = strtoupper($pStr[0]); } return preg_replace_callback('/_([a-z])/...
[ "public", "static", "function", "toCamelCase", "(", "$", "pStr", ",", "$", "pCapitaliseFirstChar", "=", "true", ")", "{", "if", "(", "empty", "(", "$", "pStr", ")", ")", "{", "return", "$", "pStr", ";", "}", "$", "pStr", "=", "strtolower", "(", "$", ...
Create a camel-case string. @param string $pStr Chaîne au format classique (avec "_") @param bool $pCapitaliseFirstChar Make the first char uppercase @return string Camel-case string
[ "Create", "a", "camel", "-", "case", "string", "." ]
1db556f9a49488aa9fab6887fefb7141a79ad97d
https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Data/String.php#L43-L59
6,339
agalbourdin/agl-core
src/Data/String.php
String.fromCamelCase
public static function fromCamelCase($pStr) { if (empty($pStr)) { return $pStr; } $pStr[0] = strtolower($pStr[0]); return preg_replace_callback('/([A-Z])/', function ($pMatches) { return '_' . strtolower($pMatches[0]); }, $pStr); ...
php
public static function fromCamelCase($pStr) { if (empty($pStr)) { return $pStr; } $pStr[0] = strtolower($pStr[0]); return preg_replace_callback('/([A-Z])/', function ($pMatches) { return '_' . strtolower($pMatches[0]); }, $pStr); ...
[ "public", "static", "function", "fromCamelCase", "(", "$", "pStr", ")", "{", "if", "(", "empty", "(", "$", "pStr", ")", ")", "{", "return", "$", "pStr", ";", "}", "$", "pStr", "[", "0", "]", "=", "strtolower", "(", "$", "pStr", "[", "0", "]", "...
Revert a camel-case. @param string $pStr Camel-case string @return string Converted string
[ "Revert", "a", "camel", "-", "case", "." ]
1db556f9a49488aa9fab6887fefb7141a79ad97d
https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Data/String.php#L67-L79
6,340
agalbourdin/agl-core
src/Data/String.php
String.getRandomString
public static function getRandomString($pLength = 6, $pStrength = 1) { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; if ($pStrength >= 1) { $chars .= '0123456789'; } if ($pStrength >= 2) { $strengthChars = '@#$%'; $chars .= $strength...
php
public static function getRandomString($pLength = 6, $pStrength = 1) { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; if ($pStrength >= 1) { $chars .= '0123456789'; } if ($pStrength >= 2) { $strengthChars = '@#$%'; $chars .= $strength...
[ "public", "static", "function", "getRandomString", "(", "$", "pLength", "=", "6", ",", "$", "pStrength", "=", "1", ")", "{", "$", "chars", "=", "'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'", ";", "if", "(", "$", "pStrength", ">=", "1", ")", "{", "...
Return a random string with a variable length and strength. @param int $pLength Length of the string to generate @param int $pStrength Strength of the string to generate @return string Random string
[ "Return", "a", "random", "string", "with", "a", "variable", "length", "and", "strength", "." ]
1db556f9a49488aa9fab6887fefb7141a79ad97d
https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Data/String.php#L88-L111
6,341
agalbourdin/agl-core
src/Data/String.php
String.truncate
public static function truncate($pStr, $pLimit, $pEnd = '...') { $str = strip_tags($pStr); $length = mb_strlen($str); if ($length <= $pLimit) { return $str; } return trim(mb_substr($str, 0, $pLimit)) . $pEnd; }
php
public static function truncate($pStr, $pLimit, $pEnd = '...') { $str = strip_tags($pStr); $length = mb_strlen($str); if ($length <= $pLimit) { return $str; } return trim(mb_substr($str, 0, $pLimit)) . $pEnd; }
[ "public", "static", "function", "truncate", "(", "$", "pStr", ",", "$", "pLimit", ",", "$", "pEnd", "=", "'...'", ")", "{", "$", "str", "=", "strip_tags", "(", "$", "pStr", ")", ";", "$", "length", "=", "mb_strlen", "(", "$", "str", ")", ";", "if...
Truncate a string and add an optional suffix. @param string $pStr String to truncate @param int $pLimit Length of the string to return @param string $pEnd Suffix
[ "Truncate", "a", "string", "and", "add", "an", "optional", "suffix", "." ]
1db556f9a49488aa9fab6887fefb7141a79ad97d
https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Data/String.php#L120-L129
6,342
wearenolte/wp-widgets
src/Models/AbstractWidget.php
AbstractWidget.get_data
public function get_data() { $settings = $this->get_settings()[ $this->number ]; return array_merge( [ 'title' => $settings['title'] ], Acf::get_widget_field( $this->id ) ); }
php
public function get_data() { $settings = $this->get_settings()[ $this->number ]; return array_merge( [ 'title' => $settings['title'] ], Acf::get_widget_field( $this->id ) ); }
[ "public", "function", "get_data", "(", ")", "{", "$", "settings", "=", "$", "this", "->", "get_settings", "(", ")", "[", "$", "this", "->", "number", "]", ";", "return", "array_merge", "(", "[", "'title'", "=>", "$", "settings", "[", "'title'", "]", ...
Get the widget's data @return mixed
[ "Get", "the", "widget", "s", "data" ]
7b008dc3182f8b9da44657bd2fe714e7e48cf002
https://github.com/wearenolte/wp-widgets/blob/7b008dc3182f8b9da44657bd2fe714e7e48cf002/src/Models/AbstractWidget.php#L53-L60
6,343
mrcoco/phalms-core
user/forms/SignUpForm.php
SignUpForm.messages
public function messages($name) { if ($this->hasMessagesFor($name)) { foreach ($this->getMessagesFor($name) as $message) { $this->flash->error($message); } } }
php
public function messages($name) { if ($this->hasMessagesFor($name)) { foreach ($this->getMessagesFor($name) as $message) { $this->flash->error($message); } } }
[ "public", "function", "messages", "(", "$", "name", ")", "{", "if", "(", "$", "this", "->", "hasMessagesFor", "(", "$", "name", ")", ")", "{", "foreach", "(", "$", "this", "->", "getMessagesFor", "(", "$", "name", ")", "as", "$", "message", ")", "{...
Prints messages for a specific element
[ "Prints", "messages", "for", "a", "specific", "element" ]
23486c3e75077896e708f0d2e257cde280a79ad4
https://github.com/mrcoco/phalms-core/blob/23486c3e75077896e708f0d2e257cde280a79ad4/user/forms/SignUpForm.php#L122-L129
6,344
Dhii/container-helper-base
src/ContainerSetPathCapableTrait.php
ContainerSetPathCapableTrait._containerSetPath
protected function _containerSetPath(&$container, $path, $value) { $path = $this->_normalizeArray($path); $pathLength = count($path); if (!$pathLength) { throw $this->_createInvalidArgumentException($this->__('Path is empty'), null, null, $container); } if...
php
protected function _containerSetPath(&$container, $path, $value) { $path = $this->_normalizeArray($path); $pathLength = count($path); if (!$pathLength) { throw $this->_createInvalidArgumentException($this->__('Path is empty'), null, null, $container); } if...
[ "protected", "function", "_containerSetPath", "(", "&", "$", "container", ",", "$", "path", ",", "$", "value", ")", "{", "$", "path", "=", "$", "this", "->", "_normalizeArray", "(", "$", "path", ")", ";", "$", "pathLength", "=", "count", "(", "$", "p...
Sets data on the nested container. @since [*next-version*] @param array|ArrayAccess|stdClass|BaseContainerInterface $container The top container in the chain. @param array|Traversable|stdClass $path The list of path segments. @param mixed $value ...
[ "Sets", "data", "on", "the", "nested", "container", "." ]
ccb2f56971d70cf203baa596cd14fdf91be6bfae
https://github.com/Dhii/container-helper-base/blob/ccb2f56971d70cf203baa596cd14fdf91be6bfae/src/ContainerSetPathCapableTrait.php#L37-L59
6,345
bishopb/vanilla
library/core/class.form.php
Gdn_Form.BodyBox
public function BodyBox($Column = 'Body', $Attributes = array()) { TouchValue('MultiLine', $Attributes, TRUE); TouchValue('format', $Attributes, $this->GetValue('Format', C('Garden.InputFormatter'))); TouchValue('Wrap', $Attributes, TRUE); TouchValue('class', $Attributes, ''); $Attributes[...
php
public function BodyBox($Column = 'Body', $Attributes = array()) { TouchValue('MultiLine', $Attributes, TRUE); TouchValue('format', $Attributes, $this->GetValue('Format', C('Garden.InputFormatter'))); TouchValue('Wrap', $Attributes, TRUE); TouchValue('class', $Attributes, ''); $Attributes[...
[ "public", "function", "BodyBox", "(", "$", "Column", "=", "'Body'", ",", "$", "Attributes", "=", "array", "(", ")", ")", "{", "TouchValue", "(", "'MultiLine'", ",", "$", "Attributes", ",", "TRUE", ")", ";", "TouchValue", "(", "'format'", ",", "$", "Att...
A special text box for formattable text. Formatting plugins like ButtonBar will auto-attach to this element. @param string $Column @param array $Attributes @since 2.1 @return string HTML element.
[ "A", "special", "text", "box", "for", "formattable", "text", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L150-L164
6,346
bishopb/vanilla
library/core/class.form.php
Gdn_Form.Button
public function Button($ButtonCode, $Attributes = FALSE) { $Type = ArrayValueI('type', $Attributes); if ($Type === FALSE) $Type = 'submit'; $CssClass = ArrayValueI('class', $Attributes); if ($CssClass === FALSE) $Attributes['class'] = 'Button'; $Return = '<input type="' . $Type . '"'; ...
php
public function Button($ButtonCode, $Attributes = FALSE) { $Type = ArrayValueI('type', $Attributes); if ($Type === FALSE) $Type = 'submit'; $CssClass = ArrayValueI('class', $Attributes); if ($CssClass === FALSE) $Attributes['class'] = 'Button'; $Return = '<input type="' . $Type . '"'; ...
[ "public", "function", "Button", "(", "$", "ButtonCode", ",", "$", "Attributes", "=", "FALSE", ")", "{", "$", "Type", "=", "ArrayValueI", "(", "'type'", ",", "$", "Attributes", ")", ";", "if", "(", "$", "Type", "===", "FALSE", ")", "$", "Type", "=", ...
Returns XHTML for a button. @param string $ButtonCode The translation code for the text on the button. @param array $Attributes An associative array of attributes for the button. Here is a list of "special" attributes and their default values: Attribute Options Default -------------------------...
[ "Returns", "XHTML", "for", "a", "button", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L179-L193
6,347
bishopb/vanilla
library/core/class.form.php
Gdn_Form.Calendar
public function Calendar($FieldName, $Attributes = FALSE) { // TODO: CREATE A CALENDAR HELPER CLASS AND LOAD/REFERENCE IT HERE. // THE CLASS SHOULD BE DECLARED WITH: // if (!class_exists('Calendar') { // AT THE BEGINNING SO OTHERS CAN OVERRIDE THE DEFAULT CALENDAR WITH ONE // OF THEIR OWN...
php
public function Calendar($FieldName, $Attributes = FALSE) { // TODO: CREATE A CALENDAR HELPER CLASS AND LOAD/REFERENCE IT HERE. // THE CLASS SHOULD BE DECLARED WITH: // if (!class_exists('Calendar') { // AT THE BEGINNING SO OTHERS CAN OVERRIDE THE DEFAULT CALENDAR WITH ONE // OF THEIR OWN...
[ "public", "function", "Calendar", "(", "$", "FieldName", ",", "$", "Attributes", "=", "FALSE", ")", "{", "// TODO: CREATE A CALENDAR HELPER CLASS AND LOAD/REFERENCE IT HERE.", "// THE CLASS SHOULD BE DECLARED WITH:", "// if (!class_exists('Calendar') {", "// AT THE BEGINNING SO OTHE...
Returns XHTML for a standard calendar input control. @param string $FieldName The name of the field that is being displayed/posted with this input. It should related directly to a field name in $this->_DataArray. @param array $Attributes An associative array of attributes for the input. ie. onclick, class, etc @return...
[ "Returns", "XHTML", "for", "a", "standard", "calendar", "input", "control", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L204-L216
6,348
bishopb/vanilla
library/core/class.form.php
Gdn_Form.CheckBox
public function CheckBox($FieldName, $Label = '', $Attributes = FALSE) { $Value = ArrayValueI('value', $Attributes, true); $Attributes['value'] = $Value; if ($this->GetValue($FieldName) == $Value) $Attributes['checked'] = 'checked'; // Show inline errors? $ShowErrors = ...
php
public function CheckBox($FieldName, $Label = '', $Attributes = FALSE) { $Value = ArrayValueI('value', $Attributes, true); $Attributes['value'] = $Value; if ($this->GetValue($FieldName) == $Value) $Attributes['checked'] = 'checked'; // Show inline errors? $ShowErrors = ...
[ "public", "function", "CheckBox", "(", "$", "FieldName", ",", "$", "Label", "=", "''", ",", "$", "Attributes", "=", "FALSE", ")", "{", "$", "Value", "=", "ArrayValueI", "(", "'value'", ",", "$", "Attributes", ",", "true", ")", ";", "$", "Attributes", ...
Returns XHTML for a checkbox input element. Cannot consider all checkbox values to be boolean. (2009-04-02 mosullivan) Cannot assume checkboxes are stored in database as string 'TRUE'. (2010-07-28 loki_racer) @param string $FieldName Name of the field that is being displayed/posted with this input. It should related ...
[ "Returns", "XHTML", "for", "a", "checkbox", "input", "element", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L342-L366
6,349
bishopb/vanilla
library/core/class.form.php
Gdn_Form.CheckBoxList
public function CheckBoxList($FieldName, $DataSet, $ValueDataSet = NULL, $Attributes = FALSE) { // Never display individual inline errors for these CheckBoxes $Attributes['InlineErrors'] = FALSE; $Return = ''; // If the form hasn't been posted back, use the provided $ValueDataSet if...
php
public function CheckBoxList($FieldName, $DataSet, $ValueDataSet = NULL, $Attributes = FALSE) { // Never display individual inline errors for these CheckBoxes $Attributes['InlineErrors'] = FALSE; $Return = ''; // If the form hasn't been posted back, use the provided $ValueDataSet if...
[ "public", "function", "CheckBoxList", "(", "$", "FieldName", ",", "$", "DataSet", ",", "$", "ValueDataSet", "=", "NULL", ",", "$", "Attributes", "=", "FALSE", ")", "{", "// Never display individual inline errors for these CheckBoxes", "$", "Attributes", "[", "'Inlin...
Returns the XHTML for a list of checkboxes. @param string $FieldName Name of the field being posted with this input. @param mixed $DataSet Data to fill the checkbox list. Either an associative array or a database dataset. ex: RoleID, Name from GDN_Role. @param mixed $ValueDataSet Values to be pre-checked in $DataSet...
[ "Returns", "the", "XHTML", "for", "a", "list", "of", "checkboxes", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L392-L459
6,350
bishopb/vanilla
library/core/class.form.php
Gdn_Form.CheckBoxGrid
public function CheckBoxGrid($FieldName, $DataSet, $ValueDataSet, $Attributes) { // Never display individual inline errors for these CheckBoxes $Attributes['InlineErrors'] = FALSE; $Return = ''; $CheckedValues = $ValueDataSet; if (is_object($ValueDataSet)) $CheckedValues = Consolida...
php
public function CheckBoxGrid($FieldName, $DataSet, $ValueDataSet, $Attributes) { // Never display individual inline errors for these CheckBoxes $Attributes['InlineErrors'] = FALSE; $Return = ''; $CheckedValues = $ValueDataSet; if (is_object($ValueDataSet)) $CheckedValues = Consolida...
[ "public", "function", "CheckBoxGrid", "(", "$", "FieldName", ",", "$", "DataSet", ",", "$", "ValueDataSet", ",", "$", "Attributes", ")", "{", "// Never display individual inline errors for these CheckBoxes", "$", "Attributes", "[", "'InlineErrors'", "]", "=", "FALSE",...
Returns the xhtml for a list of checkboxes; sorted into groups related to the TextField value of the dataset. @param string $FieldName The name of the field that is being displayed/posted with this input. It should related directly to a field name in a user junction table. ie. LUM_UserRole.RoleID @param mixed $DataSe...
[ "Returns", "the", "xhtml", "for", "a", "list", "of", "checkboxes", ";", "sorted", "into", "groups", "related", "to", "the", "TextField", "value", "of", "the", "dataset", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L489-L575
6,351
bishopb/vanilla
library/core/class.form.php
Gdn_Form.Close
public function Close($ButtonCode = '', $Xhtml = '', $Attributes = FALSE) { $Return = "</div>\n</form>"; if ($Xhtml != '') $Return = $Xhtml . $Return; if ($ButtonCode != '') $Return = '<div class="Buttons">'.$this->Button($ButtonCode, $Attributes).'</div>'.$Return; return $Return; }
php
public function Close($ButtonCode = '', $Xhtml = '', $Attributes = FALSE) { $Return = "</div>\n</form>"; if ($Xhtml != '') $Return = $Xhtml . $Return; if ($ButtonCode != '') $Return = '<div class="Buttons">'.$this->Button($ButtonCode, $Attributes).'</div>'.$Return; return $Return; }
[ "public", "function", "Close", "(", "$", "ButtonCode", "=", "''", ",", "$", "Xhtml", "=", "''", ",", "$", "Attributes", "=", "FALSE", ")", "{", "$", "Return", "=", "\"</div>\\n</form>\"", ";", "if", "(", "$", "Xhtml", "!=", "''", ")", "$", "Return", ...
Returns the closing of the form tag with an optional submit button. @param string $ButtonCode @param string $Xhtml @return string
[ "Returns", "the", "closing", "of", "the", "form", "tag", "with", "an", "optional", "submit", "button", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L661-L668
6,352
bishopb/vanilla
library/core/class.form.php
Gdn_Form.CurrentImage
public function CurrentImage($FieldName, $Attributes = array()) { $Result = $this->Hidden($FieldName); $Value = $this->GetValue($FieldName); if ($Value) { TouchValue('class', $Attributes, 'CurrentImage'); $Result .= Img(Gdn_Upload::Url($Value), $Attributes); } ...
php
public function CurrentImage($FieldName, $Attributes = array()) { $Result = $this->Hidden($FieldName); $Value = $this->GetValue($FieldName); if ($Value) { TouchValue('class', $Attributes, 'CurrentImage'); $Result .= Img(Gdn_Upload::Url($Value), $Attributes); } ...
[ "public", "function", "CurrentImage", "(", "$", "FieldName", ",", "$", "Attributes", "=", "array", "(", ")", ")", "{", "$", "Result", "=", "$", "this", "->", "Hidden", "(", "$", "FieldName", ")", ";", "$", "Value", "=", "$", "this", "->", "GetValue",...
Returns the current image in a field. This is meant to be used with image uploads so that users can see the current value. @param type $FieldName @param type $Attributes @since 2.1
[ "Returns", "the", "current", "image", "in", "a", "field", ".", "This", "is", "meant", "to", "be", "used", "with", "image", "uploads", "so", "that", "users", "can", "see", "the", "current", "value", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L678-L688
6,353
bishopb/vanilla
library/core/class.form.php
Gdn_Form.DropDownGroup
public function DropDownGroup($FieldName, $Data, $GroupField, $TextField, $ValueField, $Attributes = array()) { $Return = '<select' . $this->_IDAttribute($FieldName, $Attributes) . $this->_NameAttribute($FieldName, $Attributes) . $this->_AttributesToString($Attributes) . ">\n";...
php
public function DropDownGroup($FieldName, $Data, $GroupField, $TextField, $ValueField, $Attributes = array()) { $Return = '<select' . $this->_IDAttribute($FieldName, $Attributes) . $this->_NameAttribute($FieldName, $Attributes) . $this->_AttributesToString($Attributes) . ">\n";...
[ "public", "function", "DropDownGroup", "(", "$", "FieldName", ",", "$", "Data", ",", "$", "GroupField", ",", "$", "TextField", ",", "$", "ValueField", ",", "$", "Attributes", "=", "array", "(", ")", ")", "{", "$", "Return", "=", "'<select'", ".", "$", ...
Returns the xhtml for a dropdown list with option groups. @param string $FieldName @param array $Data @param string $GroupField @param string $TextField @param string $ValueField @param array $Attributes @return string
[ "Returns", "the", "xhtml", "for", "a", "dropdown", "list", "with", "option", "groups", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L894-L946
6,354
bishopb/vanilla
library/core/class.form.php
Gdn_Form.Errors
public function Errors() { $Return = ''; if (is_array($this->_ValidationResults) && count($this->_ValidationResults) > 0) { $Return = "<div class=\"Messages Errors\">\n<ul>\n"; foreach($this->_ValidationResults as $FieldName => $Problems) { $Count = count($Problems); ...
php
public function Errors() { $Return = ''; if (is_array($this->_ValidationResults) && count($this->_ValidationResults) > 0) { $Return = "<div class=\"Messages Errors\">\n<ul>\n"; foreach($this->_ValidationResults as $FieldName => $Problems) { $Count = count($Problems); ...
[ "public", "function", "Errors", "(", ")", "{", "$", "Return", "=", "''", ";", "if", "(", "is_array", "(", "$", "this", "->", "_ValidationResults", ")", "&&", "count", "(", "$", "this", "->", "_ValidationResults", ")", ">", "0", ")", "{", "$", "Return...
Returns XHTML for all form-related errors that have occurred. @return string
[ "Returns", "XHTML", "for", "all", "form", "-", "related", "errors", "that", "have", "occurred", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L953-L971
6,355
bishopb/vanilla
library/core/class.form.php
Gdn_Form.EscapeString
public function EscapeString($String) { $Array = FALSE; if (substr($String, -2) == '[]') { $String = substr($String, 0, -2); $Array = TRUE; } $Return = urlencode(str_replace(' ', '_', $String)); if ($Array === TRUE) $Return .= '[]'; return str_replace('.', '-dot-',...
php
public function EscapeString($String) { $Array = FALSE; if (substr($String, -2) == '[]') { $String = substr($String, 0, -2); $Array = TRUE; } $Return = urlencode(str_replace(' ', '_', $String)); if ($Array === TRUE) $Return .= '[]'; return str_replace('.', '-dot-',...
[ "public", "function", "EscapeString", "(", "$", "String", ")", "{", "$", "Array", "=", "FALSE", ";", "if", "(", "substr", "(", "$", "String", ",", "-", "2", ")", "==", "'[]'", ")", "{", "$", "String", "=", "substr", "(", "$", "String", ",", "0", ...
Encodes the string in a php-form safe-encoded format. @param string $String The string to encode. @return string
[ "Encodes", "the", "string", "in", "a", "php", "-", "form", "safe", "-", "encoded", "format", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L997-L1007
6,356
bishopb/vanilla
library/core/class.form.php
Gdn_Form.GetCheckBoxGridGroup
public function GetCheckBoxGridGroup($GroupName, $Group, $Rows, $Cols) { $Return = ''; $Headings = ''; $Cells = ''; $RowCount = count($Rows); $ColCount = count($Cols); for($j = 0; $j < $RowCount; ++$j) { $Alt = 1; for($i = 0; $i < $ColCount; ++$i) { $Alt...
php
public function GetCheckBoxGridGroup($GroupName, $Group, $Rows, $Cols) { $Return = ''; $Headings = ''; $Cells = ''; $RowCount = count($Rows); $ColCount = count($Cols); for($j = 0; $j < $RowCount; ++$j) { $Alt = 1; for($i = 0; $i < $ColCount; ++$i) { $Alt...
[ "public", "function", "GetCheckBoxGridGroup", "(", "$", "GroupName", ",", "$", "Group", ",", "$", "Rows", ",", "$", "Cols", ")", "{", "$", "Return", "=", "''", ";", "$", "Headings", "=", "''", ";", "$", "Cells", "=", "''", ";", "$", "RowCount", "="...
Returns a checkbox table. @param string $GroupName The name of the checkbox table (the text that appears in the top-left cell of the table). This value will be passed through the T() function before render. @param array $Group An array of $PermissionName => $CheckBoxXhtml to be rendered within the grid. This represen...
[ "Returns", "a", "checkbox", "table", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L1030-L1075
6,357
bishopb/vanilla
library/core/class.form.php
Gdn_Form.GetHidden
public function GetHidden() { $Return = ''; if (is_array($this->HiddenInputs)) { foreach($this->HiddenInputs as $Name => $Value) { $Return .= $this->Hidden($Name, array('value' => $Value)); } // Clean out the array // mosullivan - removed cleanout so that entr...
php
public function GetHidden() { $Return = ''; if (is_array($this->HiddenInputs)) { foreach($this->HiddenInputs as $Name => $Value) { $Return .= $this->Hidden($Name, array('value' => $Value)); } // Clean out the array // mosullivan - removed cleanout so that entr...
[ "public", "function", "GetHidden", "(", ")", "{", "$", "Return", "=", "''", ";", "if", "(", "is_array", "(", "$", "this", "->", "HiddenInputs", ")", ")", "{", "foreach", "(", "$", "this", "->", "HiddenInputs", "as", "$", "Name", "=>", "$", "Value", ...
Returns XHTML for all hidden fields. @todo reviews damien's summary of this Form::GetHidden() @return string
[ "Returns", "XHTML", "for", "all", "hidden", "fields", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L1083-L1095
6,358
bishopb/vanilla
library/core/class.form.php
Gdn_Form.Hidden
public function Hidden($FieldName, $Attributes = FALSE) { $Return = '<input type="hidden"'; $Return .= $this->_IDAttribute($FieldName, $Attributes); $Return .= $this->_NameAttribute($FieldName, $Attributes); $Return .= $this->_ValueAttribute($FieldName, $Attributes); $Return .= $this->_Att...
php
public function Hidden($FieldName, $Attributes = FALSE) { $Return = '<input type="hidden"'; $Return .= $this->_IDAttribute($FieldName, $Attributes); $Return .= $this->_NameAttribute($FieldName, $Attributes); $Return .= $this->_ValueAttribute($FieldName, $Attributes); $Return .= $this->_Att...
[ "public", "function", "Hidden", "(", "$", "FieldName", ",", "$", "Attributes", "=", "FALSE", ")", "{", "$", "Return", "=", "'<input type=\"hidden\"'", ";", "$", "Return", ".=", "$", "this", "->", "_IDAttribute", "(", "$", "FieldName", ",", "$", "Attributes...
Returns the xhtml for a hidden input. @param string $FieldName The name of the field that is being hidden/posted with this input. It should related directly to a field name in $this->_DataArray. @param array $Attributes An associative array of attributes for the input. ie. maxlength, onclick, class, etc @return string
[ "Returns", "the", "xhtml", "for", "a", "hidden", "input", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L1107-L1115
6,359
bishopb/vanilla
library/core/class.form.php
Gdn_Form.ImageUpload
public function ImageUpload($FieldName, $Attributes = array()) { $Result = '<div class="FileUpload ImageUpload">'. $this->CurrentImage($FieldName, $Attributes). $this->Input($FieldName.'_New', 'file'). '</div>'; return $Result; }
php
public function ImageUpload($FieldName, $Attributes = array()) { $Result = '<div class="FileUpload ImageUpload">'. $this->CurrentImage($FieldName, $Attributes). $this->Input($FieldName.'_New', 'file'). '</div>'; return $Result; }
[ "public", "function", "ImageUpload", "(", "$", "FieldName", ",", "$", "Attributes", "=", "array", "(", ")", ")", "{", "$", "Result", "=", "'<div class=\"FileUpload ImageUpload\">'", ".", "$", "this", "->", "CurrentImage", "(", "$", "FieldName", ",", "$", "At...
Return a control for uploading images. @param string $FieldName @param array $Attributes @return string @since 2.1
[ "Return", "a", "control", "for", "uploading", "images", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L1125-L1132
6,360
bishopb/vanilla
library/core/class.form.php
Gdn_Form.InlineError
public function InlineError($FieldName) { $AppendError = '<p class="'.$this->ErrorClass.'">'; foreach ($this->_ValidationResults[$FieldName] as $ValidationError) { $AppendError .= sprintf(T($ValidationError),T($FieldName)).' '; } $AppendError .= '</p>'; return $AppendError;...
php
public function InlineError($FieldName) { $AppendError = '<p class="'.$this->ErrorClass.'">'; foreach ($this->_ValidationResults[$FieldName] as $ValidationError) { $AppendError .= sprintf(T($ValidationError),T($FieldName)).' '; } $AppendError .= '</p>'; return $AppendError;...
[ "public", "function", "InlineError", "(", "$", "FieldName", ")", "{", "$", "AppendError", "=", "'<p class=\"'", ".", "$", "this", "->", "ErrorClass", ".", "'\">'", ";", "foreach", "(", "$", "this", "->", "_ValidationResults", "[", "$", "FieldName", "]", "a...
Returns XHTML of inline error for specified field. @since 2.0.18 @access public @param string $FieldName The name of the field that is being displayed/posted with this input. It should related directly to a field name in $this->_DataArray. @return string
[ "Returns", "XHTML", "of", "inline", "error", "for", "specified", "field", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L1144-L1152
6,361
bishopb/vanilla
library/core/class.form.php
Gdn_Form.Input
public function Input($FieldName, $Type = 'text', $Attributes = FALSE) { if ($Type == 'text' || $Type == 'password') { $CssClass = ArrayValueI('class', $Attributes); if ($CssClass == FALSE) $Attributes['class'] = 'InputBox'; } // Show inline errors? $ShowErrors = $this->...
php
public function Input($FieldName, $Type = 'text', $Attributes = FALSE) { if ($Type == 'text' || $Type == 'password') { $CssClass = ArrayValueI('class', $Attributes); if ($CssClass == FALSE) $Attributes['class'] = 'InputBox'; } // Show inline errors? $ShowErrors = $this->...
[ "public", "function", "Input", "(", "$", "FieldName", ",", "$", "Type", "=", "'text'", ",", "$", "Attributes", "=", "FALSE", ")", "{", "if", "(", "$", "Type", "==", "'text'", "||", "$", "Type", "==", "'password'", ")", "{", "$", "CssClass", "=", "A...
Returns the xhtml for a standard input tag. @param string $FieldName The name of the field that is being displayed/posted with this input. It should related directly to a field name in $this->_DataArray. @param string $Type The type attribute for the input. @param array $Attributes An associative array of attributes f...
[ "Returns", "the", "xhtml", "for", "a", "standard", "input", "tag", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L1164-L1230
6,362
bishopb/vanilla
library/core/class.form.php
Gdn_Form.Label
public function Label($TranslationCode, $FieldName = '', $Attributes = FALSE) { // Assume we always want a 'for' attribute because it's Good & Proper. // Precedence: 'for' attribute, 'id' attribute, $FieldName, $TranslationCode $DefaultFor = ($FieldName == '') ? $TranslationCode : $FieldName; $F...
php
public function Label($TranslationCode, $FieldName = '', $Attributes = FALSE) { // Assume we always want a 'for' attribute because it's Good & Proper. // Precedence: 'for' attribute, 'id' attribute, $FieldName, $TranslationCode $DefaultFor = ($FieldName == '') ? $TranslationCode : $FieldName; $F...
[ "public", "function", "Label", "(", "$", "TranslationCode", ",", "$", "FieldName", "=", "''", ",", "$", "Attributes", "=", "FALSE", ")", "{", "// Assume we always want a 'for' attribute because it's Good & Proper.", "// Precedence: 'for' attribute, 'id' attribute, $FieldName, $...
Returns XHTML for a label element. @param string $TranslationCode Code to be translated and presented within the label tag. @param string $FieldName Name of the field that the label is for. @param array $Attributes Associative array of attributes for the input that the label is for. This is only available in case the ...
[ "Returns", "XHTML", "for", "a", "label", "element", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L1242-L1249
6,363
bishopb/vanilla
library/core/class.form.php
Gdn_Form.LabelCode
public static function LabelCode($Item) { if (is_array($Item)) { if (isset($Item['LabelCode'])) return $Item['LabelCode']; $LabelCode = $Item['Name']; } else { $LabelCode = $Item; } if (strpos($LabelCode, '.') !== FALSE) $LabelCode =...
php
public static function LabelCode($Item) { if (is_array($Item)) { if (isset($Item['LabelCode'])) return $Item['LabelCode']; $LabelCode = $Item['Name']; } else { $LabelCode = $Item; } if (strpos($LabelCode, '.') !== FALSE) $LabelCode =...
[ "public", "static", "function", "LabelCode", "(", "$", "Item", ")", "{", "if", "(", "is_array", "(", "$", "Item", ")", ")", "{", "if", "(", "isset", "(", "$", "Item", "[", "'LabelCode'", "]", ")", ")", "return", "$", "Item", "[", "'LabelCode'", "]"...
Generate a friendly looking label translation code from a camel case variable name @param string|array $Item The item to generate the label from. - string: Generate the label directly from the item. - array: Generate the label from the item as if it is a schema row passed to Gdn_Form::Simple(). @return string
[ "Generate", "a", "friendly", "looking", "label", "translation", "code", "from", "a", "camel", "case", "variable", "name" ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L1258-L1278
6,364
bishopb/vanilla
library/core/class.form.php
Gdn_Form.Radio
public function Radio($FieldName, $Label = '', $Attributes = FALSE) { $Value = ArrayValueI('Value', $Attributes, 'TRUE'); $Attributes['value'] = $Value; $FormValue = $this->GetValue($FieldName, ArrayValueI('Default', $Attributes)); // Check for 'checked' if ($FormValue == $Value) ...
php
public function Radio($FieldName, $Label = '', $Attributes = FALSE) { $Value = ArrayValueI('Value', $Attributes, 'TRUE'); $Attributes['value'] = $Value; $FormValue = $this->GetValue($FieldName, ArrayValueI('Default', $Attributes)); // Check for 'checked' if ($FormValue == $Value) ...
[ "public", "function", "Radio", "(", "$", "FieldName", ",", "$", "Label", "=", "''", ",", "$", "Attributes", "=", "FALSE", ")", "{", "$", "Value", "=", "ArrayValueI", "(", "'Value'", ",", "$", "Attributes", ",", "'TRUE'", ")", ";", "$", "Attributes", ...
Returns XHTML for a radio input element. Provides way of wrapping Input() with a label. @param string $FieldName Name of the field that is being displayed/posted with this input. It should related directly to a field name in $this->_DataArray. @param string $Label Label to place next to the radio. @param array $Attri...
[ "Returns", "XHTML", "for", "a", "radio", "input", "element", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L1374-L1396
6,365
bishopb/vanilla
library/core/class.form.php
Gdn_Form.RadioList
public function RadioList($FieldName, $DataSet, $Attributes = FALSE) { $List = GetValue('list', $Attributes); $Return = ''; if ($List) { $Return .= '<ul'.(isset($Attributes['listclass']) ? " class=\"{$Attributes['listclass']}\"" : '').'>'; $LiOpen = '<li>'; $LiClose = '</li...
php
public function RadioList($FieldName, $DataSet, $Attributes = FALSE) { $List = GetValue('list', $Attributes); $Return = ''; if ($List) { $Return .= '<ul'.(isset($Attributes['listclass']) ? " class=\"{$Attributes['listclass']}\"" : '').'>'; $LiOpen = '<li>'; $LiClose = '</li...
[ "public", "function", "RadioList", "(", "$", "FieldName", ",", "$", "DataSet", ",", "$", "Attributes", "=", "FALSE", ")", "{", "$", "List", "=", "GetValue", "(", "'list'", ",", "$", "Attributes", ")", ";", "$", "Return", "=", "''", ";", "if", "(", ...
Returns XHTML for an unordered list of radio button elements. @param string $FieldName The name of the field that is being displayed/posted with this input. It should related directly to a field name in $this->_DataArray. ie. RoleID @param mixed $DataSet The data to fill the options in the select list. Either an assoc...
[ "Returns", "XHTML", "for", "an", "unordered", "list", "of", "radio", "button", "elements", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L1424-L1471
6,366
bishopb/vanilla
library/core/class.form.php
Gdn_Form.TextBox
public function TextBox($FieldName, $Attributes = FALSE) { if (!is_array($Attributes)) $Attributes = array(); $MultiLine = ArrayValueI('MultiLine', $Attributes); if ($MultiLine) { $Attributes['rows'] = ArrayValueI('rows', $Attributes, '6'); // For xhtml compliance ...
php
public function TextBox($FieldName, $Attributes = FALSE) { if (!is_array($Attributes)) $Attributes = array(); $MultiLine = ArrayValueI('MultiLine', $Attributes); if ($MultiLine) { $Attributes['rows'] = ArrayValueI('rows', $Attributes, '6'); // For xhtml compliance ...
[ "public", "function", "TextBox", "(", "$", "FieldName", ",", "$", "Attributes", "=", "FALSE", ")", "{", "if", "(", "!", "is_array", "(", "$", "Attributes", ")", ")", "$", "Attributes", "=", "array", "(", ")", ";", "$", "MultiLine", "=", "ArrayValueI", ...
Returns the xhtml for a text-based input. @param string $FieldName The name of the field that is being displayed/posted with this input. It should related directly to a field name in $this->_DataArray. @param array $Attributes An associative array of attributes for the input. ie. maxlength, onclick, class, etc @return...
[ "Returns", "the", "xhtml", "for", "a", "text", "-", "based", "input", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L1482-L1525
6,367
bishopb/vanilla
library/core/class.form.php
Gdn_Form.AddHidden
public function AddHidden($FieldName, $Value = NULL, $ForceValue = FALSE) { if ($this->IsPostBack() && $ForceValue === FALSE) $Value = $this->GetFormValue($FieldName, $Value); $this->HiddenInputs[$FieldName] = $Value; }
php
public function AddHidden($FieldName, $Value = NULL, $ForceValue = FALSE) { if ($this->IsPostBack() && $ForceValue === FALSE) $Value = $this->GetFormValue($FieldName, $Value); $this->HiddenInputs[$FieldName] = $Value; }
[ "public", "function", "AddHidden", "(", "$", "FieldName", ",", "$", "Value", "=", "NULL", ",", "$", "ForceValue", "=", "FALSE", ")", "{", "if", "(", "$", "this", "->", "IsPostBack", "(", ")", "&&", "$", "ForceValue", "===", "FALSE", ")", "$", "Value"...
Adds a hidden input value to the form. If the $ForceValue parameter remains FALSE, it will grab the value into the hidden input from the form on postback. Otherwise it will always force the assigned value to the input regardless of postback. @param string $FieldName The name of the field being added as a hidden input...
[ "Adds", "a", "hidden", "input", "value", "to", "the", "form", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L1594-L1599
6,368
bishopb/vanilla
library/core/class.form.php
Gdn_Form.EscapeFieldName
public function EscapeFieldName($FieldName) { $Return = $this->InputPrefix; if ($Return != '') $Return .= '/'; return $Return . $this->EscapeString($FieldName); }
php
public function EscapeFieldName($FieldName) { $Return = $this->InputPrefix; if ($Return != '') $Return .= '/'; return $Return . $this->EscapeString($FieldName); }
[ "public", "function", "EscapeFieldName", "(", "$", "FieldName", ")", "{", "$", "Return", "=", "$", "this", "->", "InputPrefix", ";", "if", "(", "$", "Return", "!=", "''", ")", "$", "Return", ".=", "'/'", ";", "return", "$", "Return", ".", "$", "this"...
Returns the provided fieldname with non-alpha-numeric values stripped. @param string $FieldName The field name to escape. @return string
[ "Returns", "the", "provided", "fieldname", "with", "non", "-", "alpha", "-", "numeric", "values", "stripped", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L1667-L1671
6,369
bishopb/vanilla
library/core/class.form.php
Gdn_Form.IsMyPostBack
public function IsMyPostBack() { switch (strtolower($this->Method)) { case 'get': return count($_GET) > 0 || (is_array($this->FormValues()) && count($this->FormValues()) > 0) ? TRUE : FALSE; default: return Gdn::Request()->IsPostBack(); } }
php
public function IsMyPostBack() { switch (strtolower($this->Method)) { case 'get': return count($_GET) > 0 || (is_array($this->FormValues()) && count($this->FormValues()) > 0) ? TRUE : FALSE; default: return Gdn::Request()->IsPostBack(); } }
[ "public", "function", "IsMyPostBack", "(", ")", "{", "switch", "(", "strtolower", "(", "$", "this", "->", "Method", ")", ")", "{", "case", "'get'", ":", "return", "count", "(", "$", "_GET", ")", ">", "0", "||", "(", "is_array", "(", "$", "this", "-...
Check if THIS particular form was submitted Just like IsPostBack(), except auto populates FormValues and doesnt just check "was some data submitted lol?!". @return boolean
[ "Check", "if", "THIS", "particular", "form", "was", "submitted" ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L1922-L1929
6,370
bishopb/vanilla
library/core/class.form.php
Gdn_Form.Save
public function Save() { $SaveResult = FALSE; if ($this->ErrorCount() == 0) { if (!isset($this->_Model)) trigger_error( ErrorMessage( "You cannot call the form's save method if a model has not been defined.", "Form", "Save"), E_USER_ERROR); ...
php
public function Save() { $SaveResult = FALSE; if ($this->ErrorCount() == 0) { if (!isset($this->_Model)) trigger_error( ErrorMessage( "You cannot call the form's save method if a model has not been defined.", "Form", "Save"), E_USER_ERROR); ...
[ "public", "function", "Save", "(", ")", "{", "$", "SaveResult", "=", "FALSE", ";", "if", "(", "$", "this", "->", "ErrorCount", "(", ")", "==", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "_Model", ")", ")", "trigger_error", "(...
This is a convenience method so that you don't have to code this every time you want to save a simple model's data. It uses the assigned model to save the sent form fields. If saving fails, it populates $this->_ValidationResults with validation errors & related fields. @return unknown
[ "This", "is", "a", "convenience", "method", "so", "that", "you", "don", "t", "have", "to", "code", "this", "every", "time", "you", "want", "to", "save", "a", "simple", "model", "s", "data", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L1940-L1975
6,371
bishopb/vanilla
library/core/class.form.php
Gdn_Form.SetData
public function SetData($Data) { if (is_object($Data) === TRUE) { // If this is a result object (/garden/library/database/class.dataset.php) // retrieve it's values as arrays if ($Data instanceof DataSet) { $ResultSet = $Data->ResultArray(); if (count($ResultSet)...
php
public function SetData($Data) { if (is_object($Data) === TRUE) { // If this is a result object (/garden/library/database/class.dataset.php) // retrieve it's values as arrays if ($Data instanceof DataSet) { $ResultSet = $Data->ResultArray(); if (count($ResultSet)...
[ "public", "function", "SetData", "(", "$", "Data", ")", "{", "if", "(", "is_object", "(", "$", "Data", ")", "===", "TRUE", ")", "{", "// If this is a result object (/garden/library/database/class.dataset.php)", "// retrieve it's values as arrays", "if", "(", "$", "Dat...
Assign a set of data to be displayed in the form elements. @param Ressource $Data A result resource or associative array containing data to be filled in
[ "Assign", "a", "set", "of", "data", "to", "be", "displayed", "in", "the", "form", "elements", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L1982-L1998
6,372
bishopb/vanilla
library/core/class.form.php
Gdn_Form.RemoveFormValue
public function RemoveFormValue($FieldName) { $this->FormValues(); if (!is_array($FieldName)) $FieldName = array($FieldName); foreach ($FieldName as $Field) unset($this->_FormValues[$Field]); }
php
public function RemoveFormValue($FieldName) { $this->FormValues(); if (!is_array($FieldName)) $FieldName = array($FieldName); foreach ($FieldName as $Field) unset($this->_FormValues[$Field]); }
[ "public", "function", "RemoveFormValue", "(", "$", "FieldName", ")", "{", "$", "this", "->", "FormValues", "(", ")", ";", "if", "(", "!", "is_array", "(", "$", "FieldName", ")", ")", "$", "FieldName", "=", "array", "(", "$", "FieldName", ")", ";", "f...
Remove an element from a form @param string $FieldName
[ "Remove", "an", "element", "from", "a", "form" ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L2020-L2028
6,373
bishopb/vanilla
library/core/class.form.php
Gdn_Form.ValidateModel
public function ValidateModel() { $this->_Model->DefineSchema(); if ($this->_Model->Validation->Validate($this->FormValues()) === FALSE) $this->_ValidationResults = $this->_Model->ValidationResults(); return $this->ErrorCount(); }
php
public function ValidateModel() { $this->_Model->DefineSchema(); if ($this->_Model->Validation->Validate($this->FormValues()) === FALSE) $this->_ValidationResults = $this->_Model->ValidationResults(); return $this->ErrorCount(); }
[ "public", "function", "ValidateModel", "(", ")", "{", "$", "this", "->", "_Model", "->", "DefineSchema", "(", ")", ";", "if", "(", "$", "this", "->", "_Model", "->", "Validation", "->", "Validate", "(", "$", "this", "->", "FormValues", "(", ")", ")", ...
If not saving data directly to the model, this method allows you to utilize a model's schema to validate a form's inputs regardless. ie. A sign-in form that just needs to compare data to the model and still enforce it's rules. Returns the number of errors that were recorded through validation. @return int
[ "If", "not", "saving", "data", "directly", "to", "the", "model", "this", "method", "allows", "you", "to", "utilize", "a", "model", "s", "schema", "to", "validate", "a", "form", "s", "inputs", "regardless", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L2171-L2175
6,374
bishopb/vanilla
library/core/class.form.php
Gdn_Form.ValidateRule
public function ValidateRule($FieldName, $Rule, $CustomError = '') { $Value = $this->GetFormValue($FieldName); $Valid = Gdn_Validation::ValidateRule($Value, $FieldName, $Rule, $CustomError); if ($Valid === TRUE) return TRUE; else { $this->AddError('@'.$Valid); return ...
php
public function ValidateRule($FieldName, $Rule, $CustomError = '') { $Value = $this->GetFormValue($FieldName); $Valid = Gdn_Validation::ValidateRule($Value, $FieldName, $Rule, $CustomError); if ($Valid === TRUE) return TRUE; else { $this->AddError('@'.$Valid); return ...
[ "public", "function", "ValidateRule", "(", "$", "FieldName", ",", "$", "Rule", ",", "$", "CustomError", "=", "''", ")", "{", "$", "Value", "=", "$", "this", "->", "GetFormValue", "(", "$", "FieldName", ")", ";", "$", "Valid", "=", "Gdn_Validation", "::...
Validates a rule on the form and adds its result to the errors collection. @param string $FieldName The name of the field to validate. @param string|array $Rule The rule to validate against. @param string $CustomError A custom error string. @return bool Whether or not the rule succeeded. @see Gdn_Validation::Validate...
[ "Validates", "a", "rule", "on", "the", "form", "and", "adds", "its", "result", "to", "the", "errors", "collection", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.form.php#L2187-L2198
6,375
bearframework/emails-addon
classes/Emails/Email/Headers.php
Headers.add
public function add(string $name, string $value): void { $header = $this->make(); $header->name = $name; $header->value = $value; $this->set($header); }
php
public function add(string $name, string $value): void { $header = $this->make(); $header->name = $name; $header->value = $value; $this->set($header); }
[ "public", "function", "add", "(", "string", "$", "name", ",", "string", "$", "value", ")", ":", "void", "{", "$", "header", "=", "$", "this", "->", "make", "(", ")", ";", "$", "header", "->", "name", "=", "$", "name", ";", "$", "header", "->", ...
Add a custom header. @param string $name The name of the custom header. @param string $value The value of the custom header. @throws \InvalidArgumentException
[ "Add", "a", "custom", "header", "." ]
43a68c47e2b1d231dc69a324249ff5f6827201ca
https://github.com/bearframework/emails-addon/blob/43a68c47e2b1d231dc69a324249ff5f6827201ca/classes/Emails/Email/Headers.php#L36-L42
6,376
RitaCo/cakephp-tools-plugin
Model/Behavior/RevisionBehavior.php
RevisionBehavior.createRevision
public function createRevision(Model $Model) { if (!$Model->id) { trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING); return false; } if (!$Model->ShadowModel) { trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING); return false; } $habtm = array(); ...
php
public function createRevision(Model $Model) { if (!$Model->id) { trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING); return false; } if (!$Model->ShadowModel) { trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING); return false; } $habtm = array(); ...
[ "public", "function", "createRevision", "(", "Model", "$", "Model", ")", "{", "if", "(", "!", "$", "Model", "->", "id", ")", "{", "trigger_error", "(", "'RevisionBehavior: Model::id must be set'", ",", "E_USER_WARNING", ")", ";", "return", "false", ";", "}", ...
Manually create a revision of the current record of Model->id @example $this->Post->id = 5; $this->Post->createRevision(); @param object $Model @return bool Success
[ "Manually", "create", "a", "revision", "of", "the", "current", "record", "of", "Model", "-", ">", "id" ]
e9581f1d666560721d70f5dad116f52f77a687ff
https://github.com/RitaCo/cakephp-tools-plugin/blob/e9581f1d666560721d70f5dad116f52f77a687ff/Model/Behavior/RevisionBehavior.php#L166-L192
6,377
RitaCo/cakephp-tools-plugin
Model/Behavior/RevisionBehavior.php
RevisionBehavior.diff
public function diff(Model $Model, $fromVersionId = null, $toVersionId = null, $options = array()) { if (!$Model->id) { trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING); return array(); } if (!$Model->ShadowModel) { trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_US...
php
public function diff(Model $Model, $fromVersionId = null, $toVersionId = null, $options = array()) { if (!$Model->id) { trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING); return array(); } if (!$Model->ShadowModel) { trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_US...
[ "public", "function", "diff", "(", "Model", "$", "Model", ",", "$", "fromVersionId", "=", "null", ",", "$", "toVersionId", "=", "null", ",", "$", "options", "=", "array", "(", ")", ")", "{", "if", "(", "!", "$", "Model", "->", "id", ")", "{", "tr...
Returns an array that maps to the Model, only with multiple values for fields that has been changed @example $this->Post->id = 4; $changes = $this->Post->diff(); @example $this->Post->id = 4; $myChanges = $this->Post->diff(null,nul, array('conditions'=>array('user_id'=>4))); @example $this->Post->id = 4; $difference =...
[ "Returns", "an", "array", "that", "maps", "to", "the", "Model", "only", "with", "multiple", "values", "for", "fields", "that", "has", "been", "changed" ]
e9581f1d666560721d70f5dad116f52f77a687ff
https://github.com/RitaCo/cakephp-tools-plugin/blob/e9581f1d666560721d70f5dad116f52f77a687ff/Model/Behavior/RevisionBehavior.php#L206-L261
6,378
RitaCo/cakephp-tools-plugin
Model/Behavior/RevisionBehavior.php
RevisionBehavior._init
protected function _init(Model $Model, $page, $limit) { $habtm = array(); $allHabtm = $Model->getAssociated('hasAndBelongsToMany'); foreach ($allHabtm as $assocAlias) { if (isset($Model->ShadowModel->_schema[$assocAlias])) { $habtm[] = $assocAlias; } } $all = $Model->find('all', array( 'limit' =>...
php
protected function _init(Model $Model, $page, $limit) { $habtm = array(); $allHabtm = $Model->getAssociated('hasAndBelongsToMany'); foreach ($allHabtm as $assocAlias) { if (isset($Model->ShadowModel->_schema[$assocAlias])) { $habtm[] = $assocAlias; } } $all = $Model->find('all', array( 'limit' =>...
[ "protected", "function", "_init", "(", "Model", "$", "Model", ",", "$", "page", ",", "$", "limit", ")", "{", "$", "habtm", "=", "array", "(", ")", ";", "$", "allHabtm", "=", "$", "Model", "->", "getAssociated", "(", "'hasAndBelongsToMany'", ")", ";", ...
Saves revisions for rows matching page and limit given @param object $Model @param int $page @param int $limit @return void
[ "Saves", "revisions", "for", "rows", "matching", "page", "and", "limit", "given" ]
e9581f1d666560721d70f5dad116f52f77a687ff
https://github.com/RitaCo/cakephp-tools-plugin/blob/e9581f1d666560721d70f5dad116f52f77a687ff/Model/Behavior/RevisionBehavior.php#L313-L331
6,379
RitaCo/cakephp-tools-plugin
Model/Behavior/RevisionBehavior.php
RevisionBehavior.newest
public function newest(Model $Model, $options = array()) { if (!$Model->id) { trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING); return array(); } if (!$Model->ShadowModel) { trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING); return array(); } if (...
php
public function newest(Model $Model, $options = array()) { if (!$Model->id) { trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING); return array(); } if (!$Model->ShadowModel) { trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING); return array(); } if (...
[ "public", "function", "newest", "(", "Model", "$", "Model", ",", "$", "options", "=", "array", "(", ")", ")", "{", "if", "(", "!", "$", "Model", "->", "id", ")", "{", "trigger_error", "(", "'RevisionBehavior: Model::id must be set'", ",", "E_USER_WARNING", ...
Finds the newest revision, including the current one. Use with caution, the live model may be different depending on the usage of ignore fields. @example $this->Post->id = 6; $newestRevision = $this->Post->newest(); @param object $Model @param array $options @return array
[ "Finds", "the", "newest", "revision", "including", "the", "current", "one", ".", "Use", "with", "caution", "the", "live", "model", "may", "be", "different", "depending", "on", "the", "usage", "of", "ignore", "fields", "." ]
e9581f1d666560721d70f5dad116f52f77a687ff
https://github.com/RitaCo/cakephp-tools-plugin/blob/e9581f1d666560721d70f5dad116f52f77a687ff/Model/Behavior/RevisionBehavior.php#L343-L359
6,380
RitaCo/cakephp-tools-plugin
Model/Behavior/RevisionBehavior.php
RevisionBehavior.oldest
public function oldest(Model $Model, $options = array()) { if (!$Model->id) { trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING); return array(); } if (!$Model->ShadowModel) { trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING); return array(); } if (...
php
public function oldest(Model $Model, $options = array()) { if (!$Model->id) { trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING); return array(); } if (!$Model->ShadowModel) { trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING); return array(); } if (...
[ "public", "function", "oldest", "(", "Model", "$", "Model", ",", "$", "options", "=", "array", "(", ")", ")", "{", "if", "(", "!", "$", "Model", "->", "id", ")", "{", "trigger_error", "(", "'RevisionBehavior: Model::id must be set'", ",", "E_USER_WARNING", ...
Find the oldest revision for the current Model->id If no limit is used on revision and revision has been enabled for the model since start, this call will return the original first record. @example $this->Post->id = 2; $original = $this->Post->oldest(); @param object $Model @param array $options @return array
[ "Find", "the", "oldest", "revision", "for", "the", "current", "Model", "-", ">", "id", "If", "no", "limit", "is", "used", "on", "revision", "and", "revision", "has", "been", "enabled", "for", "the", "model", "since", "start", "this", "call", "will", "ret...
e9581f1d666560721d70f5dad116f52f77a687ff
https://github.com/RitaCo/cakephp-tools-plugin/blob/e9581f1d666560721d70f5dad116f52f77a687ff/Model/Behavior/RevisionBehavior.php#L371-L387
6,381
RitaCo/cakephp-tools-plugin
Model/Behavior/RevisionBehavior.php
RevisionBehavior.previous
public function previous(Model $Model, $options = array()) { if (!$Model->id) { trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING); return array(); } if (!$Model->ShadowModel) { trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING); return array(); } $o...
php
public function previous(Model $Model, $options = array()) { if (!$Model->id) { trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING); return array(); } if (!$Model->ShadowModel) { trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING); return array(); } $o...
[ "public", "function", "previous", "(", "Model", "$", "Model", ",", "$", "options", "=", "array", "(", ")", ")", "{", "if", "(", "!", "$", "Model", "->", "id", ")", "{", "trigger_error", "(", "'RevisionBehavior: Model::id must be set'", ",", "E_USER_WARNING",...
Find the second newest revisions, including the current one. @example $this->Post->id = 6; $undoRevision = $this->Post->previous(); @param object $Model @param array $options @return array
[ "Find", "the", "second", "newest", "revisions", "including", "the", "current", "one", "." ]
e9581f1d666560721d70f5dad116f52f77a687ff
https://github.com/RitaCo/cakephp-tools-plugin/blob/e9581f1d666560721d70f5dad116f52f77a687ff/Model/Behavior/RevisionBehavior.php#L397-L418
6,382
RitaCo/cakephp-tools-plugin
Model/Behavior/RevisionBehavior.php
RevisionBehavior.revertAll
public function revertAll(Model $Model, $options = array()) { if (!$Model->ShadowModel) { trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING); return false; } if (empty($options) || !isset($options['date'])) { return false; } if (!isset($options['conditions'])) { $options[...
php
public function revertAll(Model $Model, $options = array()) { if (!$Model->ShadowModel) { trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING); return false; } if (empty($options) || !isset($options['date'])) { return false; } if (!isset($options['conditions'])) { $options[...
[ "public", "function", "revertAll", "(", "Model", "$", "Model", ",", "$", "options", "=", "array", "(", ")", ")", "{", "if", "(", "!", "$", "Model", "->", "ShadowModel", ")", "{", "trigger_error", "(", "'RevisionBehavior: ShadowModel doesnt exist.'", ",", "E_...
Revert all rows matching conditions to given date. Model rows outside condition or not edited will not be affected. Edits since date will be reverted and rows created since date deleted. @param object $Model @param array $options 'conditions','date' @return bool Success
[ "Revert", "all", "rows", "matching", "conditions", "to", "given", "date", ".", "Model", "rows", "outside", "condition", "or", "not", "edited", "will", "not", "be", "affected", ".", "Edits", "since", "date", "will", "be", "reverted", "and", "rows", "created",...
e9581f1d666560721d70f5dad116f52f77a687ff
https://github.com/RitaCo/cakephp-tools-plugin/blob/e9581f1d666560721d70f5dad116f52f77a687ff/Model/Behavior/RevisionBehavior.php#L429-L477
6,383
RitaCo/cakephp-tools-plugin
Model/Behavior/RevisionBehavior.php
RevisionBehavior.revertTo
public function revertTo(Model $Model, $versionId) { if (!$Model->id) { trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING); return false; } if (!$Model->ShadowModel) { trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING); return false; } $data = $Model...
php
public function revertTo(Model $Model, $versionId) { if (!$Model->id) { trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING); return false; } if (!$Model->ShadowModel) { trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING); return false; } $data = $Model...
[ "public", "function", "revertTo", "(", "Model", "$", "Model", ",", "$", "versionId", ")", "{", "if", "(", "!", "$", "Model", "->", "id", ")", "{", "trigger_error", "(", "'RevisionBehavior: Model::id must be set'", ",", "E_USER_WARNING", ")", ";", "return", "...
Revert current Model->id to the given revision id Will return false if version id is invalid or save fails @example $this->Post->id = 3; $this->Post->revertTo(12); @param object $Model @param int $versionId @return bool Success
[ "Revert", "current", "Model", "-", ">", "id", "to", "the", "given", "revision", "id", "Will", "return", "false", "if", "version", "id", "is", "invalid", "or", "save", "fails" ]
e9581f1d666560721d70f5dad116f52f77a687ff
https://github.com/RitaCo/cakephp-tools-plugin/blob/e9581f1d666560721d70f5dad116f52f77a687ff/Model/Behavior/RevisionBehavior.php#L488-L507
6,384
RitaCo/cakephp-tools-plugin
Model/Behavior/RevisionBehavior.php
RevisionBehavior.undo
public function undo(Model $Model) { if (!$Model->id) { trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING); return null; } if (!$Model->ShadowModel) { trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING); return false; } $data = $this->previous($Model)...
php
public function undo(Model $Model) { if (!$Model->id) { trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING); return null; } if (!$Model->ShadowModel) { trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING); return false; } $data = $this->previous($Model)...
[ "public", "function", "undo", "(", "Model", "$", "Model", ")", "{", "if", "(", "!", "$", "Model", "->", "id", ")", "{", "trigger_error", "(", "'RevisionBehavior: Model::id must be set'", ",", "E_USER_WARNING", ")", ";", "return", "null", ";", "}", "if", "(...
Update to previous revision @example $this->Post->id = 2; $this->Post->undo(); @param object $Model @return bool Success
[ "Update", "to", "previous", "revision" ]
e9581f1d666560721d70f5dad116f52f77a687ff
https://github.com/RitaCo/cakephp-tools-plugin/blob/e9581f1d666560721d70f5dad116f52f77a687ff/Model/Behavior/RevisionBehavior.php#L731-L753
6,385
RitaCo/cakephp-tools-plugin
Model/Behavior/RevisionBehavior.php
RevisionBehavior.afterDelete
public function afterDelete(Model $Model) { if ($this->settings[$Model->alias]['auto'] === false) { return; } if (!$Model->ShadowModel) { return; } if (isset($this->deleteUpdates[$Model->alias]) && !empty($this->deleteUpdates[$Model->alias])) { foreach ($this->deleteUpdates[$Model->alias] as $assocAl...
php
public function afterDelete(Model $Model) { if ($this->settings[$Model->alias]['auto'] === false) { return; } if (!$Model->ShadowModel) { return; } if (isset($this->deleteUpdates[$Model->alias]) && !empty($this->deleteUpdates[$Model->alias])) { foreach ($this->deleteUpdates[$Model->alias] as $assocAl...
[ "public", "function", "afterDelete", "(", "Model", "$", "Model", ")", "{", "if", "(", "$", "this", "->", "settings", "[", "$", "Model", "->", "alias", "]", "[", "'auto'", "]", "===", "false", ")", "{", "return", ";", "}", "if", "(", "!", "$", "Mo...
Causes revision for habtm associated models if that model does version control on their relationship. BeforeDelete identifies the related models that will need to do the revision update in afterDelete. Uses @param unknown_type $Model @return void
[ "Causes", "revision", "for", "habtm", "associated", "models", "if", "that", "model", "does", "version", "control", "on", "their", "relationship", ".", "BeforeDelete", "identifies", "the", "related", "models", "that", "will", "need", "to", "do", "the", "revision"...
e9581f1d666560721d70f5dad116f52f77a687ff
https://github.com/RitaCo/cakephp-tools-plugin/blob/e9581f1d666560721d70f5dad116f52f77a687ff/Model/Behavior/RevisionBehavior.php#L782-L795
6,386
RitaCo/cakephp-tools-plugin
Model/Behavior/RevisionBehavior.php
RevisionBehavior.beforeDelete
public function beforeDelete(Model $Model, $cascade = true) { if ($this->settings[$Model->alias]['auto'] === false) { return true; } if (!$Model->ShadowModel) { return true; } foreach ($Model->hasAndBelongsToMany as $assocAlias => $a) { if (isset($Model->{$assocAlias}->ShadowModel->_schema[$Model->al...
php
public function beforeDelete(Model $Model, $cascade = true) { if ($this->settings[$Model->alias]['auto'] === false) { return true; } if (!$Model->ShadowModel) { return true; } foreach ($Model->hasAndBelongsToMany as $assocAlias => $a) { if (isset($Model->{$assocAlias}->ShadowModel->_schema[$Model->al...
[ "public", "function", "beforeDelete", "(", "Model", "$", "Model", ",", "$", "cascade", "=", "true", ")", "{", "if", "(", "$", "this", "->", "settings", "[", "$", "Model", "->", "alias", "]", "[", "'auto'", "]", "===", "false", ")", "{", "return", "...
Causes revision for habtm associated models if that model does version control on their relationship. BeforeDelete identifies the related models that will need to do the revision update in afterDelete. @param object $Model @return bool Success
[ "Causes", "revision", "for", "habtm", "associated", "models", "if", "that", "model", "does", "version", "control", "on", "their", "relationship", ".", "BeforeDelete", "identifies", "the", "related", "models", "that", "will", "need", "to", "do", "the", "revision"...
e9581f1d666560721d70f5dad116f52f77a687ff
https://github.com/RitaCo/cakephp-tools-plugin/blob/e9581f1d666560721d70f5dad116f52f77a687ff/Model/Behavior/RevisionBehavior.php#L899-L914
6,387
RitaCo/cakephp-tools-plugin
Model/Behavior/RevisionBehavior.php
RevisionBehavior.beforeSave
public function beforeSave(Model $Model, $options = array()) { if ($this->settings[$Model->alias]['auto'] === false) { return true; } if (!$Model->ShadowModel) { return true; } $Model->ShadowModel->create(); if (!isset($Model->data[$Model->alias][$Model->primaryKey]) && !$Model->id) { return true; ...
php
public function beforeSave(Model $Model, $options = array()) { if ($this->settings[$Model->alias]['auto'] === false) { return true; } if (!$Model->ShadowModel) { return true; } $Model->ShadowModel->create(); if (!isset($Model->data[$Model->alias][$Model->primaryKey]) && !$Model->id) { return true; ...
[ "public", "function", "beforeSave", "(", "Model", "$", "Model", ",", "$", "options", "=", "array", "(", ")", ")", "{", "if", "(", "$", "this", "->", "settings", "[", "$", "Model", "->", "alias", "]", "[", "'auto'", "]", "===", "false", ")", "{", ...
Revision uses the beforeSave callback to remember the old data for comparison in afterSave @param object $Model @return bool Success
[ "Revision", "uses", "the", "beforeSave", "callback", "to", "remember", "the", "old", "data", "for", "comparison", "in", "afterSave" ]
e9581f1d666560721d70f5dad116f52f77a687ff
https://github.com/RitaCo/cakephp-tools-plugin/blob/e9581f1d666560721d70f5dad116f52f77a687ff/Model/Behavior/RevisionBehavior.php#L922-L944
6,388
mooti/framework
src/ServiceProvider/ServiceProvider.php
ServiceProvider.getServices
public function getServices() { return [ self::INFLECTOR => function () { return Inflector::get('en');}, self::APPLICATION_RUNTIME => function () { return new ApplicationRuntime();}, self::CONFIG_FACTORY => function () { return new ConfigFactory();} ...
php
public function getServices() { return [ self::INFLECTOR => function () { return Inflector::get('en');}, self::APPLICATION_RUNTIME => function () { return new ApplicationRuntime();}, self::CONFIG_FACTORY => function () { return new ConfigFactory();} ...
[ "public", "function", "getServices", "(", ")", "{", "return", "[", "self", "::", "INFLECTOR", "=>", "function", "(", ")", "{", "return", "Inflector", "::", "get", "(", "'en'", ")", ";", "}", ",", "self", "::", "APPLICATION_RUNTIME", "=>", "function", "("...
Get the details of the services we are providing @return array
[ "Get", "the", "details", "of", "the", "services", "we", "are", "providing" ]
078da6699c5c6c7ac4e5a3d36751d645ad8aa93e
https://github.com/mooti/framework/blob/078da6699c5c6c7ac4e5a3d36751d645ad8aa93e/src/ServiceProvider/ServiceProvider.php#L20-L27
6,389
nattreid/form
src/Rules.php
Rules.validateImage
public static function validateImage(UploadControl $control) { /* @var $file FileUpload */ $file = $control->getValue(); if (!in_array($file->getContentType(), ['image/gif', 'image/png', 'image/jpeg', 'image/svg+xml'], true)) { return false; } return true; }
php
public static function validateImage(UploadControl $control) { /* @var $file FileUpload */ $file = $control->getValue(); if (!in_array($file->getContentType(), ['image/gif', 'image/png', 'image/jpeg', 'image/svg+xml'], true)) { return false; } return true; }
[ "public", "static", "function", "validateImage", "(", "UploadControl", "$", "control", ")", "{", "/* @var $file FileUpload */", "$", "file", "=", "$", "control", "->", "getValue", "(", ")", ";", "if", "(", "!", "in_array", "(", "$", "file", "->", "getContent...
Validace obrazku + svg @param IControl $control @return bool
[ "Validace", "obrazku", "+", "svg" ]
d8b447f77e2374832e4c52520767847497a2033e
https://github.com/nattreid/form/blob/d8b447f77e2374832e4c52520767847497a2033e/src/Rules.php#L38-L47
6,390
Ocelot-Framework/ocelot-mvc
src/Beans/BeanUtils.php
BeanUtils.beansOfType
public static function beansOfType(ApplicationInterface $applicationContext, $class) { /** * @var $objectManager ObjectManagerInterface */ $objectManager = $applicationContext->search("ObjectManagerInterface"); $initialContext = new InitialContext(); $initialContext...
php
public static function beansOfType(ApplicationInterface $applicationContext, $class) { /** * @var $objectManager ObjectManagerInterface */ $objectManager = $applicationContext->search("ObjectManagerInterface"); $initialContext = new InitialContext(); $initialContext...
[ "public", "static", "function", "beansOfType", "(", "ApplicationInterface", "$", "applicationContext", ",", "$", "class", ")", "{", "/**\n * @var $objectManager ObjectManagerInterface\n */", "$", "objectManager", "=", "$", "applicationContext", "->", "search",...
Returns beans of a specific type @param ApplicationInterface $applicationContext The applicationContext to search in @param string $class The type of the beans @return array
[ "Returns", "beans", "of", "a", "specific", "type" ]
42a08208c6cebb87b363a0479331bafb7ec257c6
https://github.com/Ocelot-Framework/ocelot-mvc/blob/42a08208c6cebb87b363a0479331bafb7ec257c6/src/Beans/BeanUtils.php#L49-L66
6,391
Thuata/FrameworkBundle
Service/ServiceFactory.php
ServiceFactory.getFactorableInstance
public function getFactorableInstance(string $factorableClassName) { $factorable = $this->loadFromRegistry($factorableClassName); if (!$factorable instanceof AbstractService) { $factorable = parent::getFactorableInstance($factorableClassName); } return $factorable; ...
php
public function getFactorableInstance(string $factorableClassName) { $factorable = $this->loadFromRegistry($factorableClassName); if (!$factorable instanceof AbstractService) { $factorable = parent::getFactorableInstance($factorableClassName); } return $factorable; ...
[ "public", "function", "getFactorableInstance", "(", "string", "$", "factorableClassName", ")", "{", "$", "factorable", "=", "$", "this", "->", "loadFromRegistry", "(", "$", "factorableClassName", ")", ";", "if", "(", "!", "$", "factorable", "instanceof", "Abstra...
Gets a service @param string $factorableClassName @return AbstractService
[ "Gets", "a", "service" ]
78c38a5103256d829d7f7574b4e15c9087d0cfd9
https://github.com/Thuata/FrameworkBundle/blob/78c38a5103256d829d7f7574b4e15c9087d0cfd9/Service/ServiceFactory.php#L79-L88
6,392
Jinxes/layton
Layton/Library/Http/Headers.php
Headers.create
public static function create(array $params = []) { $headers = new static(); foreach ($params as $key => $value) { $headers->set($key, $value); } return $headers; }
php
public static function create(array $params = []) { $headers = new static(); foreach ($params as $key => $value) { $headers->set($key, $value); } return $headers; }
[ "public", "static", "function", "create", "(", "array", "$", "params", "=", "[", "]", ")", "{", "$", "headers", "=", "new", "static", "(", ")", ";", "foreach", "(", "$", "params", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "headers", "-...
Create the default values from httpMessages array. @param array $httpMessages @return static
[ "Create", "the", "default", "values", "from", "httpMessages", "array", "." ]
27b8eab2c59b9887eb93e40a533eb77cc5690584
https://github.com/Jinxes/layton/blob/27b8eab2c59b9887eb93e40a533eb77cc5690584/Layton/Library/Http/Headers.php#L15-L22
6,393
Jinxes/layton
Layton/Library/Http/Headers.php
Headers.toPreserveCase
public static function toPreserveCase($name) { $params = explode('-', $name); $newName = []; foreach ($params as $param) { $newName[] = ucwords($param); } return implode('-', $newName); }
php
public static function toPreserveCase($name) { $params = explode('-', $name); $newName = []; foreach ($params as $param) { $newName[] = ucwords($param); } return implode('-', $newName); }
[ "public", "static", "function", "toPreserveCase", "(", "$", "name", ")", "{", "$", "params", "=", "explode", "(", "'-'", ",", "$", "name", ")", ";", "$", "newName", "=", "[", "]", ";", "foreach", "(", "$", "params", "as", "$", "param", ")", "{", ...
Replace name to preserve case format. @param string $name @return string
[ "Replace", "name", "to", "preserve", "case", "format", "." ]
27b8eab2c59b9887eb93e40a533eb77cc5690584
https://github.com/Jinxes/layton/blob/27b8eab2c59b9887eb93e40a533eb77cc5690584/Layton/Library/Http/Headers.php#L46-L54
6,394
Jinxes/layton
Layton/Library/Http/Headers.php
Headers.allPreserveCase
public function allPreserveCase() { $fields = $this->all(); $raw = []; foreach ($fields as $key => $field) { $raw[static::toPreserveCase($key)] = $field; } return $raw; }
php
public function allPreserveCase() { $fields = $this->all(); $raw = []; foreach ($fields as $key => $field) { $raw[static::toPreserveCase($key)] = $field; } return $raw; }
[ "public", "function", "allPreserveCase", "(", ")", "{", "$", "fields", "=", "$", "this", "->", "all", "(", ")", ";", "$", "raw", "=", "[", "]", ";", "foreach", "(", "$", "fields", "as", "$", "key", "=>", "$", "field", ")", "{", "$", "raw", "[",...
Get all header fields with Preserve Case format. @return array
[ "Get", "all", "header", "fields", "with", "Preserve", "Case", "format", "." ]
27b8eab2c59b9887eb93e40a533eb77cc5690584
https://github.com/Jinxes/layton/blob/27b8eab2c59b9887eb93e40a533eb77cc5690584/Layton/Library/Http/Headers.php#L120-L128
6,395
larawos/framework
src/Illuminate/Foundation/Console/ControllerMakeCommand.php
ControllerMakeCommand.buildRequestReplacements
protected function buildRequestReplacements() { $name = $this->getNameInput(); $rootNamespace = trim( $this->laravel->getNamespace() . 'Http\Requests' . '\\' . $this->getNamespace($name), '\\' ); $storeRequest = $rootNamespace . '\\' . str_replace(...
php
protected function buildRequestReplacements() { $name = $this->getNameInput(); $rootNamespace = trim( $this->laravel->getNamespace() . 'Http\Requests' . '\\' . $this->getNamespace($name), '\\' ); $storeRequest = $rootNamespace . '\\' . str_replace(...
[ "protected", "function", "buildRequestReplacements", "(", ")", "{", "$", "name", "=", "$", "this", "->", "getNameInput", "(", ")", ";", "$", "rootNamespace", "=", "trim", "(", "$", "this", "->", "laravel", "->", "getNamespace", "(", ")", ".", "'Http\\Reque...
Build the request replacement values. @param array $replace @return array
[ "Build", "the", "request", "replacement", "values", "." ]
d4366ead47e39e604ba7afb2804ad3388691ecca
https://github.com/larawos/framework/blob/d4366ead47e39e604ba7afb2804ad3388691ecca/src/Illuminate/Foundation/Console/ControllerMakeCommand.php#L125-L153
6,396
larawos/framework
src/Illuminate/Foundation/Console/ControllerMakeCommand.php
ControllerMakeCommand.buildResourceReplacements
protected function buildResourceReplacements(array $replace) { $name = $this->getNameInput(); $rootNamespace = trim( $this->laravel->getNamespace() . 'Http\Resources' . '\\' . $this->getNamespace($name), '\\' ); $indexResource = $rootNamespace . '\...
php
protected function buildResourceReplacements(array $replace) { $name = $this->getNameInput(); $rootNamespace = trim( $this->laravel->getNamespace() . 'Http\Resources' . '\\' . $this->getNamespace($name), '\\' ); $indexResource = $rootNamespace . '\...
[ "protected", "function", "buildResourceReplacements", "(", "array", "$", "replace", ")", "{", "$", "name", "=", "$", "this", "->", "getNameInput", "(", ")", ";", "$", "rootNamespace", "=", "trim", "(", "$", "this", "->", "laravel", "->", "getNamespace", "(...
Build the resource replacement values. @param array $replace @return array
[ "Build", "the", "resource", "replacement", "values", "." ]
d4366ead47e39e604ba7afb2804ad3388691ecca
https://github.com/larawos/framework/blob/d4366ead47e39e604ba7afb2804ad3388691ecca/src/Illuminate/Foundation/Console/ControllerMakeCommand.php#L161-L216
6,397
larawos/framework
src/Illuminate/Foundation/Console/ControllerMakeCommand.php
ControllerMakeCommand.buildRepositoryReplacements
protected function buildRepositoryReplacements(array $replace) { $repository = $this->parseRepository($this->option('repository')); if (empty(trim($repository, $this->laravel->getNamespace(). 'Repositories\\'))) { $repository = $this->parseRepository($this->ask('witch repository do you ...
php
protected function buildRepositoryReplacements(array $replace) { $repository = $this->parseRepository($this->option('repository')); if (empty(trim($repository, $this->laravel->getNamespace(). 'Repositories\\'))) { $repository = $this->parseRepository($this->ask('witch repository do you ...
[ "protected", "function", "buildRepositoryReplacements", "(", "array", "$", "replace", ")", "{", "$", "repository", "=", "$", "this", "->", "parseRepository", "(", "$", "this", "->", "option", "(", "'repository'", ")", ")", ";", "if", "(", "empty", "(", "tr...
Build the repository replacement values. @param array $replace @return array
[ "Build", "the", "repository", "replacement", "values", "." ]
d4366ead47e39e604ba7afb2804ad3388691ecca
https://github.com/larawos/framework/blob/d4366ead47e39e604ba7afb2804ad3388691ecca/src/Illuminate/Foundation/Console/ControllerMakeCommand.php#L255-L277
6,398
larawos/framework
src/Illuminate/Foundation/Console/ControllerMakeCommand.php
ControllerMakeCommand.parseRepository
protected function parseRepository($repository) { if (preg_match('([^A-Za-z0-9_/\\\\])', $repository)) { throw new InvalidArgumentException('Repository name contains invalid characters.'); } $repository = trim(str_replace('/', '\\', $repository), '\\'); if (! Str::start...
php
protected function parseRepository($repository) { if (preg_match('([^A-Za-z0-9_/\\\\])', $repository)) { throw new InvalidArgumentException('Repository name contains invalid characters.'); } $repository = trim(str_replace('/', '\\', $repository), '\\'); if (! Str::start...
[ "protected", "function", "parseRepository", "(", "$", "repository", ")", "{", "if", "(", "preg_match", "(", "'([^A-Za-z0-9_/\\\\\\\\])'", ",", "$", "repository", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "'Repository name contains invalid character...
Get the fully-qualified repository class name. @param string $repository @return string
[ "Get", "the", "fully", "-", "qualified", "repository", "class", "name", "." ]
d4366ead47e39e604ba7afb2804ad3388691ecca
https://github.com/larawos/framework/blob/d4366ead47e39e604ba7afb2804ad3388691ecca/src/Illuminate/Foundation/Console/ControllerMakeCommand.php#L285-L298
6,399
larawos/framework
src/Illuminate/Foundation/Console/ControllerMakeCommand.php
ControllerMakeCommand.getViewModuleFiles
protected function getViewModuleFiles($view) { $rootPath = resource_path('views/' . str_replace('.', '/', $view)); return [ $rootPath . '/index', $rootPath . '/show', $rootPath . '/create', $rootPath . '/edit' ]; }
php
protected function getViewModuleFiles($view) { $rootPath = resource_path('views/' . str_replace('.', '/', $view)); return [ $rootPath . '/index', $rootPath . '/show', $rootPath . '/create', $rootPath . '/edit' ]; }
[ "protected", "function", "getViewModuleFiles", "(", "$", "view", ")", "{", "$", "rootPath", "=", "resource_path", "(", "'views/'", ".", "str_replace", "(", "'.'", ",", "'/'", ",", "$", "view", ")", ")", ";", "return", "[", "$", "rootPath", ".", "'/index'...
Get the view files. @param string $view @return array
[ "Get", "the", "view", "files", "." ]
d4366ead47e39e604ba7afb2804ad3388691ecca
https://github.com/larawos/framework/blob/d4366ead47e39e604ba7afb2804ad3388691ecca/src/Illuminate/Foundation/Console/ControllerMakeCommand.php#L344-L354