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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
44,700 | commercetools/commercetools-php-sdk | src/Core/Client.php | Client.addBatchRequest | public function addBatchRequest(ClientRequestInterface $request)
{
if ($request instanceof ContextAwareInterface) {
$request->setContextIfNull($this->getConfig()->getContext());
}
$this->batchRequests[] = $request;
return $this;
} | php | public function addBatchRequest(ClientRequestInterface $request)
{
if ($request instanceof ContextAwareInterface) {
$request->setContextIfNull($this->getConfig()->getContext());
}
$this->batchRequests[] = $request;
return $this;
} | [
"public",
"function",
"addBatchRequest",
"(",
"ClientRequestInterface",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"request",
"instanceof",
"ContextAwareInterface",
")",
"{",
"$",
"request",
"->",
"setContextIfNull",
"(",
"$",
"this",
"->",
"getConfig",
"(",
")",... | Adds a request to the batch execution queue
@param ClientRequestInterface $request
@return $this | [
"Adds",
"a",
"request",
"to",
"the",
"batch",
"execution",
"queue"
] | 53ac8b0929b56e10bc7f05d1b363688cd7038184 | https://github.com/commercetools/commercetools-php-sdk/blob/53ac8b0929b56e10bc7f05d1b363688cd7038184/src/Core/Client.php#L467-L474 |
44,701 | commercetools/commercetools-php-sdk | src/Core/Client/Adapter/Guzzle6Adapter.php | Guzzle6Adapter.log | private static function log(LoggerInterface $logger, MessageFormatter $formatter, $logLevel = LogLevel::INFO)
{
return function (callable $handler) use ($logger, $formatter, $logLevel) {
return function ($request, array $options) use ($handler, $logger, $formatter, $logLevel) {
return $handler($request, $options)->then(
function ($response) use ($logger, $request, $formatter, $logLevel) {
$message = $formatter->format($request, $response);
$context = [
AbstractApiResponse::X_CORRELATION_ID => $response->getHeader(
AbstractApiResponse::X_CORRELATION_ID
)
];
$logger->log($logLevel, $message, $context);
return $response;
},
function ($reason) use ($logger, $request, $formatter) {
$response = null;
$context = [];
if ($reason instanceof RequestException) {
$response = $reason->getResponse();
if (!is_null($response)) {
$context[AbstractApiResponse::X_CORRELATION_ID] = $response->getHeader(
AbstractApiResponse::X_CORRELATION_ID
);
}
}
$message = $formatter->format($request, $response, $reason);
$logger->notice($message, $context);
return \GuzzleHttp\Promise\rejection_for($reason);
}
);
};
};
} | php | private static function log(LoggerInterface $logger, MessageFormatter $formatter, $logLevel = LogLevel::INFO)
{
return function (callable $handler) use ($logger, $formatter, $logLevel) {
return function ($request, array $options) use ($handler, $logger, $formatter, $logLevel) {
return $handler($request, $options)->then(
function ($response) use ($logger, $request, $formatter, $logLevel) {
$message = $formatter->format($request, $response);
$context = [
AbstractApiResponse::X_CORRELATION_ID => $response->getHeader(
AbstractApiResponse::X_CORRELATION_ID
)
];
$logger->log($logLevel, $message, $context);
return $response;
},
function ($reason) use ($logger, $request, $formatter) {
$response = null;
$context = [];
if ($reason instanceof RequestException) {
$response = $reason->getResponse();
if (!is_null($response)) {
$context[AbstractApiResponse::X_CORRELATION_ID] = $response->getHeader(
AbstractApiResponse::X_CORRELATION_ID
);
}
}
$message = $formatter->format($request, $response, $reason);
$logger->notice($message, $context);
return \GuzzleHttp\Promise\rejection_for($reason);
}
);
};
};
} | [
"private",
"static",
"function",
"log",
"(",
"LoggerInterface",
"$",
"logger",
",",
"MessageFormatter",
"$",
"formatter",
",",
"$",
"logLevel",
"=",
"LogLevel",
"::",
"INFO",
")",
"{",
"return",
"function",
"(",
"callable",
"$",
"handler",
")",
"use",
"(",
... | Middleware that logs requests, responses, and errors using a message
formatter.
@param LoggerInterface $logger Logs messages.
@param MessageFormatter $formatter Formatter used to create message strings.
@param string $logLevel Level at which to log requests.
@return callable Returns a function that accepts the next handler. | [
"Middleware",
"that",
"logs",
"requests",
"responses",
"and",
"errors",
"using",
"a",
"message",
"formatter",
"."
] | 53ac8b0929b56e10bc7f05d1b363688cd7038184 | https://github.com/commercetools/commercetools-php-sdk/blob/53ac8b0929b56e10bc7f05d1b363688cd7038184/src/Core/Client/Adapter/Guzzle6Adapter.php#L89-L122 |
44,702 | crisu83/yiistrap | behaviors/TbWidget.php | TbWidget.resolveId | public function resolveId($id = null)
{
if ($id === null) {
$id = $this->owner->getId();
}
if (isset($this->owner->htmlOptions['id'])) {
$id = $this->owner->htmlOptions['id'];
} else {
$this->owner->htmlOptions['id'] = $id;
}
return $id;
} | php | public function resolveId($id = null)
{
if ($id === null) {
$id = $this->owner->getId();
}
if (isset($this->owner->htmlOptions['id'])) {
$id = $this->owner->htmlOptions['id'];
} else {
$this->owner->htmlOptions['id'] = $id;
}
return $id;
} | [
"public",
"function",
"resolveId",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"null",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"owner",
"->",
"getId",
"(",
")",
";",
"}",
"if",
"(",
"isset",
"(",
"$",
"this",
"->"... | Returns the widget id and copies it to HTML attributes or vice versa.
@param string $id the widget id.
@return string the widget id. | [
"Returns",
"the",
"widget",
"id",
"and",
"copies",
"it",
"to",
"HTML",
"attributes",
"or",
"vice",
"versa",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/behaviors/TbWidget.php#L25-L36 |
44,703 | crisu83/yiistrap | behaviors/TbWidget.php | TbWidget.copyId | public function copyId()
{
// todo: remove this when it's safe to do so.
if (!isset($this->owner->htmlOptions['id'])) {
$this->owner->htmlOptions['id'] = $this->owner->id;
} else {
$this->owner->id = $this->owner->htmlOptions['id'];
}
} | php | public function copyId()
{
// todo: remove this when it's safe to do so.
if (!isset($this->owner->htmlOptions['id'])) {
$this->owner->htmlOptions['id'] = $this->owner->id;
} else {
$this->owner->id = $this->owner->htmlOptions['id'];
}
} | [
"public",
"function",
"copyId",
"(",
")",
"{",
"// todo: remove this when it's safe to do so.",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"owner",
"->",
"htmlOptions",
"[",
"'id'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"owner",
"->",
"htmlOptions",
... | Copies the id to the widget HTML attributes or vise versa.
@deprecated by TbWidget::resolveId | [
"Copies",
"the",
"id",
"to",
"the",
"widget",
"HTML",
"attributes",
"or",
"vise",
"versa",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/behaviors/TbWidget.php#L42-L50 |
44,704 | crisu83/yiistrap | behaviors/TbWidget.php | TbWidget.publishAssets | public function publishAssets($path, $forceCopy = false)
{
if (!Yii::app()->hasComponent('assetManager')) {
throw new CException('Failed to locate the asset manager component.');
}
/* @var CAssetManager $assetManager */
$assetManager = Yii::app()->getComponent('assetManager');
$assetsUrl = $assetManager->publish($path, false, -1, $forceCopy);
return $this->_assetsUrl = $assetsUrl;
} | php | public function publishAssets($path, $forceCopy = false)
{
if (!Yii::app()->hasComponent('assetManager')) {
throw new CException('Failed to locate the asset manager component.');
}
/* @var CAssetManager $assetManager */
$assetManager = Yii::app()->getComponent('assetManager');
$assetsUrl = $assetManager->publish($path, false, -1, $forceCopy);
return $this->_assetsUrl = $assetsUrl;
} | [
"public",
"function",
"publishAssets",
"(",
"$",
"path",
",",
"$",
"forceCopy",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"Yii",
"::",
"app",
"(",
")",
"->",
"hasComponent",
"(",
"'assetManager'",
")",
")",
"{",
"throw",
"new",
"CException",
"(",
"'Faile... | Publishes an asset path.
@param string $path the assets path.
@param boolean $forceCopy whether we should copy the asset files even if they are already published before.
@return string the url.
@throws CException if the asset manager cannot be located. | [
"Publishes",
"an",
"asset",
"path",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/behaviors/TbWidget.php#L59-L68 |
44,705 | crisu83/yiistrap | behaviors/TbWidget.php | TbWidget.resolveScriptVersion | public function resolveScriptVersion($filename, $minified = false)
{
list($name, $extension) = str_split($filename, strrpos($filename, '.') + 1);
return !$minified ? $name . $extension : $name . 'min.' . $extension;
} | php | public function resolveScriptVersion($filename, $minified = false)
{
list($name, $extension) = str_split($filename, strrpos($filename, '.') + 1);
return !$minified ? $name . $extension : $name . 'min.' . $extension;
} | [
"public",
"function",
"resolveScriptVersion",
"(",
"$",
"filename",
",",
"$",
"minified",
"=",
"false",
")",
"{",
"list",
"(",
"$",
"name",
",",
"$",
"extension",
")",
"=",
"str_split",
"(",
"$",
"filename",
",",
"strrpos",
"(",
"$",
"filename",
",",
"... | Returns the name of the correct script file to use.
@param string $filename the base file name.
@param boolean $minified whether to include the minified version (defaults to false).
@return string the full filename. | [
"Returns",
"the",
"name",
"of",
"the",
"correct",
"script",
"file",
"to",
"use",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/behaviors/TbWidget.php#L102-L106 |
44,706 | crisu83/yiistrap | behaviors/TbWidget.php | TbWidget.registerPlugin | public function registerPlugin($name, $selector, $options = array(), $position = CClientScript::POS_END)
{
if (($api = $this->getApi()) !== null) {
$api->registerPlugin($name, $selector, $options, $position);
return true;
}
return false;
} | php | public function registerPlugin($name, $selector, $options = array(), $position = CClientScript::POS_END)
{
if (($api = $this->getApi()) !== null) {
$api->registerPlugin($name, $selector, $options, $position);
return true;
}
return false;
} | [
"public",
"function",
"registerPlugin",
"(",
"$",
"name",
",",
"$",
"selector",
",",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"position",
"=",
"CClientScript",
"::",
"POS_END",
")",
"{",
"if",
"(",
"(",
"$",
"api",
"=",
"$",
"this",
"->",
... | Registers the given plugin with the API.
@param string $name the plugin name.
@param string $selector the CSS selector.
@param array $options the JavaScript options for the plugin.
@param int $position the position of the JavaScript code.
@return boolean whether the plugin was registered. | [
"Registers",
"the",
"given",
"plugin",
"with",
"the",
"API",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/behaviors/TbWidget.php#L116-L123 |
44,707 | crisu83/yiistrap | behaviors/TbWidget.php | TbWidget.registerEvents | public function registerEvents($selector, $events, $position = CClientScript::POS_END)
{
if (($api = $this->getApi()) !== null) {
$api->registerEvents($selector, $events, $position);
return true;
}
return false;
} | php | public function registerEvents($selector, $events, $position = CClientScript::POS_END)
{
if (($api = $this->getApi()) !== null) {
$api->registerEvents($selector, $events, $position);
return true;
}
return false;
} | [
"public",
"function",
"registerEvents",
"(",
"$",
"selector",
",",
"$",
"events",
",",
"$",
"position",
"=",
"CClientScript",
"::",
"POS_END",
")",
"{",
"if",
"(",
"(",
"$",
"api",
"=",
"$",
"this",
"->",
"getApi",
"(",
")",
")",
"!==",
"null",
")",
... | Registers plugin events with the API.
@param string $selector the CSS selector.
@param string[] $events the JavaScript event configuration (name=>handler).
@param int $position the position of the JavaScript code.
@return boolean whether the events were registered. | [
"Registers",
"plugin",
"events",
"with",
"the",
"API",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/behaviors/TbWidget.php#L132-L139 |
44,708 | crisu83/yiistrap | behaviors/TbWidget.php | TbWidget.getApi | protected function getApi()
{
if (isset($this->_api)) {
return $this->_api;
} else {
return $this->_api = Yii::app()->getComponent('bootstrap');
}
} | php | protected function getApi()
{
if (isset($this->_api)) {
return $this->_api;
} else {
return $this->_api = Yii::app()->getComponent('bootstrap');
}
} | [
"protected",
"function",
"getApi",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_api",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_api",
";",
"}",
"else",
"{",
"return",
"$",
"this",
"->",
"_api",
"=",
"Yii",
"::",
"app",
"(",
... | Returns the API instance.
@return TbApi the api. | [
"Returns",
"the",
"API",
"instance",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/behaviors/TbWidget.php#L145-L152 |
44,709 | crisu83/yiistrap | behaviors/TbWidget.php | TbWidget.getClientScript | protected function getClientScript()
{
if (isset($this->_clientScript)) {
return $this->_clientScript;
} else {
if (!Yii::app()->hasComponent('clientScript')) {
return false;
}
return $this->_clientScript = Yii::app()->getComponent('clientScript');
}
} | php | protected function getClientScript()
{
if (isset($this->_clientScript)) {
return $this->_clientScript;
} else {
if (!Yii::app()->hasComponent('clientScript')) {
return false;
}
return $this->_clientScript = Yii::app()->getComponent('clientScript');
}
} | [
"protected",
"function",
"getClientScript",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_clientScript",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_clientScript",
";",
"}",
"else",
"{",
"if",
"(",
"!",
"Yii",
"::",
"app",
"(",
")",
... | Returns the client script component.
@return CClientScript the component. | [
"Returns",
"the",
"client",
"script",
"component",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/behaviors/TbWidget.php#L158-L168 |
44,710 | crisu83/yiistrap | form/TbForm.php | TbForm.init | public function init()
{
TbArray::defaultValue('layout', $this->layout, $this->activeForm);
TbArray::defaultValue('class', '\TbActiveForm', $this->activeForm);
} | php | public function init()
{
TbArray::defaultValue('layout', $this->layout, $this->activeForm);
TbArray::defaultValue('class', '\TbActiveForm', $this->activeForm);
} | [
"public",
"function",
"init",
"(",
")",
"{",
"TbArray",
"::",
"defaultValue",
"(",
"'layout'",
",",
"$",
"this",
"->",
"layout",
",",
"$",
"this",
"->",
"activeForm",
")",
";",
"TbArray",
"::",
"defaultValue",
"(",
"'class'",
",",
"'\\TbActiveForm'",
",",
... | Initializes this form. | [
"Initializes",
"this",
"form",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/form/TbForm.php#L38-L42 |
44,711 | crisu83/yiistrap | form/TbForm.php | TbForm.renderButtons | public function renderButtons()
{
$buttons = array();
foreach ($this->getButtons() as $button) {
$buttons[] = $this->renderElement($button);
}
return $this->getActiveFormWidget()->createFormActions($buttons);
} | php | public function renderButtons()
{
$buttons = array();
foreach ($this->getButtons() as $button) {
$buttons[] = $this->renderElement($button);
}
return $this->getActiveFormWidget()->createFormActions($buttons);
} | [
"public",
"function",
"renderButtons",
"(",
")",
"{",
"$",
"buttons",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getButtons",
"(",
")",
"as",
"$",
"button",
")",
"{",
"$",
"buttons",
"[",
"]",
"=",
"$",
"this",
"->",
"renderEl... | Renders the buttons in this form.
@return string the rendering result. | [
"Renders",
"the",
"buttons",
"in",
"this",
"form",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/form/TbForm.php#L73-L80 |
44,712 | crisu83/yiistrap | widgets/TbPager.php | TbPager.createPageLink | protected function createPageLink($label, $page, $disabled, $active)
{
return array(
'label' => $label,
'url' => $this->createPageUrl($page),
'disabled' => $disabled,
'active' => $active,
);
} | php | protected function createPageLink($label, $page, $disabled, $active)
{
return array(
'label' => $label,
'url' => $this->createPageUrl($page),
'disabled' => $disabled,
'active' => $active,
);
} | [
"protected",
"function",
"createPageLink",
"(",
"$",
"label",
",",
"$",
"page",
",",
"$",
"disabled",
",",
"$",
"active",
")",
"{",
"return",
"array",
"(",
"'label'",
"=>",
"$",
"label",
",",
"'url'",
"=>",
"$",
"this",
"->",
"createPageUrl",
"(",
"$",... | Creates a page link.
@param string $label the link label text.
@param integer $page the page number.
@param boolean $visible whether the link is disabled.
@param boolean $active whether the link is active.
@return string the generated link. | [
"Creates",
"a",
"page",
"link",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbPager.php#L134-L142 |
44,713 | crisu83/yiistrap | widgets/TbDataColumn.php | TbDataColumn.renderFilterCellContent | protected function renderFilterCellContent()
{
if (is_string($this->filter)) {
echo $this->filter;
} else {
if ($this->filter !== false && $this->grid->filter !== null && $this->name !== null && strpos(
$this->name,
'.'
) === false
) {
if ($this->filterInputOptions) {
$filterInputOptions = $this->filterInputOptions;
if (empty($filterInputOptions['id'])) {
$filterInputOptions['id'] = false;
}
} else {
$filterInputOptions = array();
}
if (is_array($this->filter)) {
$filterInputOptions['prompt'] = '';
echo TbHtml::activeDropDownList(
$this->grid->filter,
$this->name,
$this->filter,
$filterInputOptions
);
} else {
if ($this->filter === null) {
echo TbHtml::activeTextField($this->grid->filter, $this->name, $filterInputOptions);
}
}
} else {
parent::renderFilterCellContent();
}
}
} | php | protected function renderFilterCellContent()
{
if (is_string($this->filter)) {
echo $this->filter;
} else {
if ($this->filter !== false && $this->grid->filter !== null && $this->name !== null && strpos(
$this->name,
'.'
) === false
) {
if ($this->filterInputOptions) {
$filterInputOptions = $this->filterInputOptions;
if (empty($filterInputOptions['id'])) {
$filterInputOptions['id'] = false;
}
} else {
$filterInputOptions = array();
}
if (is_array($this->filter)) {
$filterInputOptions['prompt'] = '';
echo TbHtml::activeDropDownList(
$this->grid->filter,
$this->name,
$this->filter,
$filterInputOptions
);
} else {
if ($this->filter === null) {
echo TbHtml::activeTextField($this->grid->filter, $this->name, $filterInputOptions);
}
}
} else {
parent::renderFilterCellContent();
}
}
} | [
"protected",
"function",
"renderFilterCellContent",
"(",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"filter",
")",
")",
"{",
"echo",
"$",
"this",
"->",
"filter",
";",
"}",
"else",
"{",
"if",
"(",
"$",
"this",
"->",
"filter",
"!==",
"fa... | Renders the filter cell content. Here we can provide HTML options for actual filter input | [
"Renders",
"the",
"filter",
"cell",
"content",
".",
"Here",
"we",
"can",
"provide",
"HTML",
"options",
"for",
"actual",
"filter",
"input"
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbDataColumn.php#L67-L102 |
44,714 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.textField | public function textField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_TEXT, $model, $attribute, $htmlOptions);
} | php | public function textField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_TEXT, $model, $attribute, $htmlOptions);
} | [
"public",
"function",
"textField",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createInput",
"(",
"TbHtml",
"::",
"INPUT_TYPE_TEXT",
",",
"$",
"model",
",",
"$",
"at... | Generates a text field for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $htmlOptions additional HTML attributes.
@return string the generated input field.
@see TbHtml::activeTextField | [
"Generates",
"a",
"text",
"field",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L185-L188 |
44,715 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.passwordField | public function passwordField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_PASSWORD, $model, $attribute, $htmlOptions);
} | php | public function passwordField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_PASSWORD, $model, $attribute, $htmlOptions);
} | [
"public",
"function",
"passwordField",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createInput",
"(",
"TbHtml",
"::",
"INPUT_TYPE_PASSWORD",
",",
"$",
"model",
",",
"$... | Generates a password field for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $htmlOptions additional HTML attributes.
@return string the generated input field.
@see TbHtml::activePasswordField | [
"Generates",
"a",
"password",
"field",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L198-L201 |
44,716 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.urlField | public function urlField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_URL, $model, $attribute, $htmlOptions);
} | php | public function urlField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_URL, $model, $attribute, $htmlOptions);
} | [
"public",
"function",
"urlField",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createInput",
"(",
"TbHtml",
"::",
"INPUT_TYPE_URL",
",",
"$",
"model",
",",
"$",
"attr... | Generates an url field for a model attribute.
@param CModel $model the data model
@param string $attribute the attribute
@param array $htmlOptions additional HTML attributes.
@return string the generated input field
@see TbHtml::activeUrlField | [
"Generates",
"an",
"url",
"field",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L211-L214 |
44,717 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.emailField | public function emailField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_EMAIL, $model, $attribute, $htmlOptions);
} | php | public function emailField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_EMAIL, $model, $attribute, $htmlOptions);
} | [
"public",
"function",
"emailField",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createInput",
"(",
"TbHtml",
"::",
"INPUT_TYPE_EMAIL",
",",
"$",
"model",
",",
"$",
"... | Generates an email field for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $htmlOptions additional HTML attributes.
@return string the generated input field.
@see TbHtml::activeEmailField | [
"Generates",
"an",
"email",
"field",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L224-L227 |
44,718 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.numberField | public function numberField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_NUMBER, $model, $attribute, $htmlOptions);
} | php | public function numberField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_NUMBER, $model, $attribute, $htmlOptions);
} | [
"public",
"function",
"numberField",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createInput",
"(",
"TbHtml",
"::",
"INPUT_TYPE_NUMBER",
",",
"$",
"model",
",",
"$",
... | Generates a number field for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $htmlOptions additional HTML attributes.
@return string the generated input field.
@see TbHtml::activeNumberField | [
"Generates",
"a",
"number",
"field",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L237-L240 |
44,719 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.rangeField | public function rangeField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_RANGE, $model, $attribute, $htmlOptions);
} | php | public function rangeField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_RANGE, $model, $attribute, $htmlOptions);
} | [
"public",
"function",
"rangeField",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createInput",
"(",
"TbHtml",
"::",
"INPUT_TYPE_RANGE",
",",
"$",
"model",
",",
"$",
"... | Generates a range field for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $htmlOptions additional HTML attributes.
@return string the generated input field.
@see TbHtml::activeRangeField | [
"Generates",
"a",
"range",
"field",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L250-L253 |
44,720 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.dateField | public function dateField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_DATE, $model, $attribute, $htmlOptions);
} | php | public function dateField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_DATE, $model, $attribute, $htmlOptions);
} | [
"public",
"function",
"dateField",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createInput",
"(",
"TbHtml",
"::",
"INPUT_TYPE_DATE",
",",
"$",
"model",
",",
"$",
"at... | Generates a date field for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $htmlOptions additional HTML attributes.
@return string the generated input field. | [
"Generates",
"a",
"date",
"field",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L262-L265 |
44,721 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.textArea | public function textArea($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_TEXTAREA, $model, $attribute, $htmlOptions);
} | php | public function textArea($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_TEXTAREA, $model, $attribute, $htmlOptions);
} | [
"public",
"function",
"textArea",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createInput",
"(",
"TbHtml",
"::",
"INPUT_TYPE_TEXTAREA",
",",
"$",
"model",
",",
"$",
... | Generates a text area for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $htmlOptions additional HTML attributes.
@return string the generated text area.
@see TbHtml::activeTextArea | [
"Generates",
"a",
"text",
"area",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L275-L278 |
44,722 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.fileField | public function fileField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_FILE, $model, $attribute, $htmlOptions);
} | php | public function fileField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_FILE, $model, $attribute, $htmlOptions);
} | [
"public",
"function",
"fileField",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createInput",
"(",
"TbHtml",
"::",
"INPUT_TYPE_FILE",
",",
"$",
"model",
",",
"$",
"at... | Generates a file field for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $htmlOptions additional HTML attributes
@return string the generated input field.
@see TbHtml::activeFileField | [
"Generates",
"a",
"file",
"field",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L288-L291 |
44,723 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.radioButton | public function radioButton($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_RADIOBUTTON, $model, $attribute, $htmlOptions);
} | php | public function radioButton($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_RADIOBUTTON, $model, $attribute, $htmlOptions);
} | [
"public",
"function",
"radioButton",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createInput",
"(",
"TbHtml",
"::",
"INPUT_TYPE_RADIOBUTTON",
",",
"$",
"model",
",",
"... | Generates a radio button for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $htmlOptions additional HTML attributes.
@return string the generated radio button.
@see TbHtml::activeRadioButton | [
"Generates",
"a",
"radio",
"button",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L301-L304 |
44,724 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.checkBox | public function checkBox($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_CHECKBOX, $model, $attribute, $htmlOptions);
} | php | public function checkBox($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_CHECKBOX, $model, $attribute, $htmlOptions);
} | [
"public",
"function",
"checkBox",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createInput",
"(",
"TbHtml",
"::",
"INPUT_TYPE_CHECKBOX",
",",
"$",
"model",
",",
"$",
... | Generates a checkbox for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $htmlOptions additional HTML attributes.
@return string the generated check box.
@see TbHtml::activeCheckBox | [
"Generates",
"a",
"checkbox",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L314-L317 |
44,725 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.dropDownList | public function dropDownList($model, $attribute, $data, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_DROPDOWNLIST, $model, $attribute, $htmlOptions, $data);
} | php | public function dropDownList($model, $attribute, $data, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_DROPDOWNLIST, $model, $attribute, $htmlOptions, $data);
} | [
"public",
"function",
"dropDownList",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"data",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createInput",
"(",
"TbHtml",
"::",
"INPUT_TYPE_DROPDOWNLIST",
",",
... | Generates a dropdown list for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $data data for generating the list options (value=>display).
@param array $htmlOptions additional HTML attributes.
@return string the generated drop down list.
@see TbHtml::activeDropDownList | [
"Generates",
"a",
"dropdown",
"list",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L328-L331 |
44,726 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.radioButtonList | public function radioButtonList($model, $attribute, $data, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_RADIOBUTTONLIST, $model, $attribute, $htmlOptions, $data);
} | php | public function radioButtonList($model, $attribute, $data, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_RADIOBUTTONLIST, $model, $attribute, $htmlOptions, $data);
} | [
"public",
"function",
"radioButtonList",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"data",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createInput",
"(",
"TbHtml",
"::",
"INPUT_TYPE_RADIOBUTTONLIST",
"... | Generates a radio button list for a model attribute
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $data data for generating the list options (value=>display)
@param array $htmlOptions additional HTML attributes.
@return string the generated radio button list.
@see TbHtml::activeRadioButtonList | [
"Generates",
"a",
"radio",
"button",
"list",
"for",
"a",
"model",
"attribute"
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L356-L359 |
44,727 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.inlineRadioButtonList | public function inlineRadioButtonList($model, $attribute, $data, $htmlOptions = array())
{
$htmlOptions['inline'] = true;
return $this->createInput(TbHtml::INPUT_TYPE_RADIOBUTTONLIST, $model, $attribute, $htmlOptions, $data);
} | php | public function inlineRadioButtonList($model, $attribute, $data, $htmlOptions = array())
{
$htmlOptions['inline'] = true;
return $this->createInput(TbHtml::INPUT_TYPE_RADIOBUTTONLIST, $model, $attribute, $htmlOptions, $data);
} | [
"public",
"function",
"inlineRadioButtonList",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"data",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"$",
"htmlOptions",
"[",
"'inline'",
"]",
"=",
"true",
";",
"return",
"$",
"this",
"->... | Generates an inline radio button list for a model attribute
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $data data for generating the list options (value=>display)
@param array $htmlOptions additional HTML attributes.
@return string the generated radio button list.
@see TbHtml::activeInlineRadioButtonList | [
"Generates",
"an",
"inline",
"radio",
"button",
"list",
"for",
"a",
"model",
"attribute"
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L370-L374 |
44,728 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.checkBoxList | public function checkBoxList($model, $attribute, $data, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_CHECKBOXLIST, $model, $attribute, $htmlOptions, $data);
} | php | public function checkBoxList($model, $attribute, $data, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_CHECKBOXLIST, $model, $attribute, $htmlOptions, $data);
} | [
"public",
"function",
"checkBoxList",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"data",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createInput",
"(",
"TbHtml",
"::",
"INPUT_TYPE_CHECKBOXLIST",
",",
... | Generates a checkbox list for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $data data for generating the list options (value=>display)
@param array $htmlOptions additional HTML attributes.
@return string the generated checkbox list.
@see TbHtml::activeCheckBoxList | [
"Generates",
"a",
"checkbox",
"list",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L385-L388 |
44,729 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.inlineCheckBoxList | public function inlineCheckBoxList($model, $attribute, $data, $htmlOptions = array())
{
$htmlOptions['inline'] = true;
return $this->createInput(TbHtml::INPUT_TYPE_CHECKBOXLIST, $model, $attribute, $htmlOptions, $data);
} | php | public function inlineCheckBoxList($model, $attribute, $data, $htmlOptions = array())
{
$htmlOptions['inline'] = true;
return $this->createInput(TbHtml::INPUT_TYPE_CHECKBOXLIST, $model, $attribute, $htmlOptions, $data);
} | [
"public",
"function",
"inlineCheckBoxList",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"data",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"$",
"htmlOptions",
"[",
"'inline'",
"]",
"=",
"true",
";",
"return",
"$",
"this",
"->",
... | Generates an inline checkbox list for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $data data for generating the list options (value=>display)
@param array $htmlOptions additional HTML attributes.
@return string the generated checkbox list.
@see TbHtml::activeInlineCheckBoxList | [
"Generates",
"an",
"inline",
"checkbox",
"list",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L399-L403 |
44,730 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.uneditableField | public function uneditableField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_UNEDITABLE, $model, $attribute, $htmlOptions);
} | php | public function uneditableField($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_UNEDITABLE, $model, $attribute, $htmlOptions);
} | [
"public",
"function",
"uneditableField",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createInput",
"(",
"TbHtml",
"::",
"INPUT_TYPE_UNEDITABLE",
",",
"$",
"model",
",",
... | Generates an uneditable field for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $htmlOptions additional HTML attributes.
@return string the generated field.
@see TbHtml::activeUneditableField | [
"Generates",
"an",
"uneditable",
"field",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L413-L416 |
44,731 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.searchQuery | public function searchQuery($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_SEARCH, $model, $attribute, $htmlOptions);
} | php | public function searchQuery($model, $attribute, $htmlOptions = array())
{
return $this->createInput(TbHtml::INPUT_TYPE_SEARCH, $model, $attribute, $htmlOptions);
} | [
"public",
"function",
"searchQuery",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createInput",
"(",
"TbHtml",
"::",
"INPUT_TYPE_SEARCH",
",",
"$",
"model",
",",
"$",
... | Generates a search query field for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $htmlOptions additional HTML attributes.
@return string the generated input.
@see TbHtml::activeSearchField | [
"Generates",
"a",
"search",
"query",
"field",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L426-L429 |
44,732 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.createInput | public function createInput($type, $model, $attribute, $htmlOptions = array(), $data = array())
{
return TbHtml::createActiveInput($type, $model, $attribute, $htmlOptions, $data);
} | php | public function createInput($type, $model, $attribute, $htmlOptions = array(), $data = array())
{
return TbHtml::createActiveInput($type, $model, $attribute, $htmlOptions, $data);
} | [
"public",
"function",
"createInput",
"(",
"$",
"type",
",",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
",",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"return",
"TbHtml",
"::",
"createActiveInput",
"(",
... | Generates an input for a model attribute.
@param string $type the input type.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $htmlOptions additional HTML attributes.
@param array $data data for generating the list options (value=>display).
@return string the generated input.
@see TbHtml::createActiveInput | [
"Generates",
"an",
"input",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L441-L444 |
44,733 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.urlFieldControlGroup | public function urlFieldControlGroup($model, $attribute, $htmlOptions = array())
{
return $this->createControlGroup(TbHtml::INPUT_TYPE_URL, $model, $attribute, $htmlOptions);
} | php | public function urlFieldControlGroup($model, $attribute, $htmlOptions = array())
{
return $this->createControlGroup(TbHtml::INPUT_TYPE_URL, $model, $attribute, $htmlOptions);
} | [
"public",
"function",
"urlFieldControlGroup",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createControlGroup",
"(",
"TbHtml",
"::",
"INPUT_TYPE_URL",
",",
"$",
"model",
... | Generates a control group with an url field for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute name.
@param array $htmlOptions additional HTML attributes.
@return string the generated control group.
@see TbHtml::activeUrlFieldControlGroup | [
"Generates",
"a",
"control",
"group",
"with",
"an",
"url",
"field",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L480-L483 |
44,734 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.emailFieldControlGroup | public function emailFieldControlGroup($model, $attribute, $htmlOptions = array())
{
return $this->createControlGroup(TbHtml::INPUT_TYPE_EMAIL, $model, $attribute, $htmlOptions);
} | php | public function emailFieldControlGroup($model, $attribute, $htmlOptions = array())
{
return $this->createControlGroup(TbHtml::INPUT_TYPE_EMAIL, $model, $attribute, $htmlOptions);
} | [
"public",
"function",
"emailFieldControlGroup",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createControlGroup",
"(",
"TbHtml",
"::",
"INPUT_TYPE_EMAIL",
",",
"$",
"model"... | Generates a control group with an email field for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute name.
@param array $htmlOptions additional HTML attributes.
@return string the generated control group.
@see TbHtml::activeEmailFieldControlGroup | [
"Generates",
"a",
"control",
"group",
"with",
"an",
"email",
"field",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L493-L496 |
44,735 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.uneditableFieldControlGroup | public function uneditableFieldControlGroup($model, $attribute, $htmlOptions = array())
{
return $this->createControlGroup(TbHtml::INPUT_TYPE_UNEDITABLE, $model, $attribute, $htmlOptions);
} | php | public function uneditableFieldControlGroup($model, $attribute, $htmlOptions = array())
{
return $this->createControlGroup(TbHtml::INPUT_TYPE_UNEDITABLE, $model, $attribute, $htmlOptions);
} | [
"public",
"function",
"uneditableFieldControlGroup",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createControlGroup",
"(",
"TbHtml",
"::",
"INPUT_TYPE_UNEDITABLE",
",",
"$",... | Generates a control group with an uneditable field for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute name.
@param array $htmlOptions additional HTML attributes.
@return string the generated control group.
@see TbHtml::activeUneditableFieldControlGroup | [
"Generates",
"a",
"control",
"group",
"with",
"an",
"uneditable",
"field",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L683-L686 |
44,736 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.createControlGroup | public function createControlGroup($type, $model, $attribute, $htmlOptions = array(), $data = array())
{
$htmlOptions = $this->processControlGroupOptions($model, $attribute, $htmlOptions);
return TbHtml::activeControlGroup($type, $model, $attribute, $htmlOptions, $data);
} | php | public function createControlGroup($type, $model, $attribute, $htmlOptions = array(), $data = array())
{
$htmlOptions = $this->processControlGroupOptions($model, $attribute, $htmlOptions);
return TbHtml::activeControlGroup($type, $model, $attribute, $htmlOptions, $data);
} | [
"public",
"function",
"createControlGroup",
"(",
"$",
"type",
",",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
",",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"$",
"htmlOptions",
"=",
"$",
"this",
"->",
... | Generates a control group for a model attribute.
@param string $type the input type.
@param CModel $model the data model.
@param string $attribute the attribute name.
@param array $htmlOptions additional HTML attributes.
@param array $data data for generating the list options (value=>display).
@return string the generated control group.
@see TbHtml::activeControlGroup | [
"Generates",
"a",
"control",
"group",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L726-L730 |
44,737 | crisu83/yiistrap | widgets/TbActiveForm.php | TbActiveForm.processControlGroupOptions | protected function processControlGroupOptions($model, $attribute, $options)
{
$errorOptions = TbArray::popValue('errorOptions', $options, array());
$enableAjaxValidation = TbArray::popValue('enableAjaxValidation', $errorOptions, true);
$enableClientValidation = TbArray::popValue('enableClientValidation', $errorOptions, true);
$errorOptions['type'] = $this->helpType;
$error = $this->error($model, $attribute, $errorOptions, $enableAjaxValidation, $enableClientValidation);
// kind of a hack for ajax forms but this works for now.
if (!empty($error) && strpos($error, 'display:none') === false) {
$options['color'] = TbHtml::INPUT_COLOR_ERROR;
}
if (!$this->hideInlineErrors) {
$options['error'] = $error;
}
$helpOptions = TbArray::popValue('helpOptions', $options, array());
$helpOptions['type'] = $this->helpType;
$options['helpOptions'] = $helpOptions;
if (!TbArray::getValue('formLayout', $options, false)) {
$options['formLayout'] = $this->layout;
}
$options['labelWidthClass'] = TbArray::getValue('labelWidthClass', $options, $this->labelWidthClass);
$options['controlWidthClass'] = TbArray::getValue('controlWidthClass', $options, $this->controlWidthClass);
return $options;
} | php | protected function processControlGroupOptions($model, $attribute, $options)
{
$errorOptions = TbArray::popValue('errorOptions', $options, array());
$enableAjaxValidation = TbArray::popValue('enableAjaxValidation', $errorOptions, true);
$enableClientValidation = TbArray::popValue('enableClientValidation', $errorOptions, true);
$errorOptions['type'] = $this->helpType;
$error = $this->error($model, $attribute, $errorOptions, $enableAjaxValidation, $enableClientValidation);
// kind of a hack for ajax forms but this works for now.
if (!empty($error) && strpos($error, 'display:none') === false) {
$options['color'] = TbHtml::INPUT_COLOR_ERROR;
}
if (!$this->hideInlineErrors) {
$options['error'] = $error;
}
$helpOptions = TbArray::popValue('helpOptions', $options, array());
$helpOptions['type'] = $this->helpType;
$options['helpOptions'] = $helpOptions;
if (!TbArray::getValue('formLayout', $options, false)) {
$options['formLayout'] = $this->layout;
}
$options['labelWidthClass'] = TbArray::getValue('labelWidthClass', $options, $this->labelWidthClass);
$options['controlWidthClass'] = TbArray::getValue('controlWidthClass', $options, $this->controlWidthClass);
return $options;
} | [
"protected",
"function",
"processControlGroupOptions",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"options",
")",
"{",
"$",
"errorOptions",
"=",
"TbArray",
"::",
"popValue",
"(",
"'errorOptions'",
",",
"$",
"options",
",",
"array",
"(",
")",
")",
... | Processes the options for a input row.
@param CModel $model the data model.
@param string $attribute the attribute name.
@param array $options the options.
@return array the processed options. | [
"Processes",
"the",
"options",
"for",
"a",
"input",
"row",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbActiveForm.php#L753-L776 |
44,738 | crisu83/yiistrap | form/TbFormInputElement.php | TbFormInputElement.render | public function render()
{
/** @var TbForm $parent */
$parent = $this->getParent();
/** @var TbActiveForm $form */
$form = $parent->getActiveFormWidget();
/** @var CModel $model */
$model = $parent->getModel();
// Hidden fields do not require control groups.
if ($this->type === TbHtml::INPUT_TYPE_HIDDEN) {
return $form->hiddenField($model, $this->name, $this->attributes);
}
if (isset(self::$coreTypes[$this->type])) {
$type = self::$coreTypes[$this->type];
} else {
$type = TbHtml::INPUT_TYPE_CUSTOM;
$properties = $this->attributes;
$properties['model'] = $model;
$properties['attribute'] = $this->name;
$this->attributes['input'] = $parent->getOwner()->widget($this->type, $properties, true);
}
return $form->createControlGroup($type, $model, $this->name, $this->attributes, $this->items);
} | php | public function render()
{
/** @var TbForm $parent */
$parent = $this->getParent();
/** @var TbActiveForm $form */
$form = $parent->getActiveFormWidget();
/** @var CModel $model */
$model = $parent->getModel();
// Hidden fields do not require control groups.
if ($this->type === TbHtml::INPUT_TYPE_HIDDEN) {
return $form->hiddenField($model, $this->name, $this->attributes);
}
if (isset(self::$coreTypes[$this->type])) {
$type = self::$coreTypes[$this->type];
} else {
$type = TbHtml::INPUT_TYPE_CUSTOM;
$properties = $this->attributes;
$properties['model'] = $model;
$properties['attribute'] = $this->name;
$this->attributes['input'] = $parent->getOwner()->widget($this->type, $properties, true);
}
return $form->createControlGroup($type, $model, $this->name, $this->attributes, $this->items);
} | [
"public",
"function",
"render",
"(",
")",
"{",
"/** @var TbForm $parent */",
"$",
"parent",
"=",
"$",
"this",
"->",
"getParent",
"(",
")",
";",
"/** @var TbActiveForm $form */",
"$",
"form",
"=",
"$",
"parent",
"->",
"getActiveFormWidget",
"(",
")",
";",
"/** ... | Renders a control group for this input.
@return string the rendered control group. | [
"Renders",
"a",
"control",
"group",
"for",
"this",
"input",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/form/TbFormInputElement.php#L46-L71 |
44,739 | crisu83/yiistrap | widgets/TbTypeAhead.php | TbTypeAhead.initOptions | public function initOptions()
{
$options = array();
foreach (array('matcher', 'sorter', 'updater', 'highlighter') as $fn) {
if ($this->$fn !== null) {
if ($this->$fn instanceof CJavaScriptExpression) {
$options[$fn] = $this->$fn;
} else {
$options[$fn] = new CJavaScriptExpression($this->$fn);
}
}
}
$this->pluginOptions = TbArray::merge(
array(
'source' => $this->source,
'items' => $this->items,
'minLength' => $this->minLength
),
$options
);
} | php | public function initOptions()
{
$options = array();
foreach (array('matcher', 'sorter', 'updater', 'highlighter') as $fn) {
if ($this->$fn !== null) {
if ($this->$fn instanceof CJavaScriptExpression) {
$options[$fn] = $this->$fn;
} else {
$options[$fn] = new CJavaScriptExpression($this->$fn);
}
}
}
$this->pluginOptions = TbArray::merge(
array(
'source' => $this->source,
'items' => $this->items,
'minLength' => $this->minLength
),
$options
);
} | [
"public",
"function",
"initOptions",
"(",
")",
"{",
"$",
"options",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"array",
"(",
"'matcher'",
",",
"'sorter'",
",",
"'updater'",
",",
"'highlighter'",
")",
"as",
"$",
"fn",
")",
"{",
"if",
"(",
"$",
"this... | Initializes the plugin options | [
"Initializes",
"the",
"plugin",
"options"
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbTypeAhead.php#L75-L96 |
44,740 | crisu83/yiistrap | widgets/TbTypeAhead.php | TbTypeAhead.registerClientScript | public function registerClientScript()
{
/** @var TbApi $api */
$selector = '#' . TbArray::getValue('id', $this->htmlOptions, $this->getId());
$this->registerPlugin(TbApi::PLUGIN_TYPEAHEAD, $selector, $this->pluginOptions);
} | php | public function registerClientScript()
{
/** @var TbApi $api */
$selector = '#' . TbArray::getValue('id', $this->htmlOptions, $this->getId());
$this->registerPlugin(TbApi::PLUGIN_TYPEAHEAD, $selector, $this->pluginOptions);
} | [
"public",
"function",
"registerClientScript",
"(",
")",
"{",
"/** @var TbApi $api */",
"$",
"selector",
"=",
"'#'",
".",
"TbArray",
"::",
"getValue",
"(",
"'id'",
",",
"$",
"this",
"->",
"htmlOptions",
",",
"$",
"this",
"->",
"getId",
"(",
")",
")",
";",
... | Register required scripts. | [
"Register",
"required",
"scripts",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbTypeAhead.php#L128-L133 |
44,741 | contentful/rich-text.php | src/Renderer.php | Renderer.createNodeRenderers | private function createNodeRenderers(): array
{
return [
new NodeRenderer\AssetHyperlink(),
new NodeRenderer\Blockquote(),
new NodeRenderer\Document(),
new NodeRenderer\EmbeddedAssetBlock(),
new NodeRenderer\EmbeddedAssetInline(),
new NodeRenderer\EmbeddedEntryBlock(),
new NodeRenderer\EmbeddedEntryInline(),
new NodeRenderer\EntryHyperlink(),
new NodeRenderer\Heading1(),
new NodeRenderer\Heading2(),
new NodeRenderer\Heading3(),
new NodeRenderer\Heading4(),
new NodeRenderer\Heading5(),
new NodeRenderer\Heading6(),
new NodeRenderer\Hr(),
new NodeRenderer\Hyperlink(),
new NodeRenderer\ListItem(),
new NodeRenderer\Nothing(),
new NodeRenderer\OrderedList(),
new NodeRenderer\Paragraph(),
new NodeRenderer\Text(),
new NodeRenderer\UnorderedList(),
];
} | php | private function createNodeRenderers(): array
{
return [
new NodeRenderer\AssetHyperlink(),
new NodeRenderer\Blockquote(),
new NodeRenderer\Document(),
new NodeRenderer\EmbeddedAssetBlock(),
new NodeRenderer\EmbeddedAssetInline(),
new NodeRenderer\EmbeddedEntryBlock(),
new NodeRenderer\EmbeddedEntryInline(),
new NodeRenderer\EntryHyperlink(),
new NodeRenderer\Heading1(),
new NodeRenderer\Heading2(),
new NodeRenderer\Heading3(),
new NodeRenderer\Heading4(),
new NodeRenderer\Heading5(),
new NodeRenderer\Heading6(),
new NodeRenderer\Hr(),
new NodeRenderer\Hyperlink(),
new NodeRenderer\ListItem(),
new NodeRenderer\Nothing(),
new NodeRenderer\OrderedList(),
new NodeRenderer\Paragraph(),
new NodeRenderer\Text(),
new NodeRenderer\UnorderedList(),
];
} | [
"private",
"function",
"createNodeRenderers",
"(",
")",
":",
"array",
"{",
"return",
"[",
"new",
"NodeRenderer",
"\\",
"AssetHyperlink",
"(",
")",
",",
"new",
"NodeRenderer",
"\\",
"Blockquote",
"(",
")",
",",
"new",
"NodeRenderer",
"\\",
"Document",
"(",
")... | Creates a list of default node renderers.
@return NodeRendererInterface[] | [
"Creates",
"a",
"list",
"of",
"default",
"node",
"renderers",
"."
] | 3711660bb65635572c126f6a64b6faea249babc6 | https://github.com/contentful/rich-text.php/blob/3711660bb65635572c126f6a64b6faea249babc6/src/Renderer.php#L109-L135 |
44,742 | crisu83/yiistrap | components/TbApi.php | TbApi.init | public function init()
{
parent::init();
if ($this->bootstrapPath === null) {
$this->bootstrapPath = Yii::getPathOfAlias('vendor.twbs.bootstrap.dist');
}
} | php | public function init()
{
parent::init();
if ($this->bootstrapPath === null) {
$this->bootstrapPath = Yii::getPathOfAlias('vendor.twbs.bootstrap.dist');
}
} | [
"public",
"function",
"init",
"(",
")",
"{",
"parent",
"::",
"init",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"bootstrapPath",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"bootstrapPath",
"=",
"Yii",
"::",
"getPathOfAlias",
"(",
"'vendor.twbs.bootstr... | Initializes this component. | [
"Initializes",
"this",
"component",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/components/TbApi.php#L58-L64 |
44,743 | crisu83/yiistrap | components/TbApi.php | TbApi.registerCoreCss | public function registerCoreCss($url = null, $media = 'screen')
{
if ($url === null) {
$fileName = YII_DEBUG ? 'bootstrap.css' : 'bootstrap.min.css';
$url = $this->getBootstrapUrl() . '/css/' . $fileName;
}
Yii::app()->getClientScript()->registerCssFile($url, $media);
} | php | public function registerCoreCss($url = null, $media = 'screen')
{
if ($url === null) {
$fileName = YII_DEBUG ? 'bootstrap.css' : 'bootstrap.min.css';
$url = $this->getBootstrapUrl() . '/css/' . $fileName;
}
Yii::app()->getClientScript()->registerCssFile($url, $media);
} | [
"public",
"function",
"registerCoreCss",
"(",
"$",
"url",
"=",
"null",
",",
"$",
"media",
"=",
"'screen'",
")",
"{",
"if",
"(",
"$",
"url",
"===",
"null",
")",
"{",
"$",
"fileName",
"=",
"YII_DEBUG",
"?",
"'bootstrap.css'",
":",
"'bootstrap.min.css'",
";... | Registers the Bootstrap CSS.
@param string $url the URL to the CSS file to register.
@param string $media the media type (defaults to 'screen'). | [
"Registers",
"the",
"Bootstrap",
"CSS",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/components/TbApi.php#L71-L78 |
44,744 | crisu83/yiistrap | components/TbApi.php | TbApi.registerYiistrapCss | public function registerYiistrapCss($url = null, $media = 'screen')
{
if ($url === null) {
$fileName = YII_DEBUG ? 'yiistrap.css' : 'yiistrap.min.css';
$url = $this->getAssetsUrl() . '/css/' . $fileName;
}
Yii::app()->getClientScript()->registerCssFile($url, $media);
} | php | public function registerYiistrapCss($url = null, $media = 'screen')
{
if ($url === null) {
$fileName = YII_DEBUG ? 'yiistrap.css' : 'yiistrap.min.css';
$url = $this->getAssetsUrl() . '/css/' . $fileName;
}
Yii::app()->getClientScript()->registerCssFile($url, $media);
} | [
"public",
"function",
"registerYiistrapCss",
"(",
"$",
"url",
"=",
"null",
",",
"$",
"media",
"=",
"'screen'",
")",
"{",
"if",
"(",
"$",
"url",
"===",
"null",
")",
"{",
"$",
"fileName",
"=",
"YII_DEBUG",
"?",
"'yiistrap.css'",
":",
"'yiistrap.min.css'",
... | Registers the Yiistrap CSS.
@param string $url the URL to the CSS file to register.
@param string $media the media type (default to 'screen'). | [
"Registers",
"the",
"Yiistrap",
"CSS",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/components/TbApi.php#L99-L106 |
44,745 | crisu83/yiistrap | components/TbApi.php | TbApi.registerCoreScripts | public function registerCoreScripts($url = null, $position = CClientScript::POS_END)
{
if ($url === null) {
$fileName = YII_DEBUG ? 'bootstrap.js' : 'bootstrap.min.js';
$url = $this->getBootstrapUrl() . '/js/' . $fileName;
}
/** @var CClientScript $cs */
$cs = Yii::app()->getClientScript();
$cs->registerCoreScript('jquery');
$cs->registerScriptFile($url, $position);
} | php | public function registerCoreScripts($url = null, $position = CClientScript::POS_END)
{
if ($url === null) {
$fileName = YII_DEBUG ? 'bootstrap.js' : 'bootstrap.min.js';
$url = $this->getBootstrapUrl() . '/js/' . $fileName;
}
/** @var CClientScript $cs */
$cs = Yii::app()->getClientScript();
$cs->registerCoreScript('jquery');
$cs->registerScriptFile($url, $position);
} | [
"public",
"function",
"registerCoreScripts",
"(",
"$",
"url",
"=",
"null",
",",
"$",
"position",
"=",
"CClientScript",
"::",
"POS_END",
")",
"{",
"if",
"(",
"$",
"url",
"===",
"null",
")",
"{",
"$",
"fileName",
"=",
"YII_DEBUG",
"?",
"'bootstrap.js'",
":... | Registers jQuery and Bootstrap JavaScript.
@param string $url the URL to the JavaScript file to register.
@param int $position the position of the JavaScript code. | [
"Registers",
"jQuery",
"and",
"Bootstrap",
"JavaScript",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/components/TbApi.php#L132-L142 |
44,746 | crisu83/yiistrap | components/TbApi.php | TbApi.registerPopover | public function registerPopover($selector = 'body', $options = array())
{
TbArray::defaultValue('selector', 'a[rel=popover]', $options);
$this->registerPlugin(self::PLUGIN_POPOVER, $selector, $options);
} | php | public function registerPopover($selector = 'body', $options = array())
{
TbArray::defaultValue('selector', 'a[rel=popover]', $options);
$this->registerPlugin(self::PLUGIN_POPOVER, $selector, $options);
} | [
"public",
"function",
"registerPopover",
"(",
"$",
"selector",
"=",
"'body'",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"TbArray",
"::",
"defaultValue",
"(",
"'selector'",
",",
"'a[rel=popover]'",
",",
"$",
"options",
")",
";",
"$",
"this",
... | Registers the Bootstrap Popover plugin.
@param string $selector the CSS selector.
@param array $options the JavaScript options for the plugin.
@see http://twitter.github.com/bootstrap/javascript.html#popover | [
"Registers",
"the",
"Bootstrap",
"Popover",
"plugin",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/components/TbApi.php#L177-L181 |
44,747 | crisu83/yiistrap | components/TbApi.php | TbApi.registerTooltip | public function registerTooltip($selector = 'body', $options = array())
{
TbArray::defaultValue('selector', 'a[rel=tooltip]', $options);
$this->registerPlugin(self::PLUGIN_TOOLTIP, $selector, $options);
} | php | public function registerTooltip($selector = 'body', $options = array())
{
TbArray::defaultValue('selector', 'a[rel=tooltip]', $options);
$this->registerPlugin(self::PLUGIN_TOOLTIP, $selector, $options);
} | [
"public",
"function",
"registerTooltip",
"(",
"$",
"selector",
"=",
"'body'",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"TbArray",
"::",
"defaultValue",
"(",
"'selector'",
",",
"'a[rel=tooltip]'",
",",
"$",
"options",
")",
";",
"$",
"this",
... | Registers the Bootstrap Tooltip plugin.
@param string $selector the CSS selector.
@param array $options the JavaScript options for the plugin.
@see http://twitter.github.com/bootstrap/javascript.html#tooltip | [
"Registers",
"the",
"Bootstrap",
"Tooltip",
"plugin",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/components/TbApi.php#L189-L193 |
44,748 | crisu83/yiistrap | components/TbApi.php | TbApi.registerPlugin | public function registerPlugin($name, $selector, $options = array(), $position = CClientScript::POS_END)
{
$options = !empty($options) ? CJavaScript::encode($options) : '';
$script = "jQuery('{$selector}').{$name}({$options});";
$id = __CLASS__ . '#Plugin' . self::$counter++;
Yii::app()->clientScript->registerScript($id, $script, $position);
} | php | public function registerPlugin($name, $selector, $options = array(), $position = CClientScript::POS_END)
{
$options = !empty($options) ? CJavaScript::encode($options) : '';
$script = "jQuery('{$selector}').{$name}({$options});";
$id = __CLASS__ . '#Plugin' . self::$counter++;
Yii::app()->clientScript->registerScript($id, $script, $position);
} | [
"public",
"function",
"registerPlugin",
"(",
"$",
"name",
",",
"$",
"selector",
",",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"position",
"=",
"CClientScript",
"::",
"POS_END",
")",
"{",
"$",
"options",
"=",
"!",
"empty",
"(",
"$",
"options",
... | Registers a specific Bootstrap plugin using the given selector and options.
@param string $name the plugin name.
@param string $selector the CSS selector.
@param array $options the JavaScript options for the plugin.
@param int $position the position of the JavaScript code. | [
"Registers",
"a",
"specific",
"Bootstrap",
"plugin",
"using",
"the",
"given",
"selector",
"and",
"options",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/components/TbApi.php#L202-L208 |
44,749 | crisu83/yiistrap | components/TbApi.php | TbApi.getBootstrapUrl | protected function getBootstrapUrl()
{
if (!isset($this->_bootstrapUrl)) {
if (isset($this->cdnUrl)) {
$this->_bootstrapUrl = $this->cdnUrl;
} else {
if (($path = Yii::getPathOfAlias($this->bootstrapPath)) !== false) {
$this->bootstrapPath = $path;
} else if ($this->bootstrapPath === false) {
throw new Exception("Invalid Bootstrap path and CDN URL not set. Set vendor.twbs.bootstrap.dist alias or cdnUrl parameter in the configuration file.");
}
$this->_bootstrapUrl = Yii::app()->assetManager->publish($this->bootstrapPath, false, -1, $this->forceCopyAssets);
}
}
return $this->_bootstrapUrl;
} | php | protected function getBootstrapUrl()
{
if (!isset($this->_bootstrapUrl)) {
if (isset($this->cdnUrl)) {
$this->_bootstrapUrl = $this->cdnUrl;
} else {
if (($path = Yii::getPathOfAlias($this->bootstrapPath)) !== false) {
$this->bootstrapPath = $path;
} else if ($this->bootstrapPath === false) {
throw new Exception("Invalid Bootstrap path and CDN URL not set. Set vendor.twbs.bootstrap.dist alias or cdnUrl parameter in the configuration file.");
}
$this->_bootstrapUrl = Yii::app()->assetManager->publish($this->bootstrapPath, false, -1, $this->forceCopyAssets);
}
}
return $this->_bootstrapUrl;
} | [
"protected",
"function",
"getBootstrapUrl",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_bootstrapUrl",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"cdnUrl",
")",
")",
"{",
"$",
"this",
"->",
"_bootstrapUrl",
"=",
... | Returns the url to the published Bootstrap folder, or the CDN if applicable.
@return string the url.
@throws Exception | [
"Returns",
"the",
"url",
"to",
"the",
"published",
"Bootstrap",
"folder",
"or",
"the",
"CDN",
"if",
"applicable",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/components/TbApi.php#L236-L251 |
44,750 | crisu83/yiistrap | components/TbApi.php | TbApi.getAssetsUrl | protected function getAssetsUrl()
{
if (!isset($this->_assetsUrl)) {
$assetPath = dirname(__DIR__) . '/assets';
$this->_assetsUrl = Yii::app()->assetManager->publish($assetPath, false, -1, $this->forceCopyAssets);
}
return $this->_assetsUrl;
} | php | protected function getAssetsUrl()
{
if (!isset($this->_assetsUrl)) {
$assetPath = dirname(__DIR__) . '/assets';
$this->_assetsUrl = Yii::app()->assetManager->publish($assetPath, false, -1, $this->forceCopyAssets);
}
return $this->_assetsUrl;
} | [
"protected",
"function",
"getAssetsUrl",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_assetsUrl",
")",
")",
"{",
"$",
"assetPath",
"=",
"dirname",
"(",
"__DIR__",
")",
".",
"'/assets'",
";",
"$",
"this",
"->",
"_assetsUrl",
"=",
... | Returns the url to the published folder that contains the assets for this extension.
@return string the url. | [
"Returns",
"the",
"url",
"to",
"the",
"published",
"folder",
"that",
"contains",
"the",
"assets",
"for",
"this",
"extension",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/components/TbApi.php#L257-L264 |
44,751 | crisu83/yiistrap | widgets/TbPanel.php | TbPanel.run | public function run()
{
$this->renderContent();
$content = ob_get_clean();
if ($this->hideOnEmpty && trim($content) === '') {
return;
}
echo $this->_openTag;
echo $content;
if ($this->renderContentContainer) {
echo "</div>\n";
}
$this->renderFooter();
echo "</div>";
} | php | public function run()
{
$this->renderContent();
$content = ob_get_clean();
if ($this->hideOnEmpty && trim($content) === '') {
return;
}
echo $this->_openTag;
echo $content;
if ($this->renderContentContainer) {
echo "</div>\n";
}
$this->renderFooter();
echo "</div>";
} | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"this",
"->",
"renderContent",
"(",
")",
";",
"$",
"content",
"=",
"ob_get_clean",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"hideOnEmpty",
"&&",
"trim",
"(",
"$",
"content",
")",
"===",
"''",
")"... | Renders the content of the panel. | [
"Renders",
"the",
"content",
"of",
"the",
"panel",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbPanel.php#L92-L106 |
44,752 | crisu83/yiistrap | widgets/TbTabs.php | TbTabs.initEvents | public function initEvents()
{
foreach (array('onShow', 'onShown') as $event) {
if ($this->$event !== null) {
$modalEvent = strtolower(substr($event, 2));
if ($this->$event instanceof CJavaScriptExpression) {
$this->events[$modalEvent] = $this->$event;
} else {
$this->events[$modalEvent] = new CJavaScriptExpression($this->$event);
}
}
}
} | php | public function initEvents()
{
foreach (array('onShow', 'onShown') as $event) {
if ($this->$event !== null) {
$modalEvent = strtolower(substr($event, 2));
if ($this->$event instanceof CJavaScriptExpression) {
$this->events[$modalEvent] = $this->$event;
} else {
$this->events[$modalEvent] = new CJavaScriptExpression($this->$event);
}
}
}
} | [
"public",
"function",
"initEvents",
"(",
")",
"{",
"foreach",
"(",
"array",
"(",
"'onShow'",
",",
"'onShown'",
")",
"as",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"$",
"event",
"!==",
"null",
")",
"{",
"$",
"modalEvent",
"=",
"strtolower... | Initialize events if any | [
"Initialize",
"events",
"if",
"any"
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbTabs.php#L67-L79 |
44,753 | crisu83/yiistrap | widgets/TbNav.php | TbNav.isItemActive | protected function isItemActive($item, $route)
{
if (isset($item['url']) && is_array($item['url']) && !strcasecmp(trim($item['url'][0], '/'), $route)) {
unset($item['url']['#']);
if (count($item['url']) > 1) {
foreach (array_splice($item['url'], 1) as $name => $value) {
if (!isset($_GET[$name]) || $_GET[$name] != $value) {
return false;
}
}
}
return true;
}
return false;
} | php | protected function isItemActive($item, $route)
{
if (isset($item['url']) && is_array($item['url']) && !strcasecmp(trim($item['url'][0], '/'), $route)) {
unset($item['url']['#']);
if (count($item['url']) > 1) {
foreach (array_splice($item['url'], 1) as $name => $value) {
if (!isset($_GET[$name]) || $_GET[$name] != $value) {
return false;
}
}
}
return true;
}
return false;
} | [
"protected",
"function",
"isItemActive",
"(",
"$",
"item",
",",
"$",
"route",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"item",
"[",
"'url'",
"]",
")",
"&&",
"is_array",
"(",
"$",
"item",
"[",
"'url'",
"]",
")",
"&&",
"!",
"strcasecmp",
"(",
"trim",
... | Checks whether a menu item is active.
@param array $item the menu item to be checked.
@param string $route the route of the current request.
@return boolean whether the menu item is active. | [
"Checks",
"whether",
"a",
"menu",
"item",
"is",
"active",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbNav.php#L156-L170 |
44,754 | crisu83/yiistrap | widgets/TbModal.php | TbModal.renderButton | public function renderButton()
{
if (!empty($this->buttonOptions) && is_array($this->buttonOptions)) {
TbArray::defaultValue('data-toggle', 'modal', $this->buttonOptions);
if ($this->remote !== null) {
$this->buttonOptions['data-remote'] = CHtml::normalizeUrl($this->remote);
}
$selector = '#' . $this->htmlOptions['id'];
$label = TbArray::popValue('label', $this->buttonOptions, 'button');
$attr = isset($this->buttonOptions['data-remote']) ? 'data-target' : 'href';
TbArray::defaultValue($attr, $selector, $this->buttonOptions);
echo TbHtml::button($label, $this->buttonOptions);
}
} | php | public function renderButton()
{
if (!empty($this->buttonOptions) && is_array($this->buttonOptions)) {
TbArray::defaultValue('data-toggle', 'modal', $this->buttonOptions);
if ($this->remote !== null) {
$this->buttonOptions['data-remote'] = CHtml::normalizeUrl($this->remote);
}
$selector = '#' . $this->htmlOptions['id'];
$label = TbArray::popValue('label', $this->buttonOptions, 'button');
$attr = isset($this->buttonOptions['data-remote']) ? 'data-target' : 'href';
TbArray::defaultValue($attr, $selector, $this->buttonOptions);
echo TbHtml::button($label, $this->buttonOptions);
}
} | [
"public",
"function",
"renderButton",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"buttonOptions",
")",
"&&",
"is_array",
"(",
"$",
"this",
"->",
"buttonOptions",
")",
")",
"{",
"TbArray",
"::",
"defaultValue",
"(",
"'data-toggle'",
"... | Renders the button | [
"Renders",
"the",
"button"
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbModal.php#L203-L218 |
44,755 | crisu83/yiistrap | widgets/TbThumbnails.php | TbThumbnails.renderItems | public function renderItems()
{
$thumbnails = array();
$data = $this->dataProvider->getData();
if (!empty($data)) {
$owner = $this->getOwner();
$render = $owner instanceof CController ? 'renderPartial' : 'render';
foreach ($data as $i => $row) {
$thumbnail = array();
$d = $this->viewData;
$d['index'] = $i;
$d['data'] = $row;
$d['widget'] = $this;
$thumbnail['caption'] = $owner->$render($this->itemView, $d, true);
if (isset($this->url)) {
$thumbnail['url'] = $this->evaluateExpression($this->url, array('data' => $row));
}
if (isset($this->span)) {
$thumbnail['span'] = $this->span;
}
$thumbnails[] = $thumbnail;
}
echo TbHtml::thumbnails($thumbnails, $this->htmlOptions);
} else {
$this->renderEmptyText();
}
} | php | public function renderItems()
{
$thumbnails = array();
$data = $this->dataProvider->getData();
if (!empty($data)) {
$owner = $this->getOwner();
$render = $owner instanceof CController ? 'renderPartial' : 'render';
foreach ($data as $i => $row) {
$thumbnail = array();
$d = $this->viewData;
$d['index'] = $i;
$d['data'] = $row;
$d['widget'] = $this;
$thumbnail['caption'] = $owner->$render($this->itemView, $d, true);
if (isset($this->url)) {
$thumbnail['url'] = $this->evaluateExpression($this->url, array('data' => $row));
}
if (isset($this->span)) {
$thumbnail['span'] = $this->span;
}
$thumbnails[] = $thumbnail;
}
echo TbHtml::thumbnails($thumbnails, $this->htmlOptions);
} else {
$this->renderEmptyText();
}
} | [
"public",
"function",
"renderItems",
"(",
")",
"{",
"$",
"thumbnails",
"=",
"array",
"(",
")",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"dataProvider",
"->",
"getData",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"data",
")",
")",
"{",
"$"... | Renders the data items for the view.
Each item is corresponding to a single data model instance. | [
"Renders",
"the",
"data",
"items",
"for",
"the",
"view",
".",
"Each",
"item",
"is",
"corresponding",
"to",
"a",
"single",
"data",
"model",
"instance",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/widgets/TbThumbnails.php#L42-L69 |
44,756 | crisu83/yiistrap | helpers/TbHtml.php | TbHtml.tag | public static function tag($tag, $htmlOptions = array(), $content = false, $closeTag = true)
{
self::addSpanClass($htmlOptions);
self::addColClass($htmlOptions);
self::addPullClass($htmlOptions);
self::addTextAlignClass($htmlOptions);
return parent::tag($tag, $htmlOptions, $content, $closeTag);
} | php | public static function tag($tag, $htmlOptions = array(), $content = false, $closeTag = true)
{
self::addSpanClass($htmlOptions);
self::addColClass($htmlOptions);
self::addPullClass($htmlOptions);
self::addTextAlignClass($htmlOptions);
return parent::tag($tag, $htmlOptions, $content, $closeTag);
} | [
"public",
"static",
"function",
"tag",
"(",
"$",
"tag",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
",",
"$",
"content",
"=",
"false",
",",
"$",
"closeTag",
"=",
"true",
")",
"{",
"self",
"::",
"addSpanClass",
"(",
"$",
"htmlOptions",
")",
";",
... | Generates an HTML element.
@param string $tag the tag name.
@param array $htmlOptions the element attributes.
@param mixed $content the content to be enclosed between open and close element tags.
@param boolean $closeTag whether to generate the close tag.
@return string the generated HTML element tag. | [
"Generates",
"an",
"HTML",
"element",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/helpers/TbHtml.php#L746-L753 |
44,757 | crisu83/yiistrap | helpers/TbHtml.php | TbHtml.activeCheckBox | public static function activeCheckBox($model, $attribute, $htmlOptions = array())
{
$label = TbArray::popValue('label', $htmlOptions, false);
$labelOptions = TbArray::popValue('labelOptions', $htmlOptions, array());
$input = parent::activeCheckBox($model, $attribute, $htmlOptions);
if (TbArray::popValue('useContainer', $htmlOptions, false)) {
return self::tag(
'div',
array('class' => 'checkbox'),
self::createCheckBoxAndRadioButtonLabel($label, $input, $labelOptions)
);
} else {
return self::createCheckBoxAndRadioButtonLabel($label, $input, $labelOptions);
}
} | php | public static function activeCheckBox($model, $attribute, $htmlOptions = array())
{
$label = TbArray::popValue('label', $htmlOptions, false);
$labelOptions = TbArray::popValue('labelOptions', $htmlOptions, array());
$input = parent::activeCheckBox($model, $attribute, $htmlOptions);
if (TbArray::popValue('useContainer', $htmlOptions, false)) {
return self::tag(
'div',
array('class' => 'checkbox'),
self::createCheckBoxAndRadioButtonLabel($label, $input, $labelOptions)
);
} else {
return self::createCheckBoxAndRadioButtonLabel($label, $input, $labelOptions);
}
} | [
"public",
"static",
"function",
"activeCheckBox",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"$",
"label",
"=",
"TbArray",
"::",
"popValue",
"(",
"'label'",
",",
"$",
"htmlOptions",
",",
"false",
... | Generates a check box for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $htmlOptions additional HTML attributes.
@return string the generated check box. | [
"Generates",
"a",
"check",
"box",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/helpers/TbHtml.php#L1947-L1961 |
44,758 | crisu83/yiistrap | helpers/TbHtml.php | TbHtml.activeRadioButtonList | public static function activeRadioButtonList($model, $attribute, $data, $htmlOptions = array())
{
parent::resolveNameID($model, $attribute, $htmlOptions);
$selection = parent::resolveValue($model, $attribute);
$name = TbArray::popValue('name', $htmlOptions);
$uncheckValue = TbArray::popValue('uncheckValue', $htmlOptions, '');
$hiddenOptions = isset($htmlOptions['id']) ? array('id' => parent::ID_PREFIX . $htmlOptions['id']) : array('id' => false);
$hidden = $uncheckValue !== null ? parent::hiddenField($name, $uncheckValue, $hiddenOptions) : '';
return $hidden . self::radioButtonList($name, $selection, $data, $htmlOptions);
} | php | public static function activeRadioButtonList($model, $attribute, $data, $htmlOptions = array())
{
parent::resolveNameID($model, $attribute, $htmlOptions);
$selection = parent::resolveValue($model, $attribute);
$name = TbArray::popValue('name', $htmlOptions);
$uncheckValue = TbArray::popValue('uncheckValue', $htmlOptions, '');
$hiddenOptions = isset($htmlOptions['id']) ? array('id' => parent::ID_PREFIX . $htmlOptions['id']) : array('id' => false);
$hidden = $uncheckValue !== null ? parent::hiddenField($name, $uncheckValue, $hiddenOptions) : '';
return $hidden . self::radioButtonList($name, $selection, $data, $htmlOptions);
} | [
"public",
"static",
"function",
"activeRadioButtonList",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"data",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"parent",
"::",
"resolveNameID",
"(",
"$",
"model",
",",
"$",
"attribute",
","... | Generates a radio button list for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $data $data value-label pairs used to generate the radio button list.
@param array $htmlOptions additional HTML attributes.
@return string the generated list. | [
"Generates",
"a",
"radio",
"button",
"list",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/helpers/TbHtml.php#L2060-L2069 |
44,759 | crisu83/yiistrap | helpers/TbHtml.php | TbHtml.activeCheckBoxList | public static function activeCheckBoxList($model, $attribute, $data, $htmlOptions = array())
{
parent::resolveNameID($model, $attribute, $htmlOptions);
$selection = parent::resolveValue($model, $attribute);
if ($model->hasErrors($attribute)) {
parent::addErrorCss($htmlOptions);
}
$name = TbArray::popValue('name', $htmlOptions);
$uncheckValue = TbArray::popValue('uncheckValue', $htmlOptions, '');
$hiddenOptions = isset($htmlOptions['id']) ? array('id' => parent::ID_PREFIX . $htmlOptions['id']) : array('id' => false);
$hidden = $uncheckValue !== null ? parent::hiddenField($name, $uncheckValue, $hiddenOptions) : '';
return $hidden . self::checkBoxList($name, $selection, $data, $htmlOptions);
} | php | public static function activeCheckBoxList($model, $attribute, $data, $htmlOptions = array())
{
parent::resolveNameID($model, $attribute, $htmlOptions);
$selection = parent::resolveValue($model, $attribute);
if ($model->hasErrors($attribute)) {
parent::addErrorCss($htmlOptions);
}
$name = TbArray::popValue('name', $htmlOptions);
$uncheckValue = TbArray::popValue('uncheckValue', $htmlOptions, '');
$hiddenOptions = isset($htmlOptions['id']) ? array('id' => parent::ID_PREFIX . $htmlOptions['id']) : array('id' => false);
$hidden = $uncheckValue !== null ? parent::hiddenField($name, $uncheckValue, $hiddenOptions) : '';
return $hidden . self::checkBoxList($name, $selection, $data, $htmlOptions);
} | [
"public",
"static",
"function",
"activeCheckBoxList",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"data",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"parent",
"::",
"resolveNameID",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
... | Generates a check box list for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $data $data value-label pairs used to generate the check box list.
@param array $htmlOptions additional HTML attributes.
@return string the generated list. | [
"Generates",
"a",
"check",
"box",
"list",
"for",
"a",
"model",
"attribute",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/helpers/TbHtml.php#L2093-L2105 |
44,760 | crisu83/yiistrap | helpers/TbHtml.php | TbHtml.controls | public static function controls($controls, $htmlOptions = array())
{
if (TbArray::popValue('row', $htmlOptions, false)) {
self::addCssClass('row', $htmlOptions);
}
$before = TbArray::popValue('before', $htmlOptions, '');
$after = TbArray::popValue('after', $htmlOptions, '');
if (is_array($controls)) {
$controls = implode('', $controls);
}
$content = $before . $controls . $after;
return self::tag('div', $htmlOptions, $content);
} | php | public static function controls($controls, $htmlOptions = array())
{
if (TbArray::popValue('row', $htmlOptions, false)) {
self::addCssClass('row', $htmlOptions);
}
$before = TbArray::popValue('before', $htmlOptions, '');
$after = TbArray::popValue('after', $htmlOptions, '');
if (is_array($controls)) {
$controls = implode('', $controls);
}
$content = $before . $controls . $after;
return self::tag('div', $htmlOptions, $content);
} | [
"public",
"static",
"function",
"controls",
"(",
"$",
"controls",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"TbArray",
"::",
"popValue",
"(",
"'row'",
",",
"$",
"htmlOptions",
",",
"false",
")",
")",
"{",
"self",
"::",
"ad... | Generates form controls.
@param mixed $controls the controls.
@param array $htmlOptions additional HTML attributes.
@return string the generated controls. | [
"Generates",
"form",
"controls",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/helpers/TbHtml.php#L2802-L2814 |
44,761 | crisu83/yiistrap | helpers/TbHtml.php | TbHtml.formActions | public static function formActions($actions, $htmlOptions = array())
{
self::addCssClass('form-actions', $htmlOptions);
if (is_array($actions)) {
$actions = implode(' ', $actions);
}
// todo: remove this
$labelWidthClass = TbArray::popValue('labelWidthClass', $htmlOptions, self::$defaultFormLabelWidthClass);
$controlWidthClass = TbArray::popValue('controlWidthClass', $htmlOptions, self::$defaultFormControlWidthClass);
// todo: remove everything that has to do with form layout
if (TbArray::popValue('formLayout', $htmlOptions, self::FORM_LAYOUT_VERTICAL) == self::FORM_LAYOUT_HORIZONTAL) {
self::addCssClass(self::switchColToOffset($labelWidthClass), $htmlOptions);
self::addCssClass(self::switchOffsetToCol($controlWidthClass), $htmlOptions);
return self::tag('div', array('class' => 'form-group'), self::tag('div', $htmlOptions, $actions));
} else {
return self::tag('div', $htmlOptions, $actions);
}
} | php | public static function formActions($actions, $htmlOptions = array())
{
self::addCssClass('form-actions', $htmlOptions);
if (is_array($actions)) {
$actions = implode(' ', $actions);
}
// todo: remove this
$labelWidthClass = TbArray::popValue('labelWidthClass', $htmlOptions, self::$defaultFormLabelWidthClass);
$controlWidthClass = TbArray::popValue('controlWidthClass', $htmlOptions, self::$defaultFormControlWidthClass);
// todo: remove everything that has to do with form layout
if (TbArray::popValue('formLayout', $htmlOptions, self::FORM_LAYOUT_VERTICAL) == self::FORM_LAYOUT_HORIZONTAL) {
self::addCssClass(self::switchColToOffset($labelWidthClass), $htmlOptions);
self::addCssClass(self::switchOffsetToCol($controlWidthClass), $htmlOptions);
return self::tag('div', array('class' => 'form-group'), self::tag('div', $htmlOptions, $actions));
} else {
return self::tag('div', $htmlOptions, $actions);
}
} | [
"public",
"static",
"function",
"formActions",
"(",
"$",
"actions",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"self",
"::",
"addCssClass",
"(",
"'form-actions'",
",",
"$",
"htmlOptions",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"action... | Generates form actions div. This is no longer necessary in Bootstrap 3, but it is still useful to use for
horizontal forms. When used with a horizontal form, it will appropriately align the actions below other form
controls.
@param mixed $actions the actions.
@param array $htmlOptions additional HTML attributes.
@return string the generated actions. | [
"Generates",
"form",
"actions",
"div",
".",
"This",
"is",
"no",
"longer",
"necessary",
"in",
"Bootstrap",
"3",
"but",
"it",
"is",
"still",
"useful",
"to",
"use",
"for",
"horizontal",
"forms",
".",
"When",
"used",
"with",
"a",
"horizontal",
"form",
"it",
... | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/helpers/TbHtml.php#L2837-L2856 |
44,762 | crisu83/yiistrap | helpers/TbHtml.php | TbHtml.imageThumbnail | public static function imageThumbnail($src, $alt = '', $htmlOptions = array())
{
$htmlOptions['type'] = self::IMAGE_TYPE_THUMBNAIL;
return self::image($src, $alt, $htmlOptions);
} | php | public static function imageThumbnail($src, $alt = '', $htmlOptions = array())
{
$htmlOptions['type'] = self::IMAGE_TYPE_THUMBNAIL;
return self::image($src, $alt, $htmlOptions);
} | [
"public",
"static",
"function",
"imageThumbnail",
"(",
"$",
"src",
",",
"$",
"alt",
"=",
"''",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"$",
"htmlOptions",
"[",
"'type'",
"]",
"=",
"self",
"::",
"IMAGE_TYPE_THUMBNAIL",
";",
"return",
... | Generates an image tag within thumbnail frame.
@param string $src the image URL.
@param string $alt the alternative text display.
@param array $htmlOptions additional HTML attributes.
@return string the generated image tag. | [
"Generates",
"an",
"image",
"tag",
"within",
"thumbnail",
"frame",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/helpers/TbHtml.php#L3202-L3206 |
44,763 | crisu83/yiistrap | helpers/TbHtml.php | TbHtml.menu | public static function menu(array $items, $htmlOptions = array(), $depth = 0)
{
// todo: consider making this method protected.
if (!empty($items)) {
$htmlOptions['role'] = 'menu';
$output = self::openTag('ul', $htmlOptions);
foreach ($items as $itemOptions) {
if (is_string($itemOptions)) {
if ($itemOptions == '---') {
$output .= self::menuDivider();
} else {
$output .= $itemOptions;
}
} else {
if (TbArray::popValue('visible', $itemOptions, true) === false) {
continue;
}
// todo: consider removing the support for htmlOptions.
$options = TbArray::popValue('htmlOptions', $itemOptions, array());
if (!empty($options)) {
$itemOptions = TbArray::merge($options, $itemOptions);
}
$label = TbArray::popValue('label', $itemOptions, '');
if (TbArray::popValue('active', $itemOptions, false)) {
self::addCssClass('active', $itemOptions);
}
if (TbArray::popValue('disabled', $itemOptions, false)) {
self::addCssClass('disabled', $itemOptions);
}
if (!isset($itemOptions['linkOptions'])) {
$itemOptions['linkOptions'] = array();
}
$icon = TbArray::popValue('icon', $itemOptions);
if (!empty($icon)) {
$label = self::icon($icon) . ' ' . $label;
}
$items = TbArray::popValue('items', $itemOptions, array());
$url = TbArray::popValue('url', $itemOptions, false);
if (empty($items)) {
if (!$url) {
$output .= self::menuHeader($label);
} else {
$itemOptions['linkOptions']['tabindex'] = -1;
$output .= self::menuLink($label, $url, $itemOptions);
}
} else {
$output .= self::menuDropdown($label, $url, $items, $itemOptions, $depth);
}
}
}
$output .= '</ul>';
return $output;
} else {
return '';
}
} | php | public static function menu(array $items, $htmlOptions = array(), $depth = 0)
{
// todo: consider making this method protected.
if (!empty($items)) {
$htmlOptions['role'] = 'menu';
$output = self::openTag('ul', $htmlOptions);
foreach ($items as $itemOptions) {
if (is_string($itemOptions)) {
if ($itemOptions == '---') {
$output .= self::menuDivider();
} else {
$output .= $itemOptions;
}
} else {
if (TbArray::popValue('visible', $itemOptions, true) === false) {
continue;
}
// todo: consider removing the support for htmlOptions.
$options = TbArray::popValue('htmlOptions', $itemOptions, array());
if (!empty($options)) {
$itemOptions = TbArray::merge($options, $itemOptions);
}
$label = TbArray::popValue('label', $itemOptions, '');
if (TbArray::popValue('active', $itemOptions, false)) {
self::addCssClass('active', $itemOptions);
}
if (TbArray::popValue('disabled', $itemOptions, false)) {
self::addCssClass('disabled', $itemOptions);
}
if (!isset($itemOptions['linkOptions'])) {
$itemOptions['linkOptions'] = array();
}
$icon = TbArray::popValue('icon', $itemOptions);
if (!empty($icon)) {
$label = self::icon($icon) . ' ' . $label;
}
$items = TbArray::popValue('items', $itemOptions, array());
$url = TbArray::popValue('url', $itemOptions, false);
if (empty($items)) {
if (!$url) {
$output .= self::menuHeader($label);
} else {
$itemOptions['linkOptions']['tabindex'] = -1;
$output .= self::menuLink($label, $url, $itemOptions);
}
} else {
$output .= self::menuDropdown($label, $url, $items, $itemOptions, $depth);
}
}
}
$output .= '</ul>';
return $output;
} else {
return '';
}
} | [
"public",
"static",
"function",
"menu",
"(",
"array",
"$",
"items",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
",",
"$",
"depth",
"=",
"0",
")",
"{",
"// todo: consider making this method protected.\r",
"if",
"(",
"!",
"empty",
"(",
"$",
"items",
")"... | Generates a menu.
@param array $items the menu items.
@param array $htmlOptions additional HTML attributes.
@param integer $depth the current depth.
@return string the generated menu. | [
"Generates",
"a",
"menu",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/helpers/TbHtml.php#L3612-L3667 |
44,764 | crisu83/yiistrap | helpers/TbHtml.php | TbHtml.menuHeader | public static function menuHeader($label, $htmlOptions = array())
{
self::addCssClass('dropdown-header', $htmlOptions);
return self::tag('li', $htmlOptions, $label);
} | php | public static function menuHeader($label, $htmlOptions = array())
{
self::addCssClass('dropdown-header', $htmlOptions);
return self::tag('li', $htmlOptions, $label);
} | [
"public",
"static",
"function",
"menuHeader",
"(",
"$",
"label",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"self",
"::",
"addCssClass",
"(",
"'dropdown-header'",
",",
"$",
"htmlOptions",
")",
";",
"return",
"self",
"::",
"tag",
"(",
"'li... | Generates a menu header.
@param string $label the header text.
@param array $htmlOptions additional HTML options.
@return string the generated header. | [
"Generates",
"a",
"menu",
"header",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/helpers/TbHtml.php#L3719-L3723 |
44,765 | crisu83/yiistrap | helpers/TbHtml.php | TbHtml.navbar | public static function navbar($content, $htmlOptions = array())
{
self::addCssClass('navbar', $htmlOptions);
$display = TbArray::popValue('display', $htmlOptions);
if (!empty($display)) {
self::addCssClass('navbar-' . $display, $htmlOptions);
}
$color = TbArray::popValue('color', $htmlOptions, 'default');
if (!empty($color)) {
self::addCssClass('navbar-' . $color, $htmlOptions);
}
$htmlOptions['role'] = 'navigation';
$output = self::openTag('nav', $htmlOptions);
$output .= $content;
$output .= '</nav>';
return $output;
} | php | public static function navbar($content, $htmlOptions = array())
{
self::addCssClass('navbar', $htmlOptions);
$display = TbArray::popValue('display', $htmlOptions);
if (!empty($display)) {
self::addCssClass('navbar-' . $display, $htmlOptions);
}
$color = TbArray::popValue('color', $htmlOptions, 'default');
if (!empty($color)) {
self::addCssClass('navbar-' . $color, $htmlOptions);
}
$htmlOptions['role'] = 'navigation';
$output = self::openTag('nav', $htmlOptions);
$output .= $content;
$output .= '</nav>';
return $output;
} | [
"public",
"static",
"function",
"navbar",
"(",
"$",
"content",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"self",
"::",
"addCssClass",
"(",
"'navbar'",
",",
"$",
"htmlOptions",
")",
";",
"$",
"display",
"=",
"TbArray",
"::",
"popValue",
... | Generates a navbar.
@param string $content the navbar content.
@param array $htmlOptions additional HTML attributes.
@return string the generated navbar. | [
"Generates",
"a",
"navbar",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/helpers/TbHtml.php#L3841-L3857 |
44,766 | crisu83/yiistrap | helpers/TbHtml.php | TbHtml.navbarBrandLink | public static function navbarBrandLink($label, $url, $htmlOptions = array())
{
self::addCssClass('navbar-brand', $htmlOptions);
return self::link($label, $url, $htmlOptions);
} | php | public static function navbarBrandLink($label, $url, $htmlOptions = array())
{
self::addCssClass('navbar-brand', $htmlOptions);
return self::link($label, $url, $htmlOptions);
} | [
"public",
"static",
"function",
"navbarBrandLink",
"(",
"$",
"label",
",",
"$",
"url",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"self",
"::",
"addCssClass",
"(",
"'navbar-brand'",
",",
"$",
"htmlOptions",
")",
";",
"return",
"self",
"::... | Generates a brand link for the navbar.
@param string $label the link label text.
@param string $url the link url.
@param array $htmlOptions additional HTML attributes.
@return string the generated link. | [
"Generates",
"a",
"brand",
"link",
"for",
"the",
"navbar",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/helpers/TbHtml.php#L3866-L3870 |
44,767 | crisu83/yiistrap | helpers/TbHtml.php | TbHtml.paginationLink | public static function paginationLink($label, $url, $htmlOptions = array())
{
$linkOptions = TbArray::popValue('linkOptions', $htmlOptions, array());
if (TbArray::popValue('active', $htmlOptions, false)) {
self::addCssClass('active', $htmlOptions);
$label .= ' ' . self::tag('span', array('class' => 'sr-only'), '(current)');
}
if (TbArray::popValue('disabled', $htmlOptions, false)) {
self::addCssClass('disabled', $htmlOptions);
}
$content = self::link($label, $url, $linkOptions);
return self::tag('li', $htmlOptions, $content);
} | php | public static function paginationLink($label, $url, $htmlOptions = array())
{
$linkOptions = TbArray::popValue('linkOptions', $htmlOptions, array());
if (TbArray::popValue('active', $htmlOptions, false)) {
self::addCssClass('active', $htmlOptions);
$label .= ' ' . self::tag('span', array('class' => 'sr-only'), '(current)');
}
if (TbArray::popValue('disabled', $htmlOptions, false)) {
self::addCssClass('disabled', $htmlOptions);
}
$content = self::link($label, $url, $linkOptions);
return self::tag('li', $htmlOptions, $content);
} | [
"public",
"static",
"function",
"paginationLink",
"(",
"$",
"label",
",",
"$",
"url",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"$",
"linkOptions",
"=",
"TbArray",
"::",
"popValue",
"(",
"'linkOptions'",
",",
"$",
"htmlOptions",
",",
"ar... | Generates a pagination link.
@param string $label the link label text.
@param mixed $url the link url.
@param array $htmlOptions additional HTML attributes.
@return string the generated link. | [
"Generates",
"a",
"pagination",
"link",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/helpers/TbHtml.php#L4013-L4025 |
44,768 | crisu83/yiistrap | helpers/TbHtml.php | TbHtml.pager | public static function pager(array $links, $htmlOptions = array())
{
if (!empty($links)) {
self::addCssClass('pager', $htmlOptions);
$output = self::openTag('ul', $htmlOptions);
foreach ($links as $itemOptions) {
// todo: consider removing the support for htmlOptions.
$options = TbArray::popValue('htmlOptions', $itemOptions, array());
if (!empty($options)) {
$itemOptions = TbArray::merge($options, $itemOptions);
}
$label = TbArray::popValue('label', $itemOptions, '');
$url = TbArray::popValue('url', $itemOptions, false);
$output .= self::pagerLink($label, $url, $itemOptions);
}
$output .= '</ul>';
return $output;
}
return '';
} | php | public static function pager(array $links, $htmlOptions = array())
{
if (!empty($links)) {
self::addCssClass('pager', $htmlOptions);
$output = self::openTag('ul', $htmlOptions);
foreach ($links as $itemOptions) {
// todo: consider removing the support for htmlOptions.
$options = TbArray::popValue('htmlOptions', $itemOptions, array());
if (!empty($options)) {
$itemOptions = TbArray::merge($options, $itemOptions);
}
$label = TbArray::popValue('label', $itemOptions, '');
$url = TbArray::popValue('url', $itemOptions, false);
$output .= self::pagerLink($label, $url, $itemOptions);
}
$output .= '</ul>';
return $output;
}
return '';
} | [
"public",
"static",
"function",
"pager",
"(",
"array",
"$",
"links",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"links",
")",
")",
"{",
"self",
"::",
"addCssClass",
"(",
"'pager'",
",",
"$",
"htmlO... | Generates a pager.
@param array $links the pager buttons.
@param array $htmlOptions additional HTML attributes.
@return string the generated pager. | [
"Generates",
"a",
"pager",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/helpers/TbHtml.php#L4033-L4052 |
44,769 | crisu83/yiistrap | helpers/TbHtml.php | TbHtml.thumbnails | public static function thumbnails(array $thumbnails, $htmlOptions = array())
{
if (!empty($thumbnails)) {
self::addCssClass('thumbnails', $htmlOptions);
$defaultSpan = TbArray::popValue('span', $htmlOptions, 3);
$output = self::openTag('ul', $htmlOptions);
foreach ($thumbnails as $thumbnailOptions) {
if (isset($thumbnailOptions['visible']) && $thumbnailOptions['visible'] === false) {
continue;
}
// todo: consider removing the support for htmlOptions.
$options = TbArray::popValue('htmlOptions', $thumbnailOptions, array());
if (!empty($options)) {
$thumbnailOptions = TbArray::merge($options, $thumbnailOptions);
}
$thumbnailOptions['itemOptions']['span'] = TbArray::popValue('span', $thumbnailOptions, $defaultSpan);
$caption = TbArray::popValue('caption', $thumbnailOptions, '');
$captionOptions = TbArray::popValue('captionOptions', $thumbnailOptions, array());
self::addCssClass('caption', $captionOptions);
$label = TbArray::popValue('label', $thumbnailOptions);
$labelOptions = TbArray::popValue('labelOptions', $thumbnailOptions, array());
if (!empty($label)) {
$caption = self::tag('h3', $labelOptions, $label) . $caption;
}
$content = !empty($caption) ? self::tag('div', $captionOptions, $caption) : '';
$image = TbArray::popValue('image', $thumbnailOptions);
$imageOptions = TbArray::popValue('imageOptions', $thumbnailOptions, array());
$imageAlt = TbArray::popValue('alt', $imageOptions, '');
if (!empty($image)) {
$content = parent::image($image, $imageAlt, $imageOptions) . $content;
}
$url = TbArray::popValue('url', $thumbnailOptions, false);
$output .= $url !== false
? self::thumbnailLink($content, $url, $thumbnailOptions)
: self::thumbnail($content, $thumbnailOptions);
}
$output .= '</ul>';
return $output;
} else {
return '';
}
} | php | public static function thumbnails(array $thumbnails, $htmlOptions = array())
{
if (!empty($thumbnails)) {
self::addCssClass('thumbnails', $htmlOptions);
$defaultSpan = TbArray::popValue('span', $htmlOptions, 3);
$output = self::openTag('ul', $htmlOptions);
foreach ($thumbnails as $thumbnailOptions) {
if (isset($thumbnailOptions['visible']) && $thumbnailOptions['visible'] === false) {
continue;
}
// todo: consider removing the support for htmlOptions.
$options = TbArray::popValue('htmlOptions', $thumbnailOptions, array());
if (!empty($options)) {
$thumbnailOptions = TbArray::merge($options, $thumbnailOptions);
}
$thumbnailOptions['itemOptions']['span'] = TbArray::popValue('span', $thumbnailOptions, $defaultSpan);
$caption = TbArray::popValue('caption', $thumbnailOptions, '');
$captionOptions = TbArray::popValue('captionOptions', $thumbnailOptions, array());
self::addCssClass('caption', $captionOptions);
$label = TbArray::popValue('label', $thumbnailOptions);
$labelOptions = TbArray::popValue('labelOptions', $thumbnailOptions, array());
if (!empty($label)) {
$caption = self::tag('h3', $labelOptions, $label) . $caption;
}
$content = !empty($caption) ? self::tag('div', $captionOptions, $caption) : '';
$image = TbArray::popValue('image', $thumbnailOptions);
$imageOptions = TbArray::popValue('imageOptions', $thumbnailOptions, array());
$imageAlt = TbArray::popValue('alt', $imageOptions, '');
if (!empty($image)) {
$content = parent::image($image, $imageAlt, $imageOptions) . $content;
}
$url = TbArray::popValue('url', $thumbnailOptions, false);
$output .= $url !== false
? self::thumbnailLink($content, $url, $thumbnailOptions)
: self::thumbnail($content, $thumbnailOptions);
}
$output .= '</ul>';
return $output;
} else {
return '';
}
} | [
"public",
"static",
"function",
"thumbnails",
"(",
"array",
"$",
"thumbnails",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"thumbnails",
")",
")",
"{",
"self",
"::",
"addCssClass",
"(",
"'thumbnails'",
... | Generates a list of thumbnails.
@param array $thumbnails the list configuration.
@param array $htmlOptions additional HTML attributes.
@return string the generated thumbnails. | [
"Generates",
"a",
"list",
"of",
"thumbnails",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/helpers/TbHtml.php#L4164-L4205 |
44,770 | crisu83/yiistrap | helpers/TbHtml.php | TbHtml.modalHeader | public static function modalHeader($content, $htmlOptions = array())
{
self::addCssClass('modal-header', $htmlOptions);
$closeOptions = TbArray::popValue('closeOptions', $htmlOptions, array());
$closeOptions['dismiss'] = 'modal';
$headingOptions = TbArray::popValue('headingOptions', $htmlOptions, array());
$closeLabel = TbArray::popValue('closeLabel', $htmlOptions, self::CLOSE_TEXT);
$closeButton = self::closeButton($closeLabel, $closeOptions);
self::addCssClass('modal-title', $headingOptions);
$header = self::tag('h4', $headingOptions, $content);
return self::tag('div', $htmlOptions, $closeButton . $header);
} | php | public static function modalHeader($content, $htmlOptions = array())
{
self::addCssClass('modal-header', $htmlOptions);
$closeOptions = TbArray::popValue('closeOptions', $htmlOptions, array());
$closeOptions['dismiss'] = 'modal';
$headingOptions = TbArray::popValue('headingOptions', $htmlOptions, array());
$closeLabel = TbArray::popValue('closeLabel', $htmlOptions, self::CLOSE_TEXT);
$closeButton = self::closeButton($closeLabel, $closeOptions);
self::addCssClass('modal-title', $headingOptions);
$header = self::tag('h4', $headingOptions, $content);
return self::tag('div', $htmlOptions, $closeButton . $header);
} | [
"public",
"static",
"function",
"modalHeader",
"(",
"$",
"content",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"self",
"::",
"addCssClass",
"(",
"'modal-header'",
",",
"$",
"htmlOptions",
")",
";",
"$",
"closeOptions",
"=",
"TbArray",
"::",... | Generates a modal header.
@param string $content the header content.
@param array $htmlOptions additional HTML attributes.
@return string the generated header. | [
"Generates",
"a",
"modal",
"header",
"."
] | 0375cf186f2af76e4b26bbaa95a7be4996590b86 | https://github.com/crisu83/yiistrap/blob/0375cf186f2af76e4b26bbaa95a7be4996590b86/helpers/TbHtml.php#L4581-L4592 |
44,771 | cpliakas/magento-client-php | src/Magento/Client/Rest/OauthException.php | OauthException.factory | public static function factory(RequestInterface $request, Response $response)
{
$message = 'Client error response' . PHP_EOL . implode(PHP_EOL, array(
'[status code] ' . $response->getStatusCode(),
'[reason phrase] ' . $response->getReasonPhrase(),
'[url] ' . $request->getUrl(),
));
$e = new static($message);
$e->setResponse($response);
$e->setRequest($request);
return $e;
} | php | public static function factory(RequestInterface $request, Response $response)
{
$message = 'Client error response' . PHP_EOL . implode(PHP_EOL, array(
'[status code] ' . $response->getStatusCode(),
'[reason phrase] ' . $response->getReasonPhrase(),
'[url] ' . $request->getUrl(),
));
$e = new static($message);
$e->setResponse($response);
$e->setRequest($request);
return $e;
} | [
"public",
"static",
"function",
"factory",
"(",
"RequestInterface",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"$",
"message",
"=",
"'Client error response'",
".",
"PHP_EOL",
".",
"implode",
"(",
"PHP_EOL",
",",
"array",
"(",
"'[status code] '",... | Factory method to create a new Oauth exception.
@param RequestInterface $request
@param Response $response
@return OauthException | [
"Factory",
"method",
"to",
"create",
"a",
"new",
"Oauth",
"exception",
"."
] | f13c45c5ca36c2260632c191225c7664c6dfd176 | https://github.com/cpliakas/magento-client-php/blob/f13c45c5ca36c2260632c191225c7664c6dfd176/src/Magento/Client/Rest/OauthException.php#L19-L32 |
44,772 | cpliakas/magento-client-php | src/Magento/Client/Rest/OauthException.php | OauthException.getOauthProblem | public function getOauthProblem()
{
parse_str($this->getResponse()->getBody(true), $arr);
return isset($arr['oauth_problem']) ? $arr['oauth_problem'] : '';
} | php | public function getOauthProblem()
{
parse_str($this->getResponse()->getBody(true), $arr);
return isset($arr['oauth_problem']) ? $arr['oauth_problem'] : '';
} | [
"public",
"function",
"getOauthProblem",
"(",
")",
"{",
"parse_str",
"(",
"$",
"this",
"->",
"getResponse",
"(",
")",
"->",
"getBody",
"(",
"true",
")",
",",
"$",
"arr",
")",
";",
"return",
"isset",
"(",
"$",
"arr",
"[",
"'oauth_problem'",
"]",
")",
... | Returns the Magento problem constant.
@return string | [
"Returns",
"the",
"Magento",
"problem",
"constant",
"."
] | f13c45c5ca36c2260632c191225c7664c6dfd176 | https://github.com/cpliakas/magento-client-php/blob/f13c45c5ca36c2260632c191225c7664c6dfd176/src/Magento/Client/Rest/OauthException.php#L39-L43 |
44,773 | silverstripe/silverstripe-errorpage | src/ErrorPage.php | ErrorPage.requireDefaultRecords | public function requireDefaultRecords()
{
parent::requireDefaultRecords();
// Only run on ErrorPage class directly, not subclasses
if (static::class !== self::class || !SiteTree::config()->create_default_pages) {
return;
}
$defaultPages = $this->getDefaultRecords();
foreach ($defaultPages as $defaultData) {
$this->requireDefaultRecordFixture($defaultData);
}
} | php | public function requireDefaultRecords()
{
parent::requireDefaultRecords();
// Only run on ErrorPage class directly, not subclasses
if (static::class !== self::class || !SiteTree::config()->create_default_pages) {
return;
}
$defaultPages = $this->getDefaultRecords();
foreach ($defaultPages as $defaultData) {
$this->requireDefaultRecordFixture($defaultData);
}
} | [
"public",
"function",
"requireDefaultRecords",
"(",
")",
"{",
"parent",
"::",
"requireDefaultRecords",
"(",
")",
";",
"// Only run on ErrorPage class directly, not subclasses",
"if",
"(",
"static",
"::",
"class",
"!==",
"self",
"::",
"class",
"||",
"!",
"SiteTree",
... | Ensures that there is always a 404 page by checking if there's an
instance of ErrorPage with a 404 and 500 error code. If there is not,
one is created when the DB is built. | [
"Ensures",
"that",
"there",
"is",
"always",
"a",
"404",
"page",
"by",
"checking",
"if",
"there",
"s",
"an",
"instance",
"of",
"ErrorPage",
"with",
"a",
"404",
"and",
"500",
"error",
"code",
".",
"If",
"there",
"is",
"not",
"one",
"is",
"created",
"when... | 1f25ed3ca1176c49c6113d1496a2f1d2c3d8ee9c | https://github.com/silverstripe/silverstripe-errorpage/blob/1f25ed3ca1176c49c6113d1496a2f1d2c3d8ee9c/src/ErrorPage.php#L128-L142 |
44,774 | silverstripe/silverstripe-errorpage | src/ErrorPage.php | ErrorPage.requireDefaultRecordFixture | protected function requireDefaultRecordFixture($defaultData)
{
$code = $defaultData['ErrorCode'];
$page = ErrorPage::get()->filter('ErrorCode', $code)->first();
$pageExists = !empty($page);
if (!$pageExists) {
$page = new ErrorPage($defaultData);
$page->write();
$page->copyVersionToStage(Versioned::DRAFT, Versioned::LIVE);
}
// Check if static files are enabled
if (!self::config()->enable_static_file) {
return;
}
// Ensure this page has cached error content
$success = true;
if (!$page->hasStaticPage()) {
// Update static content
$success = $page->writeStaticPage();
} elseif ($pageExists) {
// If page exists and already has content, no alteration_message is displayed
return;
}
if ($success) {
DB::alteration_message(
sprintf('%s error page created', $code),
'created'
);
} else {
DB::alteration_message(
sprintf('%s error page could not be created. Please check permissions', $code),
'error'
);
}
} | php | protected function requireDefaultRecordFixture($defaultData)
{
$code = $defaultData['ErrorCode'];
$page = ErrorPage::get()->filter('ErrorCode', $code)->first();
$pageExists = !empty($page);
if (!$pageExists) {
$page = new ErrorPage($defaultData);
$page->write();
$page->copyVersionToStage(Versioned::DRAFT, Versioned::LIVE);
}
// Check if static files are enabled
if (!self::config()->enable_static_file) {
return;
}
// Ensure this page has cached error content
$success = true;
if (!$page->hasStaticPage()) {
// Update static content
$success = $page->writeStaticPage();
} elseif ($pageExists) {
// If page exists and already has content, no alteration_message is displayed
return;
}
if ($success) {
DB::alteration_message(
sprintf('%s error page created', $code),
'created'
);
} else {
DB::alteration_message(
sprintf('%s error page could not be created. Please check permissions', $code),
'error'
);
}
} | [
"protected",
"function",
"requireDefaultRecordFixture",
"(",
"$",
"defaultData",
")",
"{",
"$",
"code",
"=",
"$",
"defaultData",
"[",
"'ErrorCode'",
"]",
";",
"$",
"page",
"=",
"ErrorPage",
"::",
"get",
"(",
")",
"->",
"filter",
"(",
"'ErrorCode'",
",",
"$... | Build default record from specification fixture
@param array $defaultData | [
"Build",
"default",
"record",
"from",
"specification",
"fixture"
] | 1f25ed3ca1176c49c6113d1496a2f1d2c3d8ee9c | https://github.com/silverstripe/silverstripe-errorpage/blob/1f25ed3ca1176c49c6113d1496a2f1d2c3d8ee9c/src/ErrorPage.php#L149-L186 |
44,775 | silverstripe/silverstripe-errorpage | src/ErrorPage.php | ErrorPage.getDefaultRecords | protected function getDefaultRecords()
{
$data = array(
array(
'ErrorCode' => 404,
'Title' => _t('SilverStripe\\ErrorPage\\ErrorPage.DEFAULTERRORPAGETITLE', 'Page not found'),
'Content' => _t(
'SilverStripe\\ErrorPage\\ErrorPage.DEFAULTERRORPAGECONTENT',
'<p>Sorry, it seems you were trying to access a page that doesn\'t exist.</p>'
. '<p>Please check the spelling of the URL you were trying to access and try again.</p>'
)
),
array(
'ErrorCode' => 500,
'Title' => _t('SilverStripe\\ErrorPage\\ErrorPage.DEFAULTSERVERERRORPAGETITLE', 'Server error'),
'Content' => _t(
'SilverStripe\\ErrorPage\\ErrorPage.DEFAULTSERVERERRORPAGECONTENT',
'<p>Sorry, there was a problem with handling your request.</p>'
)
)
);
$this->extend('getDefaultRecords', $data);
return $data;
} | php | protected function getDefaultRecords()
{
$data = array(
array(
'ErrorCode' => 404,
'Title' => _t('SilverStripe\\ErrorPage\\ErrorPage.DEFAULTERRORPAGETITLE', 'Page not found'),
'Content' => _t(
'SilverStripe\\ErrorPage\\ErrorPage.DEFAULTERRORPAGECONTENT',
'<p>Sorry, it seems you were trying to access a page that doesn\'t exist.</p>'
. '<p>Please check the spelling of the URL you were trying to access and try again.</p>'
)
),
array(
'ErrorCode' => 500,
'Title' => _t('SilverStripe\\ErrorPage\\ErrorPage.DEFAULTSERVERERRORPAGETITLE', 'Server error'),
'Content' => _t(
'SilverStripe\\ErrorPage\\ErrorPage.DEFAULTSERVERERRORPAGECONTENT',
'<p>Sorry, there was a problem with handling your request.</p>'
)
)
);
$this->extend('getDefaultRecords', $data);
return $data;
} | [
"protected",
"function",
"getDefaultRecords",
"(",
")",
"{",
"$",
"data",
"=",
"array",
"(",
"array",
"(",
"'ErrorCode'",
"=>",
"404",
",",
"'Title'",
"=>",
"_t",
"(",
"'SilverStripe\\\\ErrorPage\\\\ErrorPage.DEFAULTERRORPAGETITLE'",
",",
"'Page not found'",
")",
",... | Returns an array of arrays, each of which defines properties for a new
ErrorPage record.
@return array | [
"Returns",
"an",
"array",
"of",
"arrays",
"each",
"of",
"which",
"defines",
"properties",
"for",
"a",
"new",
"ErrorPage",
"record",
"."
] | 1f25ed3ca1176c49c6113d1496a2f1d2c3d8ee9c | https://github.com/silverstripe/silverstripe-errorpage/blob/1f25ed3ca1176c49c6113d1496a2f1d2c3d8ee9c/src/ErrorPage.php#L194-L219 |
44,776 | silverstripe/silverstripe-errorpage | src/ErrorPage.php | ErrorPage.hasStaticPage | protected function hasStaticPage()
{
if (!self::config()->enable_static_file) {
return false;
}
// Attempt to retrieve content from generated file handler
$filename = $this->getErrorFilename();
$storeFilename = File::join_paths(self::config()->store_filepath, $filename);
$result = self::get_asset_handler()->getContent($storeFilename);
return !empty($result);
} | php | protected function hasStaticPage()
{
if (!self::config()->enable_static_file) {
return false;
}
// Attempt to retrieve content from generated file handler
$filename = $this->getErrorFilename();
$storeFilename = File::join_paths(self::config()->store_filepath, $filename);
$result = self::get_asset_handler()->getContent($storeFilename);
return !empty($result);
} | [
"protected",
"function",
"hasStaticPage",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"config",
"(",
")",
"->",
"enable_static_file",
")",
"{",
"return",
"false",
";",
"}",
"// Attempt to retrieve content from generated file handler",
"$",
"filename",
"=",
"$",
... | Determine if static content is cached for this page
@return bool | [
"Determine",
"if",
"static",
"content",
"is",
"cached",
"for",
"this",
"page"
] | 1f25ed3ca1176c49c6113d1496a2f1d2c3d8ee9c | https://github.com/silverstripe/silverstripe-errorpage/blob/1f25ed3ca1176c49c6113d1496a2f1d2c3d8ee9c/src/ErrorPage.php#L261-L272 |
44,777 | silverstripe/silverstripe-errorpage | src/ErrorPage.php | ErrorPage.writeStaticPage | public function writeStaticPage()
{
if (!self::config()->enable_static_file) {
return false;
}
// Run the page (reset the theme, it might've been disabled by LeftAndMain::init())
$originalThemes = SSViewer::get_themes();
try {
// Restore front-end themes from config
$themes = SSViewer::config()->get('themes') ?: $originalThemes;
SSViewer::set_themes($themes);
// Render page as non-member in live mode
$response = Member::actAs(null, function () {
$response = Director::test(Director::makeRelative($this->getAbsoluteLiveLink()));
return $response;
});
$errorContent = $response->getBody();
} finally {
// Restore themes
SSViewer::set_themes($originalThemes);
}
// Make sure we have content to save
if ($errorContent) {
// Store file content in the default store
$storeFilename = File::join_paths(
self::config()->store_filepath,
$this->getErrorFilename()
);
self::get_asset_handler()->setContent($storeFilename, $errorContent);
return true;
} else {
return false;
}
} | php | public function writeStaticPage()
{
if (!self::config()->enable_static_file) {
return false;
}
// Run the page (reset the theme, it might've been disabled by LeftAndMain::init())
$originalThemes = SSViewer::get_themes();
try {
// Restore front-end themes from config
$themes = SSViewer::config()->get('themes') ?: $originalThemes;
SSViewer::set_themes($themes);
// Render page as non-member in live mode
$response = Member::actAs(null, function () {
$response = Director::test(Director::makeRelative($this->getAbsoluteLiveLink()));
return $response;
});
$errorContent = $response->getBody();
} finally {
// Restore themes
SSViewer::set_themes($originalThemes);
}
// Make sure we have content to save
if ($errorContent) {
// Store file content in the default store
$storeFilename = File::join_paths(
self::config()->store_filepath,
$this->getErrorFilename()
);
self::get_asset_handler()->setContent($storeFilename, $errorContent);
return true;
} else {
return false;
}
} | [
"public",
"function",
"writeStaticPage",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"config",
"(",
")",
"->",
"enable_static_file",
")",
"{",
"return",
"false",
";",
"}",
"// Run the page (reset the theme, it might've been disabled by LeftAndMain::init())",
"$",
"or... | Write out the published version of the page to the filesystem.
@return true if the page write was successful | [
"Write",
"out",
"the",
"published",
"version",
"of",
"the",
"page",
"to",
"the",
"filesystem",
"."
] | 1f25ed3ca1176c49c6113d1496a2f1d2c3d8ee9c | https://github.com/silverstripe/silverstripe-errorpage/blob/1f25ed3ca1176c49c6113d1496a2f1d2c3d8ee9c/src/ErrorPage.php#L279-L317 |
44,778 | silverstripe/silverstripe-errorpage | src/ErrorPage.php | ErrorPage.get_content_for_errorcode | public static function get_content_for_errorcode($statusCode)
{
if (!self::config()->enable_static_file) {
return null;
}
// Attempt to retrieve content from generated file handler
$filename = self::get_error_filename($statusCode);
$storeFilename = File::join_paths(
self::config()->store_filepath,
$filename
);
return self::get_asset_handler()->getContent($storeFilename);
} | php | public static function get_content_for_errorcode($statusCode)
{
if (!self::config()->enable_static_file) {
return null;
}
// Attempt to retrieve content from generated file handler
$filename = self::get_error_filename($statusCode);
$storeFilename = File::join_paths(
self::config()->store_filepath,
$filename
);
return self::get_asset_handler()->getContent($storeFilename);
} | [
"public",
"static",
"function",
"get_content_for_errorcode",
"(",
"$",
"statusCode",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"config",
"(",
")",
"->",
"enable_static_file",
")",
"{",
"return",
"null",
";",
"}",
"// Attempt to retrieve content from generated file han... | Returns statically cached content for a given error code
@param int $statusCode A HTTP Statuscode, typically 404 or 500
@return string|null | [
"Returns",
"statically",
"cached",
"content",
"for",
"a",
"given",
"error",
"code"
] | 1f25ed3ca1176c49c6113d1496a2f1d2c3d8ee9c | https://github.com/silverstripe/silverstripe-errorpage/blob/1f25ed3ca1176c49c6113d1496a2f1d2c3d8ee9c/src/ErrorPage.php#L338-L351 |
44,779 | silverstripe/silverstripe-errorpage | src/ErrorPage.php | ErrorPage.get_error_filename | protected static function get_error_filename($statusCode, $instance = null)
{
if (!$instance) {
$instance = ErrorPage::singleton();
}
// Allow modules to extend this filename (e.g. for multi-domain, translatable)
$name = "error-{$statusCode}.html";
$instance->extend('updateErrorFilename', $name, $statusCode);
return $name;
} | php | protected static function get_error_filename($statusCode, $instance = null)
{
if (!$instance) {
$instance = ErrorPage::singleton();
}
// Allow modules to extend this filename (e.g. for multi-domain, translatable)
$name = "error-{$statusCode}.html";
$instance->extend('updateErrorFilename', $name, $statusCode);
return $name;
} | [
"protected",
"static",
"function",
"get_error_filename",
"(",
"$",
"statusCode",
",",
"$",
"instance",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"instance",
")",
"{",
"$",
"instance",
"=",
"ErrorPage",
"::",
"singleton",
"(",
")",
";",
"}",
"// Allow m... | Gets the filename identifier for the given error code.
Used when handling responses under error conditions.
@param int $statusCode A HTTP Statuscode, typically 404 or 500
@param ErrorPage $instance Optional instance to use for name generation
@return string | [
"Gets",
"the",
"filename",
"identifier",
"for",
"the",
"given",
"error",
"code",
".",
"Used",
"when",
"handling",
"responses",
"under",
"error",
"conditions",
"."
] | 1f25ed3ca1176c49c6113d1496a2f1d2c3d8ee9c | https://github.com/silverstripe/silverstripe-errorpage/blob/1f25ed3ca1176c49c6113d1496a2f1d2c3d8ee9c/src/ErrorPage.php#L392-L401 |
44,780 | pear/Console_Getopt | Console/Getopt.php | Console_Getopt._parseLongOption | protected static function _parseLongOption($arg, $long_options, &$opts, &$argIdx, $args, $skip_unknown)
{
@list($opt, $opt_arg) = explode('=', $arg, 2);
$opt_len = strlen($opt);
for ($i = 0; $i < count($long_options); $i++) {
$long_opt = $long_options[$i];
$opt_start = substr($long_opt, 0, $opt_len);
$long_opt_name = str_replace('=', '', $long_opt);
/* Option doesn't match. Go on to the next one. */
if ($long_opt_name != $opt) {
continue;
}
$opt_rest = substr($long_opt, $opt_len);
/* Check that the options uniquely matches one of the allowed
options. */
if ($i + 1 < count($long_options)) {
$next_option_rest = substr($long_options[$i + 1], $opt_len);
} else {
$next_option_rest = '';
}
if ($opt_rest != '' && $opt{0} != '=' &&
$i + 1 < count($long_options) &&
$opt == substr($long_options[$i+1], 0, $opt_len) &&
$next_option_rest != '' &&
$next_option_rest{0} != '=') {
$msg = "Console_Getopt: option --$opt is ambiguous";
return PEAR::raiseError($msg);
}
if (substr($long_opt, -1) == '=') {
if (substr($long_opt, -2) != '==') {
/* Long option requires an argument.
Take the next argument if one wasn't specified. */;
if (!strlen($opt_arg)) {
if (!isset($args[++$argIdx])) {
$msg = "Console_Getopt: option requires an argument --$opt";
return PEAR::raiseError($msg);
}
$opt_arg = $args[$argIdx];
}
if (Console_Getopt::_isShortOpt($opt_arg)
|| Console_Getopt::_isLongOpt($opt_arg)) {
$msg = "Console_Getopt: option requires an argument --$opt";
return PEAR::raiseError($msg);
}
}
} else if ($opt_arg) {
$msg = "Console_Getopt: option --$opt doesn't allow an argument";
return PEAR::raiseError($msg);
}
$opts[] = array('--' . $opt, $opt_arg);
return;
}
if ($skip_unknown === true) {
return;
}
return PEAR::raiseError("Console_Getopt: unrecognized option --$opt");
} | php | protected static function _parseLongOption($arg, $long_options, &$opts, &$argIdx, $args, $skip_unknown)
{
@list($opt, $opt_arg) = explode('=', $arg, 2);
$opt_len = strlen($opt);
for ($i = 0; $i < count($long_options); $i++) {
$long_opt = $long_options[$i];
$opt_start = substr($long_opt, 0, $opt_len);
$long_opt_name = str_replace('=', '', $long_opt);
/* Option doesn't match. Go on to the next one. */
if ($long_opt_name != $opt) {
continue;
}
$opt_rest = substr($long_opt, $opt_len);
/* Check that the options uniquely matches one of the allowed
options. */
if ($i + 1 < count($long_options)) {
$next_option_rest = substr($long_options[$i + 1], $opt_len);
} else {
$next_option_rest = '';
}
if ($opt_rest != '' && $opt{0} != '=' &&
$i + 1 < count($long_options) &&
$opt == substr($long_options[$i+1], 0, $opt_len) &&
$next_option_rest != '' &&
$next_option_rest{0} != '=') {
$msg = "Console_Getopt: option --$opt is ambiguous";
return PEAR::raiseError($msg);
}
if (substr($long_opt, -1) == '=') {
if (substr($long_opt, -2) != '==') {
/* Long option requires an argument.
Take the next argument if one wasn't specified. */;
if (!strlen($opt_arg)) {
if (!isset($args[++$argIdx])) {
$msg = "Console_Getopt: option requires an argument --$opt";
return PEAR::raiseError($msg);
}
$opt_arg = $args[$argIdx];
}
if (Console_Getopt::_isShortOpt($opt_arg)
|| Console_Getopt::_isLongOpt($opt_arg)) {
$msg = "Console_Getopt: option requires an argument --$opt";
return PEAR::raiseError($msg);
}
}
} else if ($opt_arg) {
$msg = "Console_Getopt: option --$opt doesn't allow an argument";
return PEAR::raiseError($msg);
}
$opts[] = array('--' . $opt, $opt_arg);
return;
}
if ($skip_unknown === true) {
return;
}
return PEAR::raiseError("Console_Getopt: unrecognized option --$opt");
} | [
"protected",
"static",
"function",
"_parseLongOption",
"(",
"$",
"arg",
",",
"$",
"long_options",
",",
"&",
"$",
"opts",
",",
"&",
"$",
"argIdx",
",",
"$",
"args",
",",
"$",
"skip_unknown",
")",
"{",
"@",
"list",
"(",
"$",
"opt",
",",
"$",
"opt_arg",... | Parse long option
@param string $arg Argument
@param string[] $long_options Available long options
@param string[][] &$opts
@param int &$argIdx
@param string[] $args
@return void|PEAR_Error | [
"Parse",
"long",
"option"
] | 6c77aeb625b32bd752e89ee17972d103588b90c0 | https://github.com/pear/Console_Getopt/blob/6c77aeb625b32bd752e89ee17972d103588b90c0/Console/Getopt.php#L272-L341 |
44,781 | whitehat101/apr1-md5 | src/APR1_MD5.php | APR1_MD5.salt | public static function salt() {
$alphabet = self::APRMD5_ALPHABET;
$salt = '';
for($i=0; $i<8; $i++) {
$offset = hexdec(bin2hex(openssl_random_pseudo_bytes(1))) % 64;
$salt .= $alphabet[$offset];
}
return $salt;
} | php | public static function salt() {
$alphabet = self::APRMD5_ALPHABET;
$salt = '';
for($i=0; $i<8; $i++) {
$offset = hexdec(bin2hex(openssl_random_pseudo_bytes(1))) % 64;
$salt .= $alphabet[$offset];
}
return $salt;
} | [
"public",
"static",
"function",
"salt",
"(",
")",
"{",
"$",
"alphabet",
"=",
"self",
"::",
"APRMD5_ALPHABET",
";",
"$",
"salt",
"=",
"''",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"8",
";",
"$",
"i",
"++",
")",
"{",
"$",
"offs... | 8 character salts are the best. Don't encourage anything but the best. | [
"8",
"character",
"salts",
"are",
"the",
"best",
".",
"Don",
"t",
"encourage",
"anything",
"but",
"the",
"best",
"."
] | d555fc829099381e9708362d04e9c3cc99b2142a | https://github.com/whitehat101/apr1-md5/blob/d555fc829099381e9708362d04e9c3cc99b2142a/src/APR1_MD5.php#L53-L61 |
44,782 | 2600hz/kazoo-php-sdk | lib/hz2600/Kazoo/Api/Entity/Conference.php | Conference.dial | public function dial($data) {
$envelope = new stdClass();
$envelope->action = "dial";
$envelope->data = $data;
return $this->executeDial($envelope);
} | php | public function dial($data) {
$envelope = new stdClass();
$envelope->action = "dial";
$envelope->data = $data;
return $this->executeDial($envelope);
} | [
"public",
"function",
"dial",
"(",
"$",
"data",
")",
"{",
"$",
"envelope",
"=",
"new",
"stdClass",
"(",
")",
";",
"$",
"envelope",
"->",
"action",
"=",
"\"dial\"",
";",
"$",
"envelope",
"->",
"data",
"=",
"$",
"data",
";",
"return",
"$",
"this",
"-... | Dial out to endpoints and place answering endpoints in a conference
@param stdClass $data Endpoints' information for dialing | [
"Dial",
"out",
"to",
"endpoints",
"and",
"place",
"answering",
"endpoints",
"in",
"a",
"conference"
] | 945217ce4562c87d2663d2a55c8603f77ff37dec | https://github.com/2600hz/kazoo-php-sdk/blob/945217ce4562c87d2663d2a55c8603f77ff37dec/lib/hz2600/Kazoo/Api/Entity/Conference.php#L14-L20 |
44,783 | 2600hz/kazoo-php-sdk | lib/hz2600/Kazoo/Api/Entity/AbstractEntity.php | AbstractEntity.getRaw | public function getRaw($stream = false)
{
$this->setTokenValue($this->getEntityIdName(), $this->getId());
$uri = $this->getURI('/raw');
$x = $this->getSDK()->get($uri, array(), array('accept'=>'audio/*',
'content_type'=>'audio/*', 'Range'=> 'bytes'));
header('Content-Type: '.$x->getHeader('Content-Type')[0]);
header('content-length: '.$x->getHeader('content-length')[0]);
header('Accept-Ranges: '.$x->getHeader('Accept-Ranges')[0]);
if (!$stream) {
header('Content-Disposition: '.$x->getHeader('Content-Disposition')[0]);
}
echo $x->getBody();
} | php | public function getRaw($stream = false)
{
$this->setTokenValue($this->getEntityIdName(), $this->getId());
$uri = $this->getURI('/raw');
$x = $this->getSDK()->get($uri, array(), array('accept'=>'audio/*',
'content_type'=>'audio/*', 'Range'=> 'bytes'));
header('Content-Type: '.$x->getHeader('Content-Type')[0]);
header('content-length: '.$x->getHeader('content-length')[0]);
header('Accept-Ranges: '.$x->getHeader('Accept-Ranges')[0]);
if (!$stream) {
header('Content-Disposition: '.$x->getHeader('Content-Disposition')[0]);
}
echo $x->getBody();
} | [
"public",
"function",
"getRaw",
"(",
"$",
"stream",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"setTokenValue",
"(",
"$",
"this",
"->",
"getEntityIdName",
"(",
")",
",",
"$",
"this",
"->",
"getId",
"(",
")",
")",
";",
"$",
"uri",
"=",
"$",
"this",
... | downloads or streams a media file
@param boolean $stream Set to true to stream the file
@return binary Media file | [
"downloads",
"or",
"streams",
"a",
"media",
"file"
] | 945217ce4562c87d2663d2a55c8603f77ff37dec | https://github.com/2600hz/kazoo-php-sdk/blob/945217ce4562c87d2663d2a55c8603f77ff37dec/lib/hz2600/Kazoo/Api/Entity/AbstractEntity.php#L163-L178 |
44,784 | 2600hz/kazoo-php-sdk | lib/hz2600/Kazoo/Api/Entity/AbstractEntity.php | AbstractEntity.fetch | public function fetch($append_uri = null) {
$this->setTokenValue($this->getEntityIdName(), $this->getId());
$response = $this->get(array(), $append_uri);
$entity = $response->getData();
$this->setEntity($entity);
return $this;
} | php | public function fetch($append_uri = null) {
$this->setTokenValue($this->getEntityIdName(), $this->getId());
$response = $this->get(array(), $append_uri);
$entity = $response->getData();
$this->setEntity($entity);
return $this;
} | [
"public",
"function",
"fetch",
"(",
"$",
"append_uri",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setTokenValue",
"(",
"$",
"this",
"->",
"getEntityIdName",
"(",
")",
",",
"$",
"this",
"->",
"getId",
"(",
")",
")",
";",
"$",
"response",
"=",
"$",
"... | Explicitly fetch from Kazoo, typicall it lazy-loads.
This could also be used to re-load to ensure the data
is fresh. | [
"Explicitly",
"fetch",
"from",
"Kazoo",
"typicall",
"it",
"lazy",
"-",
"loads",
".",
"This",
"could",
"also",
"be",
"used",
"to",
"re",
"-",
"load",
"to",
"ensure",
"the",
"data",
"is",
"fresh",
"."
] | 945217ce4562c87d2663d2a55c8603f77ff37dec | https://github.com/2600hz/kazoo-php-sdk/blob/945217ce4562c87d2663d2a55c8603f77ff37dec/lib/hz2600/Kazoo/Api/Entity/AbstractEntity.php#L186-L195 |
44,785 | 2600hz/kazoo-php-sdk | lib/hz2600/Kazoo/Api/Entity/AbstractEntity.php | AbstractEntity.mset | public static function mset($chunk, array $keys, $value) {
$head = $chunk;
$last = count($keys)-1;
foreach($keys as $id => $key) {
if ($last == $id) {
if (is_null($value)) {
unset($chunk->$key);
} else {
$chunk->$key = $value;
}
} else {
$chunk->$key = isset($chunk->$key)? $chunk->$key : new stdClass();
$chunk = $chunk->$key;
}
}
return $head;
} | php | public static function mset($chunk, array $keys, $value) {
$head = $chunk;
$last = count($keys)-1;
foreach($keys as $id => $key) {
if ($last == $id) {
if (is_null($value)) {
unset($chunk->$key);
} else {
$chunk->$key = $value;
}
} else {
$chunk->$key = isset($chunk->$key)? $chunk->$key : new stdClass();
$chunk = $chunk->$key;
}
}
return $head;
} | [
"public",
"static",
"function",
"mset",
"(",
"$",
"chunk",
",",
"array",
"$",
"keys",
",",
"$",
"value",
")",
"{",
"$",
"head",
"=",
"$",
"chunk",
";",
"$",
"last",
"=",
"count",
"(",
"$",
"keys",
")",
"-",
"1",
";",
"foreach",
"(",
"$",
"keys"... | auto-create nodes for this->k1->k2->k3 = v1 | [
"auto",
"-",
"create",
"nodes",
"for",
"this",
"-",
">",
"k1",
"-",
">",
"k2",
"-",
">",
"k3",
"=",
"v1"
] | 945217ce4562c87d2663d2a55c8603f77ff37dec | https://github.com/2600hz/kazoo-php-sdk/blob/945217ce4562c87d2663d2a55c8603f77ff37dec/lib/hz2600/Kazoo/Api/Entity/AbstractEntity.php#L439-L455 |
44,786 | 2600hz/kazoo-php-sdk | lib/hz2600/Kazoo/HttpClient/HttpClient.php | HttpClient.resetHeaders | public function resetHeaders() {
$headers = $this->getSDK()->getOption('headers');
$this->headers = array(
'Accept' => $headers['accept'],
'Content-Type' => $headers['content_type'],
'User-Agent' => $headers['user_agent'],
);
} | php | public function resetHeaders() {
$headers = $this->getSDK()->getOption('headers');
$this->headers = array(
'Accept' => $headers['accept'],
'Content-Type' => $headers['content_type'],
'User-Agent' => $headers['user_agent'],
);
} | [
"public",
"function",
"resetHeaders",
"(",
")",
"{",
"$",
"headers",
"=",
"$",
"this",
"->",
"getSDK",
"(",
")",
"->",
"getOption",
"(",
"'headers'",
")",
";",
"$",
"this",
"->",
"headers",
"=",
"array",
"(",
"'Accept'",
"=>",
"$",
"headers",
"[",
"'... | Reset headers to the SDK options | [
"Reset",
"headers",
"to",
"the",
"SDK",
"options"
] | 945217ce4562c87d2663d2a55c8603f77ff37dec | https://github.com/2600hz/kazoo-php-sdk/blob/945217ce4562c87d2663d2a55c8603f77ff37dec/lib/hz2600/Kazoo/HttpClient/HttpClient.php#L124-L131 |
44,787 | 2600hz/kazoo-php-sdk | lib/hz2600/Kazoo/Api/Entity/Account.php | Account.createChild | public function createChild($account) {
$id = $this->getId();
$payload = $account->getPayload();
$this->setTokenValue($this->getEntityIdName(), $id);
$response = $this->put($payload);
$entity = $response->getData();
$this->setEntity($entity);
return $this;
} | php | public function createChild($account) {
$id = $this->getId();
$payload = $account->getPayload();
$this->setTokenValue($this->getEntityIdName(), $id);
$response = $this->put($payload);
$entity = $response->getData();
$this->setEntity($entity);
return $this;
} | [
"public",
"function",
"createChild",
"(",
"$",
"account",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getId",
"(",
")",
";",
"$",
"payload",
"=",
"$",
"account",
"->",
"getPayload",
"(",
")",
";",
"$",
"this",
"->",
"setTokenValue",
"(",
"$",
"th... | Create a child account of this account. Returns the new Account entity.
@param \Kazoo\Api\Entity\Account $account The account to create below
this account
@return \Kazoo\Api\Entity\Account The new child account after saving | [
"Create",
"a",
"child",
"account",
"of",
"this",
"account",
".",
"Returns",
"the",
"new",
"Account",
"entity",
"."
] | 945217ce4562c87d2663d2a55c8603f77ff37dec | https://github.com/2600hz/kazoo-php-sdk/blob/945217ce4562c87d2663d2a55c8603f77ff37dec/lib/hz2600/Kazoo/Api/Entity/Account.php#L62-L74 |
44,788 | 2600hz/kazoo-php-sdk | lib/hz2600/Kazoo/Api/Entity/Device.php | Device.performAction | public function performAction($action, $data = null) {
$this->setTokenValue($this->getEntityIdName(), $this->getId());
$payload = new \stdClass;
$payload->data = new \stdClass;
$payload->data->action = $action;
$payload->data->data = is_null($data) ? new \stdClass : $data;
$this->put(json_encode($payload));
} | php | public function performAction($action, $data = null) {
$this->setTokenValue($this->getEntityIdName(), $this->getId());
$payload = new \stdClass;
$payload->data = new \stdClass;
$payload->data->action = $action;
$payload->data->data = is_null($data) ? new \stdClass : $data;
$this->put(json_encode($payload));
} | [
"public",
"function",
"performAction",
"(",
"$",
"action",
",",
"$",
"data",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setTokenValue",
"(",
"$",
"this",
"->",
"getEntityIdName",
"(",
")",
",",
"$",
"this",
"->",
"getId",
"(",
")",
")",
";",
"$",
"... | Perform an action on this device
@param string $action The name of the action to perform
@param stdClass|null $data Optional extra data to control how the action
is performed | [
"Perform",
"an",
"action",
"on",
"this",
"device"
] | 945217ce4562c87d2663d2a55c8603f77ff37dec | https://github.com/2600hz/kazoo-php-sdk/blob/945217ce4562c87d2663d2a55c8603f77ff37dec/lib/hz2600/Kazoo/Api/Entity/Device.php#L14-L23 |
44,789 | 2600hz/kazoo-php-sdk | lib/hz2600/Kazoo/Api/Entity/Media.php | Media.postRaw | public function postRaw($path, $mime_type)
{
$this->setTokenValue($this->getEntityIdName(), $this->getId());
$bin = file_get_contents($path);
$b64 = 'data:'.$mime_type.';base64,'.base64_encode($bin);
$uri = $this->getURI('/raw');
$x = $this->getSDK()->post($uri, $b64, array('Content-Type' => 'application/x-base64'));
} | php | public function postRaw($path, $mime_type)
{
$this->setTokenValue($this->getEntityIdName(), $this->getId());
$bin = file_get_contents($path);
$b64 = 'data:'.$mime_type.';base64,'.base64_encode($bin);
$uri = $this->getURI('/raw');
$x = $this->getSDK()->post($uri, $b64, array('Content-Type' => 'application/x-base64'));
} | [
"public",
"function",
"postRaw",
"(",
"$",
"path",
",",
"$",
"mime_type",
")",
"{",
"$",
"this",
"->",
"setTokenValue",
"(",
"$",
"this",
"->",
"getEntityIdName",
"(",
")",
",",
"$",
"this",
"->",
"getId",
"(",
")",
")",
";",
"$",
"bin",
"=",
"file... | posts media file
@param string $path Local path of media file
@param string $mime_type file mime-type | [
"posts",
"media",
"file"
] | 945217ce4562c87d2663d2a55c8603f77ff37dec | https://github.com/2600hz/kazoo-php-sdk/blob/945217ce4562c87d2663d2a55c8603f77ff37dec/lib/hz2600/Kazoo/Api/Entity/Media.php#L12-L19 |
44,790 | 2600hz/kazoo-php-sdk | lib/hz2600/Kazoo/Api/Entity/User.php | User.cdrs | public function cdrs(array $filter = array()) {
$this->setTokenValue($this->getEntityIdName(), $this->getId());
$collection_name = '\\Kazoo\\Api\\Collection\\Cdrs';
return new $collection_name($this, array($filter));
} | php | public function cdrs(array $filter = array()) {
$this->setTokenValue($this->getEntityIdName(), $this->getId());
$collection_name = '\\Kazoo\\Api\\Collection\\Cdrs';
return new $collection_name($this, array($filter));
} | [
"public",
"function",
"cdrs",
"(",
"array",
"$",
"filter",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setTokenValue",
"(",
"$",
"this",
"->",
"getEntityIdName",
"(",
")",
",",
"$",
"this",
"->",
"getId",
"(",
")",
")",
";",
"$",
"collect... | Get a collection of CDRs owned by this user. This API comes from cb_cdrs.
@param array $filter Key-value pairs to filter for in the returned
collection.
@param \Kazoo\Api\Collection\Cdrs The filtered collection of CDRs for
this user. | [
"Get",
"a",
"collection",
"of",
"CDRs",
"owned",
"by",
"this",
"user",
".",
"This",
"API",
"comes",
"from",
"cb_cdrs",
"."
] | 945217ce4562c87d2663d2a55c8603f77ff37dec | https://github.com/2600hz/kazoo-php-sdk/blob/945217ce4562c87d2663d2a55c8603f77ff37dec/lib/hz2600/Kazoo/Api/Entity/User.php#L18-L23 |
44,791 | 2600hz/kazoo-php-sdk | lib/hz2600/Kazoo/Api/Entity/User.php | User.channels | public function channels(array $filter = array()) {
$this->setTokenValue($this->getEntityIdName(), $this->getId());
$collection_name = '\\Kazoo\\Api\\Collection\\Channels';
return new $collection_name($this, array($filter));
} | php | public function channels(array $filter = array()) {
$this->setTokenValue($this->getEntityIdName(), $this->getId());
$collection_name = '\\Kazoo\\Api\\Collection\\Channels';
return new $collection_name($this, array($filter));
} | [
"public",
"function",
"channels",
"(",
"array",
"$",
"filter",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setTokenValue",
"(",
"$",
"this",
"->",
"getEntityIdName",
"(",
")",
",",
"$",
"this",
"->",
"getId",
"(",
")",
")",
";",
"$",
"col... | Get a collection of channels that are active for this user.
@param array $filter Key-value pairs to filter for in the returned
collection.
@return \Kazoo\Api\Collection\Channels The filtered collection of
channels for this user. | [
"Get",
"a",
"collection",
"of",
"channels",
"that",
"are",
"active",
"for",
"this",
"user",
"."
] | 945217ce4562c87d2663d2a55c8603f77ff37dec | https://github.com/2600hz/kazoo-php-sdk/blob/945217ce4562c87d2663d2a55c8603f77ff37dec/lib/hz2600/Kazoo/Api/Entity/User.php#L34-L39 |
44,792 | ezsystems/ezfind | classes/ezfmodulefunctioncollection.php | ezfModuleFunctionCollection.getFacetParameters | public function getFacetParameters()
{
$facetArray = array();
foreach ( $_GET as $name => $value )
{
if ( strpos( $name, 'facet_' ) === 0 )
{
$facetArray[substr( $name, 6 )] = $value;
}
}
return array( 'result' => array( $facetArray ) );
} | php | public function getFacetParameters()
{
$facetArray = array();
foreach ( $_GET as $name => $value )
{
if ( strpos( $name, 'facet_' ) === 0 )
{
$facetArray[substr( $name, 6 )] = $value;
}
}
return array( 'result' => array( $facetArray ) );
} | [
"public",
"function",
"getFacetParameters",
"(",
")",
"{",
"$",
"facetArray",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"_GET",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"name",
",",
"'facet_'",
")",
"=... | Get HTTP get facet parameters
@return array HTTP GET facet parameters, as described in the facets
design document | [
"Get",
"HTTP",
"get",
"facet",
"parameters"
] | b11eac0cee490826d5a55ec9e5642cb156b1a8ec | https://github.com/ezsystems/ezfind/blob/b11eac0cee490826d5a55ec9e5642cb156b1a8ec/classes/ezfmodulefunctioncollection.php#L27-L39 |
44,793 | ezsystems/ezfind | classes/extendedattributefilters/ezfindgeodistextendedattributefilter.php | eZFindGeoDistExtendedAttributeFilter.filterQueryParams | public function filterQueryParams( array $queryParams, array $filterParams )
{
try
{
if( !isset( $filterParams['field'] ) )
{
throw new Exception( 'Missing filter parameter "field"' );
}
if( !isset( $filterParams['latitude'] ) )
{
throw new Exception( 'Missing filter parameter "latitude"' );
}
if( !isset( $filterParams['longitude'] ) )
{
throw new Exception( 'Missing filter parameter "longitude"' );
}
$fieldName = eZSolr::getFieldName( $filterParams['field'] );
//geodist custom parameters
$queryParams['sfield'] = $fieldName;
$queryParams['pt'] = $filterParams['latitude'] . ',' . $filterParams['longitude'];
//sort by geodist
$queryParams['sort'] = 'geodist() asc,' . $queryParams['sort'];
//exclude unlocated documents
$queryParams['fq'][] = $fieldName.':[-90,-90 TO 90,90]';
}
catch( Exception $e )
{
eZDebug::writeWarning( $e->getMessage(), __CLASS__ );
}
return $queryParams;
} | php | public function filterQueryParams( array $queryParams, array $filterParams )
{
try
{
if( !isset( $filterParams['field'] ) )
{
throw new Exception( 'Missing filter parameter "field"' );
}
if( !isset( $filterParams['latitude'] ) )
{
throw new Exception( 'Missing filter parameter "latitude"' );
}
if( !isset( $filterParams['longitude'] ) )
{
throw new Exception( 'Missing filter parameter "longitude"' );
}
$fieldName = eZSolr::getFieldName( $filterParams['field'] );
//geodist custom parameters
$queryParams['sfield'] = $fieldName;
$queryParams['pt'] = $filterParams['latitude'] . ',' . $filterParams['longitude'];
//sort by geodist
$queryParams['sort'] = 'geodist() asc,' . $queryParams['sort'];
//exclude unlocated documents
$queryParams['fq'][] = $fieldName.':[-90,-90 TO 90,90]';
}
catch( Exception $e )
{
eZDebug::writeWarning( $e->getMessage(), __CLASS__ );
}
return $queryParams;
} | [
"public",
"function",
"filterQueryParams",
"(",
"array",
"$",
"queryParams",
",",
"array",
"$",
"filterParams",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"filterParams",
"[",
"'field'",
"]",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",... | Modifies SolR query params according to filter parameters
@param array $queryParams
@param array $filterParams
@return array $queryParams | [
"Modifies",
"SolR",
"query",
"params",
"according",
"to",
"filter",
"parameters"
] | b11eac0cee490826d5a55ec9e5642cb156b1a8ec | https://github.com/ezsystems/ezfind/blob/b11eac0cee490826d5a55ec9e5642cb156b1a8ec/classes/extendedattributefilters/ezfindgeodistextendedattributefilter.php#L37-L74 |
44,794 | ezsystems/ezfind | classes/ezsolrbase.php | eZSolrBase.postQuery | protected function postQuery( $request, $postData, $contentType = self::DEFAULT_REQUEST_CONTENTTYPE )
{
$url = $this->SearchServerURI . $request;
return $this->sendHTTPRequestRetry( $url, $postData, $contentType );
} | php | protected function postQuery( $request, $postData, $contentType = self::DEFAULT_REQUEST_CONTENTTYPE )
{
$url = $this->SearchServerURI . $request;
return $this->sendHTTPRequestRetry( $url, $postData, $contentType );
} | [
"protected",
"function",
"postQuery",
"(",
"$",
"request",
",",
"$",
"postData",
",",
"$",
"contentType",
"=",
"self",
"::",
"DEFAULT_REQUEST_CONTENTTYPE",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"SearchServerURI",
".",
"$",
"request",
";",
"return",
... | Send HTTP Post query to the Solr engine
@param string $request request name (examples: /select, /update, ...)
@param string $postData post data
@param string $languageCodes A language code string
@param string $contentType POST content type
@return string Result of HTTP Request ( without HTTP headers ) | [
"Send",
"HTTP",
"Post",
"query",
"to",
"the",
"Solr",
"engine"
] | b11eac0cee490826d5a55ec9e5642cb156b1a8ec | https://github.com/ezsystems/ezfind/blob/b11eac0cee490826d5a55ec9e5642cb156b1a8ec/classes/ezsolrbase.php#L125-L129 |
44,795 | ezsystems/ezfind | classes/ezsolrbase.php | eZSolrBase.validateUpdateResult | static function validateUpdateResult ( $updateResult )
{
if ( empty( $updateResult ) )
{
eZDebug::writeError( 'Empty response received from Solr', 'eZ Find' );
return false;
}
$dom = new DOMDocument( '1.0' );
// Supresses error messages
$status = $dom->loadXML( $updateResult, LIBXML_NOWARNING | LIBXML_NOERROR );
if ( !$status )
{
eZDebug::writeError( 'Invalid XML received from Solr: '.$updateResult, 'eZ Find' );
return false;
}
$intElements = $dom->getElementsByTagName( 'int' );
if ( $intElements->length < 1 )
{
eZDebug::writeError( 'Invalid response from Solr: '.$updateResult, 'eZ Find' );
return false;
}
foreach ( $intElements as $intNode )
{
foreach ( $intNode->attributes as $attribute )
{
if ( ( $attribute->name === 'name' ) and ( $attribute->value === 'status' ) )
{
//Then we have found the correct node
return ( $intNode->nodeValue === "0" );
}
}
}
eZDebug::writeError( 'Invalid response from Solr: '.$updateResult, 'eZ Find' );
return false;
} | php | static function validateUpdateResult ( $updateResult )
{
if ( empty( $updateResult ) )
{
eZDebug::writeError( 'Empty response received from Solr', 'eZ Find' );
return false;
}
$dom = new DOMDocument( '1.0' );
// Supresses error messages
$status = $dom->loadXML( $updateResult, LIBXML_NOWARNING | LIBXML_NOERROR );
if ( !$status )
{
eZDebug::writeError( 'Invalid XML received from Solr: '.$updateResult, 'eZ Find' );
return false;
}
$intElements = $dom->getElementsByTagName( 'int' );
if ( $intElements->length < 1 )
{
eZDebug::writeError( 'Invalid response from Solr: '.$updateResult, 'eZ Find' );
return false;
}
foreach ( $intElements as $intNode )
{
foreach ( $intNode->attributes as $attribute )
{
if ( ( $attribute->name === 'name' ) and ( $attribute->value === 'status' ) )
{
//Then we have found the correct node
return ( $intNode->nodeValue === "0" );
}
}
}
eZDebug::writeError( 'Invalid response from Solr: '.$updateResult, 'eZ Find' );
return false;
} | [
"static",
"function",
"validateUpdateResult",
"(",
"$",
"updateResult",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"updateResult",
")",
")",
"{",
"eZDebug",
"::",
"writeError",
"(",
"'Empty response received from Solr'",
",",
"'eZ Find'",
")",
";",
"return",
"false... | Function to validate the update result returned by solr
A valid solr update reply contains the following document:
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">3</int>
</lst>
<strname="WARNING">This response format is experimental. It is likely to change in the future.</str>
</response>
Function will check if solrResult document contains "<int name="status">0</int>" | [
"Function",
"to",
"validate",
"the",
"update",
"result",
"returned",
"by",
"solr"
] | b11eac0cee490826d5a55ec9e5642cb156b1a8ec | https://github.com/ezsystems/ezfind/blob/b11eac0cee490826d5a55ec9e5642cb156b1a8ec/classes/ezsolrbase.php#L254-L292 |
44,796 | ezsystems/ezfind | classes/ezsolrbase.php | eZSolrBase.deleteDocs | function deleteDocs ( $docIDs = array(), $query = false, $commit = true, $optimize = false, $commitWithin = 0 )
{
$postString = '<delete>';
if ( is_numeric( $commitWithin ) && $commitWithin > 0 )
{
$postString = '<delete commitWithin="' . $commitWithin . '">';
}
if ( empty( $query ) )
{
foreach ( $docIDs as $docID )
{
$postString .= '<id>' . $docID . '</id>';
}
}
else
{
$postString .= '<query>' . $query . '</query>';
}
$postString .= '</delete>';
$updateXML = $this->postQuery ( '/update', $postString, 'text/xml' );
if ( $optimize )
{
$this->optimize( $commit );
}
elseif ( $commit )
{
$this->commit();
}
return self::validateUpdateResult( $updateXML );
} | php | function deleteDocs ( $docIDs = array(), $query = false, $commit = true, $optimize = false, $commitWithin = 0 )
{
$postString = '<delete>';
if ( is_numeric( $commitWithin ) && $commitWithin > 0 )
{
$postString = '<delete commitWithin="' . $commitWithin . '">';
}
if ( empty( $query ) )
{
foreach ( $docIDs as $docID )
{
$postString .= '<id>' . $docID . '</id>';
}
}
else
{
$postString .= '<query>' . $query . '</query>';
}
$postString .= '</delete>';
$updateXML = $this->postQuery ( '/update', $postString, 'text/xml' );
if ( $optimize )
{
$this->optimize( $commit );
}
elseif ( $commit )
{
$this->commit();
}
return self::validateUpdateResult( $updateXML );
} | [
"function",
"deleteDocs",
"(",
"$",
"docIDs",
"=",
"array",
"(",
")",
",",
"$",
"query",
"=",
"false",
",",
"$",
"commit",
"=",
"true",
",",
"$",
"optimize",
"=",
"false",
",",
"$",
"commitWithin",
"=",
"0",
")",
"{",
"$",
"postString",
"=",
"'<del... | Removes an array of docID's from the Solr index
@param array $docsID List of document IDs to delete. If set to <empty>,
$query will be used to delete documents instead.
@param string $query Solr Query. This will be ignored if $docIDs is set.
@param bool $optimize set to true to perform a solr optimize after delete
@param integer $commitWithin specifies within how many milliseconds a commit should occur if no other commit
@return bool | [
"Removes",
"an",
"array",
"of",
"docID",
"s",
"from",
"the",
"Solr",
"index"
] | b11eac0cee490826d5a55ec9e5642cb156b1a8ec | https://github.com/ezsystems/ezfind/blob/b11eac0cee490826d5a55ec9e5642cb156b1a8ec/classes/ezsolrbase.php#L354-L386 |
44,797 | ezsystems/ezfind | classes/ezfindelevateconfiguration.php | eZFindElevateConfiguration.fetchConfigurationForObject | public static function fetchConfigurationForObject( $objectID,
$groupByLanguage = true,
$languageCode = null,
$limit = null,
$countOnly = false,
$searchQuery = null )
{
if ( ! is_numeric( $objectID ) )
return null;
$fieldFilters = $custom = null;
$asObject = true;
$results = array();
$sortClause = $groupByLanguage ? array( 'language_code' => 'asc' ) : null;
$conds = array( 'contentobject_id' => $objectID );
if ( $languageCode and $languageCode !== '' )
$conds['language_code'] = array( array( $languageCode, self::WILDCARD ) );
if ( $searchQuery )
{
if ( !is_array( $searchQuery ) and $searchQuery != '' )
{
$conds['search_query'] = $searchQuery;
}
elseif ( array_key_exists( 'searchQuery', $searchQuery ) and $searchQuery['searchQuery'] != '' )
{
$conds['search_query'] = $searchQuery['fuzzy'] === true ? array( 'like', "%{$searchQuery['searchQuery']}%" ) : $searchQuery['searchQuery'];
}
}
if ( $countOnly )
{
return parent::count( self::definition(), $conds );
}
else
{
$rows = parent::fetchObjectList( self::definition(), $fieldFilters, $conds, $sortClause, $limit, $asObject, false, $custom );
foreach ( $rows as $row )
{
if ( $groupByLanguage )
{
$results[$row->attribute( 'language_code' )][] = $row;
}
else
{
$results[] = $row;
}
}
return $results;
}
} | php | public static function fetchConfigurationForObject( $objectID,
$groupByLanguage = true,
$languageCode = null,
$limit = null,
$countOnly = false,
$searchQuery = null )
{
if ( ! is_numeric( $objectID ) )
return null;
$fieldFilters = $custom = null;
$asObject = true;
$results = array();
$sortClause = $groupByLanguage ? array( 'language_code' => 'asc' ) : null;
$conds = array( 'contentobject_id' => $objectID );
if ( $languageCode and $languageCode !== '' )
$conds['language_code'] = array( array( $languageCode, self::WILDCARD ) );
if ( $searchQuery )
{
if ( !is_array( $searchQuery ) and $searchQuery != '' )
{
$conds['search_query'] = $searchQuery;
}
elseif ( array_key_exists( 'searchQuery', $searchQuery ) and $searchQuery['searchQuery'] != '' )
{
$conds['search_query'] = $searchQuery['fuzzy'] === true ? array( 'like', "%{$searchQuery['searchQuery']}%" ) : $searchQuery['searchQuery'];
}
}
if ( $countOnly )
{
return parent::count( self::definition(), $conds );
}
else
{
$rows = parent::fetchObjectList( self::definition(), $fieldFilters, $conds, $sortClause, $limit, $asObject, false, $custom );
foreach ( $rows as $row )
{
if ( $groupByLanguage )
{
$results[$row->attribute( 'language_code' )][] = $row;
}
else
{
$results[] = $row;
}
}
return $results;
}
} | [
"public",
"static",
"function",
"fetchConfigurationForObject",
"(",
"$",
"objectID",
",",
"$",
"groupByLanguage",
"=",
"true",
",",
"$",
"languageCode",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"countOnly",
"=",
"false",
",",
"$",
"searchQuery"... | Retrieves the elevate configuration for a given content object, possibly per language.
@param int $objectID ID of the content object to fetch elevate configuration for
@param boolean $groupByLanguage Group results per language. If true, the return value will look like the following :
<code>
array( 'eng-GB' => array( ( eZFindElevateConfiguration ) $conf1,
( eZFindElevateConfiguration ) $conf2 ),
'fre-FR' => array( ( eZFindElevateConfiguration ) $conf3 ),
'*' => array( ( eZFindElevateConfiguration ) $conf4 ),
( eZFindElevateConfiguration ) $conf5
)
</code>
@param string $languageCode if filtering on language-code is required
@param array $limit Associative array containing the 'offset' and 'limit' keys, with integers as values, framing the result set. Example :
<code>
array( 'offset' => 0,
'limit' => 10 )
</code>
@param boolean $countOnly If only the count of matching results is needed
@param mixed $searchQuery Can be a string containing the search_query to filter on.
Can also be an array looking like the following, supporting fuzzy search optionnally.
<code>
array( 'searchQuery' => ( string ) 'foo bar',
'fuzzy' => ( boolean ) true )
</code>
@return mixed An array containing the eZFindElevateConfiguration objects, optionnally sorted by language code, null if error. | [
"Retrieves",
"the",
"elevate",
"configuration",
"for",
"a",
"given",
"content",
"object",
"possibly",
"per",
"language",
"."
] | b11eac0cee490826d5a55ec9e5642cb156b1a8ec | https://github.com/ezsystems/ezfind/blob/b11eac0cee490826d5a55ec9e5642cb156b1a8ec/classes/ezfindelevateconfiguration.php#L136-L187 |
44,798 | ezsystems/ezfind | classes/ezfindelevateconfiguration.php | eZFindElevateConfiguration.fetchObjectsForQueryString | public static function fetchObjectsForQueryString( $queryString, $groupByLanguage = true, $languageCode = null, $limit = null, $countOnly = false )
{
if ( ( is_string( $queryString ) and $queryString === '' ) or
( is_array( $queryString ) and array_key_exists( 'searchQuery', $queryString ) and $queryString['searchQuery'] == '' )
)
{
return null;
}
$fieldFilters = $custom = null;
$objects = array();
$conds = array();
$sortClause = $groupByLanguage ? array( 'language_code' => 'asc' ) : null;
if ( !is_array( $queryString ) )
{
$conds['search_query'] = $queryString;
}
else
{
$conds['search_query'] = @$queryString['fuzzy'] === true ? array( 'like', "%{$queryString['searchQuery']}%" ) : $queryString['searchQuery'];
}
if ( $languageCode and $languageCode !== '' )
$conds['language_code'] = array( array( $languageCode, self::WILDCARD ) );
if ( $countOnly )
{
return parent::count( self::definition(), $conds );
}
else
{
$rows = parent::fetchObjectList( self::definition(), $fieldFilters, $conds, $sortClause, $limit, false, false, $custom );
foreach ( $rows as $row )
{
if ( ( $obj = eZContentObject::fetch( $row['contentobject_id'] ) ) !== null )
{
if ( $groupByLanguage )
{
$objects[$row['language_code']][] = $obj;
}
else
{
$objects[] = $obj;
}
}
}
return $objects;
}
} | php | public static function fetchObjectsForQueryString( $queryString, $groupByLanguage = true, $languageCode = null, $limit = null, $countOnly = false )
{
if ( ( is_string( $queryString ) and $queryString === '' ) or
( is_array( $queryString ) and array_key_exists( 'searchQuery', $queryString ) and $queryString['searchQuery'] == '' )
)
{
return null;
}
$fieldFilters = $custom = null;
$objects = array();
$conds = array();
$sortClause = $groupByLanguage ? array( 'language_code' => 'asc' ) : null;
if ( !is_array( $queryString ) )
{
$conds['search_query'] = $queryString;
}
else
{
$conds['search_query'] = @$queryString['fuzzy'] === true ? array( 'like', "%{$queryString['searchQuery']}%" ) : $queryString['searchQuery'];
}
if ( $languageCode and $languageCode !== '' )
$conds['language_code'] = array( array( $languageCode, self::WILDCARD ) );
if ( $countOnly )
{
return parent::count( self::definition(), $conds );
}
else
{
$rows = parent::fetchObjectList( self::definition(), $fieldFilters, $conds, $sortClause, $limit, false, false, $custom );
foreach ( $rows as $row )
{
if ( ( $obj = eZContentObject::fetch( $row['contentobject_id'] ) ) !== null )
{
if ( $groupByLanguage )
{
$objects[$row['language_code']][] = $obj;
}
else
{
$objects[] = $obj;
}
}
}
return $objects;
}
} | [
"public",
"static",
"function",
"fetchObjectsForQueryString",
"(",
"$",
"queryString",
",",
"$",
"groupByLanguage",
"=",
"true",
",",
"$",
"languageCode",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"countOnly",
"=",
"false",
")",
"{",
"if",
"("... | Retrieves the content objects elevated by a given query string, possibly per language.
@param mixed $searchQuery Can be a string containing the search_query to filter on.
Can also be an array looking like the following, supporting fuzzy search optionnally.
<code>
array( 'searchQuery' => ( string ) 'foo bar',
'fuzzy' => ( boolean ) true )
</code>
@param string $languageCode if filtering on language-code is required
@param array $limit Associative array containing the 'offset' and 'limit' keys, with integers as values, framing the result set. Example :
<code>
array( 'offset' => 0,
'limit' => 10 )
</code>
@param boolean $countOnly If only the count of matching results is needed
@return mixed An array containing the content objects elevated by the query string, optionnally sorted by language code, null if error. If $countOnly is true,
only the result count is returned. | [
"Retrieves",
"the",
"content",
"objects",
"elevated",
"by",
"a",
"given",
"query",
"string",
"possibly",
"per",
"language",
"."
] | b11eac0cee490826d5a55ec9e5642cb156b1a8ec | https://github.com/ezsystems/ezfind/blob/b11eac0cee490826d5a55ec9e5642cb156b1a8ec/classes/ezfindelevateconfiguration.php#L210-L259 |
44,799 | ezsystems/ezfind | classes/ezfindelevateconfiguration.php | eZFindElevateConfiguration.add | public static function add( $queryString, $objectID, $languageCode = self::WILDCARD )
{
$db = eZDB::instance();
$queryString = $db->escapeString( $queryString );
if ( $languageCode === self::WILDCARD )
{
self::purge( $queryString, $objectID );
}
else
{
// trying to insert an elevate configuration row for a specific language, while one already exists for all languages.
if ( parent::fetchObject( self::definition(), null, array( 'contentobject_id' => $objectID, 'search_query' => $queryString, 'language_code' => self::WILDCARD ) ) )
return null;
}
$row = array( 'search_query' => $queryString,
'contentobject_id' => $objectID,
'language_code' => $languageCode );
$conf = new eZFindElevateConfiguration( $row );
$conf->store();
return $conf;
} | php | public static function add( $queryString, $objectID, $languageCode = self::WILDCARD )
{
$db = eZDB::instance();
$queryString = $db->escapeString( $queryString );
if ( $languageCode === self::WILDCARD )
{
self::purge( $queryString, $objectID );
}
else
{
// trying to insert an elevate configuration row for a specific language, while one already exists for all languages.
if ( parent::fetchObject( self::definition(), null, array( 'contentobject_id' => $objectID, 'search_query' => $queryString, 'language_code' => self::WILDCARD ) ) )
return null;
}
$row = array( 'search_query' => $queryString,
'contentobject_id' => $objectID,
'language_code' => $languageCode );
$conf = new eZFindElevateConfiguration( $row );
$conf->store();
return $conf;
} | [
"public",
"static",
"function",
"add",
"(",
"$",
"queryString",
",",
"$",
"objectID",
",",
"$",
"languageCode",
"=",
"self",
"::",
"WILDCARD",
")",
"{",
"$",
"db",
"=",
"eZDB",
"::",
"instance",
"(",
")",
";",
"$",
"queryString",
"=",
"$",
"db",
"->"... | Adds an elevate configuration row, optionnally for a given language.
@param string $queryString Query string for which elevate configuration is added
@param int $objectID Content object for which the elevate configuration is added
@param string $languageCode Language code for which the elevate configuration is added. Defaults to 'all languages' | [
"Adds",
"an",
"elevate",
"configuration",
"row",
"optionnally",
"for",
"a",
"given",
"language",
"."
] | b11eac0cee490826d5a55ec9e5642cb156b1a8ec | https://github.com/ezsystems/ezfind/blob/b11eac0cee490826d5a55ec9e5642cb156b1a8ec/classes/ezfindelevateconfiguration.php#L269-L292 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.