_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q12000 | Generator._ignoreKeyAlias | train | private static function _ignoreKeyAlias(array $t, Tag &$Tag)
{
extract($t);
$single = self::getSingleAttrKey($Tag);
if (isset(TagInfo::$ignoreAlisasesOnSingle[$single])
&& in_array($alias, TagInfo::$ignoreAlisasesOnSingle[$single])
) {
return true;
}
... | php | {
"resource": ""
} |
q12001 | Generator.getSingleAttrKey | train | public static function getSingleAttrKey(Tag &$Tag)
{
if (isset(TagInfo::$singleAttrKeys[$Tag->name])) {
return TagInfo::$singleAttrKeys[$Tag->name];
} else {
return TagInfo::$defaultSingleAttrKey;
}
} | php | {
"resource": ""
} |
q12002 | XmlStreamWriter.writeStartElement | train | public function writeStartElement(string $elementName): self
{
$this->doWriteStartElement($elementName);
$this->depth++;
return $this;
} | php | {
"resource": ""
} |
q12003 | XmlStreamWriter.writeEndElement | train | public function writeEndElement(): self
{
if ($this->isFinished()) {
throw new \LogicException('Can not write end elements, no element open.');
}
$this->doWriteEndElement();
$this->depth--;
return $this;
} | php | {
"resource": ""
} |
q12004 | Cleaner.getClean | train | public static function getClean($str)
{
if (is_object($str) && get_class($str) == 'Xiphe\HTML\core\Tag') {
$Tag = $str;
$str = $Tag->content;
}
switch (Config::get('cleanMode')) {
case 'strong':
$str = self::getStrong($str);
break;
... | php | {
"resource": ""
} |
q12005 | Cleaner.getBasic | train | public static function getBasic($str)
{
$r = '';
/*
* Split the string by line breakes.
*/
foreach (preg_split('/\n\r|\n|\r/', $str, -1, PREG_SPLIT_NO_EMPTY) as $k => $line) {
/*
* And append it with tabs and line breaks to the return var.
... | php | {
"resource": ""
} |
q12006 | Cleaner.parseAttrs | train | public static function parseAttrs($attr)
{
/*
* Skip empty strings
*/
if (trim($attr) == '') {
return '';
}
/*
* Match all attribute like parts from string.
*/
preg_match_all('/[a-zA-Z0-9-_:.]+(\s?=\s?("|\')[^\2]*\2|\s)/U', $at... | php | {
"resource": ""
} |
q12007 | Cleaner.getStrong | train | public static function getStrong($str)
{
/*
* Split the content by html tags.
*/
$tree = preg_split(
'/(<[^!]?[^>]+>(<![^>]+>)?)/',
$str,
-1,
PREG_SPLIT_OFFSET_CAPTURE | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY
);
... | php | {
"resource": ""
} |
q12008 | Cleaner._getTreeElm | train | private static function _getTreeElm($str, &$info)
{
/*
* Normalize the string.
*/
$str = preg_replace('/(\n\r|\n|\r|\s)+/', ' ', $str);
/*
* Identify it by checking its first symbols.
*/
if (strpos($str, '</') === 0) {
return 'end';
... | php | {
"resource": ""
} |
q12009 | XslProcessorProvider.callbacks | train | protected function callbacks(): array
{
if (!is_array($this->callbackList)) {
if (!file_exists($this->configPath . '/xsl-callbacks.ini')) {
$this->callbackList = [];
} else {
$this->callbackList = @parse_ini_file($this->configPath . '/xsl-callbacks.ini... | php | {
"resource": ""
} |
q12010 | BasicModule.init | train | final public function init(&$args, &$options, &$called)
{
$this->args = &$args;
$this->options = &$options;
$this->called = &$called;
/*
* Execute Module generated Hook if Wordpress is available.
*/
if (class_exists('\WP')) {
call_user_func_arra... | php | {
"resource": ""
} |
q12011 | BasicModule.generate | train | final public function generate() {
$options = array_merge($this->options, (array) 'generate');
Generator::call($this->called, $this->args, $options);
} | php | {
"resource": ""
} |
q12012 | WSClientDataCollector.onWSClientCommand | train | public function onWSClientCommand(WSEventDispatcher\WSClientEvent $event)
{
//$command = $event->getCommand();
//$arguments = $event->getArguments();
$this->data['commands'][] = array(
'command' => $event->getCommand(),
'arguments' => $event->getArguments(),
... | php | {
"resource": ""
} |
q12013 | XmlSerializer.serialize | train | public function serialize(
$value,
XmlStreamWriter $xmlWriter,
string $tagName = null,
string $elementTagName = null
): XmlStreamWriter {
switch (gettype($value)) {
case 'NULL':
$this->serializeNull($xmlWriter, $tagName);
... | php | {
"resource": ""
} |
q12014 | XmlSerializer.serializeNull | train | public function serializeNull(XmlStreamWriter $xmlWriter, string $tagName = null): XmlStreamWriter
{
return $xmlWriter->writeStartElement(null === $tagName ? 'null' : $tagName)
->writeElement('null')
->writeEndElement();
} | php | {
"resource": ""
} |
q12015 | XmlSerializer.serializeBool | train | public function serializeBool($value, XmlStreamWriter $xmlWriter, string $tagName = null): XmlStreamWriter
{
return $this->serializeScalarValue(
$this->convertBoolToString($value),
$xmlWriter,
null === $tagName ? 'boolean' : $tagName
);
} | php | {
"resource": ""
} |
q12016 | XmlSerializer.serializeFloat | train | public function serializeFloat($value, XmlStreamWriter $xmlWriter, string $tagName = null): XmlStreamWriter
{
return $this->serializeScalarValue($value, $xmlWriter, $tagName);
} | php | {
"resource": ""
} |
q12017 | XmlSerializer.serializeScalarValue | train | protected function serializeScalarValue($value, XmlStreamWriter $xmlWriter, string $tagName = null): XmlStreamWriter
{
return $xmlWriter->writeStartElement(null === $tagName ? gettype($value) : $tagName)
->writeText(strval($value))
->writeEndElement();
} | php | {
"resource": ""
} |
q12018 | XmlSerializer.serializeArray | train | public function serializeArray(
$array,
XmlStreamWriter $xmlWriter,
string $tagName = null,
string $elementTagName = null
): XmlStreamWriter {
if (null === $tagName) {
$tagName = 'array';
}
if (!empty($tagName)) {
$xmlW... | php | {
"resource": ""
} |
q12019 | XmlSerializer.serializeObject | train | public function serializeObject($object, XmlStreamWriter $xmlWriter, string $tagName = null): XmlStreamWriter
{
$this->serializerFor($object)->serialize($object, $this, $xmlWriter, $tagName);
return $xmlWriter;
} | php | {
"resource": ""
} |
q12020 | XmlSerializer.serializerFor | train | protected function serializerFor($object): ObjectXmlSerializer
{
if (!annotationsOf($object)->contain('XmlSerializer')) {
return AnnotationBasedObjectXmlSerializer::fromObject($object);
}
return $this->injector->getInstance(
annotationsOf($object)
... | php | {
"resource": ""
} |
q12021 | XslProcessor.onXmlFile | train | public function onXmlFile(string $xmlFile, bool $xinclude = true): self
{
$doc = new \DOMDocument();
if (false === @$doc->load($xmlFile)) {
throw new XslProcessorException(
'Can not read xml document file ' . $xmlFile
);
}
if (true === $xi... | php | {
"resource": ""
} |
q12022 | XslProcessor.applyStylesheet | train | public function applyStylesheet(\DOMDocument $stylesheet): self
{
$this->stylesheets[] = $stylesheet;
$this->xsltProcessor->importStylesheet($stylesheet);
return $this;
} | php | {
"resource": ""
} |
q12023 | XslProcessor.applyStylesheetFromFile | train | public function applyStylesheetFromFile(string $stylesheetFile): self
{
$stylesheet = new \DOMDocument();
if (false === @$stylesheet->load($stylesheetFile)) {
throw new XslProcessorException('Can not read stylesheet file ' . $stylesheetFile);
}
return $this->applyStylesh... | php | {
"resource": ""
} |
q12024 | XslProcessor.usingCallback | train | public function usingCallback(string $name, $instance): self
{
$this->xslCallbacks->addCallback($name, $instance);
return $this;
} | php | {
"resource": ""
} |
q12025 | XslProcessor.registerCallbacks | train | protected function registerCallbacks()
{
self::$_callbacks = $this->xslCallbacks;
$this->xsltProcessor->registerPHPFunctions(get_class($this) . '::invokeCallback');
} | php | {
"resource": ""
} |
q12026 | XslProcessor.withParameter | train | public function withParameter(string $nameSpace, string $paramName, string $paramValue): self
{
if (false === $this->xsltProcessor->setParameter($nameSpace, $paramName, $paramValue)) {
throw new XslProcessorException(
'Could not set parameter ' . $nameSpace . ':' . $paramName... | php | {
"resource": ""
} |
q12027 | XslProcessor.withParameters | train | public function withParameters(string $nameSpace, array $params): self
{
if (false === $this->xsltProcessor->setParameter($nameSpace, $params)) {
throw new XslProcessorException('Could not set parameters in ' . $nameSpace);
}
if (!isset($this->parameters[$nameSpace])) {
... | php | {
"resource": ""
} |
q12028 | XslProcessor.toDoc | train | public function toDoc(): \DOMDocument
{
if (null === $this->document) {
throw new XslProcessorException(
'Can not transform, set document or xml file to transform first'
);
}
$this->registerCallbacks();
$result = $this->xsltProcessor->tran... | php | {
"resource": ""
} |
q12029 | XslProcessor.toUri | train | public function toUri(string $uri): int
{
if (null === $this->document) {
throw new XslProcessorException(
'Can not transform, set document or xml file to transform first'
);
}
$this->registerCallbacks();
$bytes = $this->xsltProcessor->tra... | php | {
"resource": ""
} |
q12030 | XslProcessor.toXml | train | public function toXml(): string
{
if (null === $this->document) {
throw new XslProcessorException(
'Can not transform, set document or xml file to transform first'
);
}
$this->registerCallbacks();
$result = $this->xsltProcessor->transformT... | php | {
"resource": ""
} |
q12031 | XslProcessor.createMessage | train | private function createMessage(): string
{
$message = '';
foreach (libxml_get_errors() as $error) {
$message .= trim($error->message) . (($error->file) ? (' in file ' . $error->file) : ('')) . ' on line ' . $error->line . ' in column ' . $error->column . "\n";
}
libxml_c... | php | {
"resource": ""
} |
q12032 | XmlStreamWriterProvider.createStreamWriter | train | protected function createStreamWriter(string $xmlExtension): XmlStreamWriter
{
$className = $this->types[$xmlExtension];
return new $className($this->version, $this->encoding);
} | php | {
"resource": ""
} |
q12033 | XmlStreamWriterProvider.createAsAvailable | train | protected function createAsAvailable(): XmlStreamWriter
{
foreach (array_keys($this->types) as $xmlExtension) {
if (extension_loaded($xmlExtension)) {
return $this->createStreamWriter($xmlExtension);
}
}
throw new XmlException(
'No sup... | php | {
"resource": ""
} |
q12034 | Db.asManyToMany | train | public function asManyToMany($alias, $junction, $column, $table, $pk, $columns = '*')
{
$this->relationProcessor->queue(__FUNCTION__, func_get_args());
return $this;
} | php | {
"resource": ""
} |
q12035 | Db.asOneToOne | train | public function asOneToOne($column, $alias, $table, $link)
{
$this->relationProcessor->queue(__FUNCTION__, func_get_args());
return $this;
} | php | {
"resource": ""
} |
q12036 | Db.asOneToMany | train | public function asOneToMany($table, $pk, $alias)
{
$this->relationProcessor->queue(__FUNCTION__, func_get_args());
return $this;
} | php | {
"resource": ""
} |
q12037 | Db.asData | train | private function asData(array $data)
{
foreach ($data as $key => $value) {
if ($value instanceof RawSqlFragmentInterface) {
$data[$key] = $value->getFragment();
} elseif ($value instanceof RawBindingInterface) {
$data[$key] = $value->getTarget();
... | php | {
"resource": ""
} |
q12038 | Db.createUniqPlaceholder | train | private function createUniqPlaceholder($key)
{
if ($key instanceof RawSqlFragment) {
$placeholder = $key->getFragment();
} else if ($key instanceof RawBindingInterface) {
$placeholder = $key->getTarget();
} else {
// Create unique placeholder
$... | php | {
"resource": ""
} |
q12039 | Db.getCount | train | private function getCount($column)
{
$alias = 'count';
// Save initial state
$original = clone $this->queryBuilder;
$bindings = $this->bindings;
// Set guessed query and execute it
$this->queryBuilder->setQueryString($this->queryBuilder->guessCountQuery($column, $al... | php | {
"resource": ""
} |
q12040 | Db.fetchAllTables | train | public function fetchAllTables()
{
$tables = array();
$result = $this->pdo->query('SHOW TABLES')->fetchAll();
foreach ($result as $index => $array) {
// Extract a value - we don't care about a key
$data = array_values($array);
// Its ready not, just appen... | php | {
"resource": ""
} |
q12041 | Db.dump | train | public function dump(array $tables = array())
{
$result = null;
if (empty($tables)) {
$tables = $this->fetchAllTables();
}
// Building logic
foreach ($tables as $table) {
// Main SELECT query
$select = $this->queryBuilder->clear()
... | php | {
"resource": ""
} |
q12042 | Db.paginateRaw | train | public function paginateRaw($count, $page, $itemsPerPage)
{
$this->paginator->tweak($count, $itemsPerPage, $page);
$this->limit($this->paginator->countOffset(), $this->paginator->getItemsPerPage());
return $this;
} | php | {
"resource": ""
} |
q12043 | Db.paginate | train | public function paginate($page, $itemsPerPage, $column = '1')
{
$count = $this->getCount($column);
if ($this->isDriver('mysql') || $this->isDriver('sqlite')) {
// Alter paginator's state
$this->paginateRaw($count, $page, $itemsPerPage);
} else {
throw new... | php | {
"resource": ""
} |
q12044 | Db.getPrimaryKey | train | public function getPrimaryKey($table)
{
$db = $this->showKeys()->from($table)
->whereEquals('Key_name', new RawBinding('PRIMARY'));
return $db->query('Column_name');
} | php | {
"resource": ""
} |
q12045 | Db.raw | train | public function raw($query, array $bindings = array())
{
if (!empty($bindings)) {
foreach ($bindings as $column => $value) {
$this->bind($column, $value);
}
}
$this->queryBuilder->raw($query);
return $this;
} | php | {
"resource": ""
} |
q12046 | Db.getStmt | train | public function getStmt()
{
// Make sure there are no nested arrays
if (ArrayUtils::hasAtLeastOneArrayValue($this->bindings)) {
throw new RuntimeException('PDO bindings can not contain nested arrays');
}
// Build target query before bindings are cleared purely for loggin... | php | {
"resource": ""
} |
q12047 | Db.queryAll | train | public function queryAll($column = null, $mode = null)
{
if (is_null($mode)) {
$mode = $this->pdo->getAttribute(PDO::ATTR_DEFAULT_FETCH_MODE);
}
$result = array();
$rows = $this->getStmt()->fetchAll($mode);
if ($column == null) {
$result = $rows;
... | php | {
"resource": ""
} |
q12048 | Db.query | train | public function query($column = null, $mode = null)
{
if (is_null($mode)) {
$mode = $this->pdo->getAttribute(PDO::ATTR_DEFAULT_FETCH_MODE);
}
$result = array();
$rows = $this->getStmt()->fetch($mode);
if ($column !== null) {
if (isset($rows[$column])... | php | {
"resource": ""
} |
q12049 | Db.queryScalar | train | public function queryScalar($mode = null)
{
$result = $this->query(null, $mode);
if (is_array($result)) {
// Filter by values
$result = array_values($result);
return isset($result[0]) ? $result[0] : false;
}
return false;
} | php | {
"resource": ""
} |
q12050 | Db.increment | train | public function increment($table, $column, $step = 1)
{
$this->queryBuilder->increment($table, $column, $step);
return $this;
} | php | {
"resource": ""
} |
q12051 | Db.decrement | train | public function decrement($table, $column, $step = 1)
{
$this->queryBuilder->decrement($table, $column, $step);
return $this;
} | php | {
"resource": ""
} |
q12052 | Db.equals | train | public function equals($column, $value, $filter = false)
{
return $this->compare($column, '=', $value, $filter);
} | php | {
"resource": ""
} |
q12053 | Db.notEquals | train | public function notEquals($column, $value, $filter = false)
{
return $this->compare($column, '!=', $value, $filter);
} | php | {
"resource": ""
} |
q12054 | Db.like | train | public function like($column, $value, $filter = false)
{
return $this->compare($column, 'LIKE', $value, $filter);
} | php | {
"resource": ""
} |
q12055 | Db.notLike | train | public function notLike($column, $value, $filter = false)
{
return $this->compare($column, 'NOT LIKE', $value, $filter);
} | php | {
"resource": ""
} |
q12056 | Db.greaterThan | train | public function greaterThan($column, $value, $filter = false)
{
return $this->compare($column, '>', $value, $filter);
} | php | {
"resource": ""
} |
q12057 | Db.lessThan | train | public function lessThan($column, $value, $filter = false)
{
return $this->compare($column, '<', $value, $filter);
} | php | {
"resource": ""
} |
q12058 | Db.orWhereBetween | train | public function orWhereBetween($column, $a, $b, $filter = false)
{
return $this->between(__FUNCTION__, $column, $a, $b, $filter);
} | php | {
"resource": ""
} |
q12059 | Db.between | train | private function between($method, $column, $a, $b, $filter)
{
if (!$this->queryBuilder->isFilterable($filter, array($a, $b))) {
return $this;
}
if ($a instanceof RawSqlFragmentInterface) {
$x = $a->getFragment();
}
if ($b instanceof RawSqlFragmentInt... | php | {
"resource": ""
} |
q12060 | Db.constraint | train | private function constraint($method, $column, $operator, $value, $filter)
{
if (!$this->queryBuilder->isFilterable($filter, $value)) {
return $this;
}
call_user_func(array($this->queryBuilder, $method), $column, $operator, $this->createUniqPlaceholder($value));
return $t... | php | {
"resource": ""
} |
q12061 | Db.whereInValues | train | private function whereInValues($method, $column, $values, $filter)
{
if (!$this->queryBuilder->isFilterable($filter, $values)) {
return $this;
}
if ($values instanceof RawBindingInterface) {
call_user_func(array($this->queryBuilder, $method), $column, $values->getTar... | php | {
"resource": ""
} |
q12062 | Db.where | train | public function where($column, $operator, $value, $filter = false)
{
return $this->constraint(__FUNCTION__, $column, $operator, $value, $filter);
} | php | {
"resource": ""
} |
q12063 | Db.orWhereEquals | train | public function orWhereEquals($column, $value, $filter = false)
{
return $this->orWhere($column, '=', $value, $filter);
} | php | {
"resource": ""
} |
q12064 | Db.orWhereNotEquals | train | public function orWhereNotEquals($column, $value, $filter = false)
{
return $this->orWhere($column, '!=', $value, $filter);
} | php | {
"resource": ""
} |
q12065 | Db.orWhereGreaterThanOrEquals | train | public function orWhereGreaterThanOrEquals($column, $value, $filter = false)
{
return $this->orWhere($column, '>=', $value, $filter);
} | php | {
"resource": ""
} |
q12066 | Db.orWhereLessThanOrEquals | train | public function orWhereLessThanOrEquals($column, $value, $filter = false)
{
return $this->orWhere($column, '<=', $value, $filter);
} | php | {
"resource": ""
} |
q12067 | Db.whereGreaterThan | train | public function whereGreaterThan($column, $value, $filter = false)
{
return $this->where($column, '>', $value, $filter);
} | php | {
"resource": ""
} |
q12068 | Db.andWhereGreaterThan | train | public function andWhereGreaterThan($column, $value, $filter = false)
{
return $this->andWhere($column, '>', $value, $filter);
} | php | {
"resource": ""
} |
q12069 | Db.andWhereLessThan | train | public function andWhereLessThan($column, $value, $filter = false)
{
return $this->andWhere($column, '<', $value, $filter);
} | php | {
"resource": ""
} |
q12070 | Db.whereLessThan | train | public function whereLessThan($column, $value, $filter = false)
{
return $this->where($column, '<', $value, $filter);
} | php | {
"resource": ""
} |
q12071 | Db.orWhereLessThan | train | public function orWhereLessThan($column, $value, $filter = false)
{
return $this->orWhere($column, '<', $value, $filter);
} | php | {
"resource": ""
} |
q12072 | Db.orWhereGreaterThan | train | public function orWhereGreaterThan($column, $value, $filter = false)
{
return $this->orWhere($column, '>', $value, $filter);
} | php | {
"resource": ""
} |
q12073 | Db.andWhereLike | train | public function andWhereLike($column, $value, $filter = false)
{
return $this->andWhere($column, 'LIKE', $value, $filter);
} | php | {
"resource": ""
} |
q12074 | Db.andWhereNotLike | train | public function andWhereNotLike($column, $value, $filter = false)
{
return $this->andWhere($column, 'NOT LIKE', $value, $filter);
} | php | {
"resource": ""
} |
q12075 | Db.orWhereLike | train | public function orWhereLike($column, $value, $filter = false)
{
return $this->orWhere($column, 'LIKE', $value, $filter);
} | php | {
"resource": ""
} |
q12076 | Db.orWhereNotLike | train | public function orWhereNotLike($column, $value, $filter = false)
{
return $this->orWhere($column, 'NOT LIKE', $value, $filter);
} | php | {
"resource": ""
} |
q12077 | Db.whereLike | train | public function whereLike($column, $value, $filter = false)
{
return $this->where($column, 'LIKE', $value, $filter);
} | php | {
"resource": ""
} |
q12078 | Db.andWhereEquals | train | public function andWhereEquals($column, $value, $filter = false)
{
return $this->andWhere($column, '=', $value, $filter);
} | php | {
"resource": ""
} |
q12079 | Db.andWhereNotEquals | train | public function andWhereNotEquals($column, $value, $filter = false)
{
return $this->andWhere($column, '!=', $value, $filter);
} | php | {
"resource": ""
} |
q12080 | Db.andWhereEqualsOrGreaterThan | train | public function andWhereEqualsOrGreaterThan($column, $value, $filter = false)
{
return $this->andWhere($column, '>=', $value, $filter);
} | php | {
"resource": ""
} |
q12081 | Db.andWhereEqualsOrLessThan | train | public function andWhereEqualsOrLessThan($column, $value, $filter = false)
{
return $this->andWhere($column, '<=', $value, $filter);
} | php | {
"resource": ""
} |
q12082 | Db.dropTable | train | public function dropTable($table, $ifExists = true)
{
$this->queryBuilder->dropTable($table, $ifExists);
return $this;
} | php | {
"resource": ""
} |
q12083 | CommentForm.CommentStore | train | public function CommentStore($data, $form)
{
/**
* If the "Extra" field is filled, we have a bot.
* Also, the nsas (<noscript> Anti Spam) is a bot. Bot's don't use javascript.
* Note, a legitimate visitor that has JS disabled, will be unable to post!
*/
if (!isset... | php | {
"resource": ""
} |
q12084 | Exceptions.flattenArgument | train | private static function flattenArgument (&$value, $key) {
if ($value instanceof Closure) {
$closureReflection = new ReflectionFunction($value);
$value = sprintf('(Closure at %s:%s)', $closureReflection->getFileName(), $closureReflection->getStartLine());
} elseif (is_object($valu... | php | {
"resource": ""
} |
q12085 | Element.dynamic | train | public static function dynamic($type, $name, $value, array $attributes = array(), $extra = array())
{
switch ($type) {
case 'text':
return self::text($name, $value, $attributes);
case 'password':
return self::password($name, $value, $attributes);
... | php | {
"resource": ""
} |
q12086 | Element.icon | train | public static function icon($icon, $link, array $attributes = array())
{
// Inner text
$text = sprintf('<i class="%s"></i> ', $icon);
return self::link($text, $link, $attributes);
} | php | {
"resource": ""
} |
q12087 | Element.link | train | public static function link($text, $link = '#', array $attributes = array())
{
if (!is_null($link)) {
$attributes['href'] = $link;
}
$node = new Node\Link($text);
return $node->render($attributes);
} | php | {
"resource": ""
} |
q12088 | Element.option | train | public static function option($value, $text, array $attributes = array())
{
if (!is_null($value)) {
$attributes['value'] = $value;
}
$node = new Node\Option($text);
return $node->render($attributes);
} | php | {
"resource": ""
} |
q12089 | Element.button | train | public static function button($text, array $attributes = array())
{
$node = new Node\Button($text);
return $node->render($attributes);
} | php | {
"resource": ""
} |
q12090 | Element.radio | train | public static function radio($name, $value, $checked, array $attributes = array())
{
if (!is_null($name)) {
$attributes['name'] = $name;
}
if (!is_null($value)) {
$attributes['value'] = $value;
}
$node = new Node\Radio($checked);
return $node... | php | {
"resource": ""
} |
q12091 | Element.checkbox | train | public static function checkbox($name, $checked, array $attributes = array(), $serialize = true)
{
if ($name !== null) {
$attributes['name'] = $name;
}
$node = new Node\Checkbox($serialize, $checked);
return $node->render($attributes);
} | php | {
"resource": ""
} |
q12092 | Element.file | train | public static function file($name, $accept = null, array $attributes = array())
{
if (!is_null($name)) {
$attributes['name'] = $name;
}
if (!is_null($accept)) {
$attributes['accept'] = $accept;
}
$node = new Node\File();
return $node->render(... | php | {
"resource": ""
} |
q12093 | Element.select | train | public static function select($name, array $list = array(), $selected, array $attributes = array(), $prompt = false, Closure $optionVisitor = null)
{
if ($prompt !== false) {
// Merge keeping indexes
$list = array('' => $prompt) + $list;
}
$node = new Node\Select($li... | php | {
"resource": ""
} |
q12094 | Element.textarea | train | public static function textarea($name, $text, array $attributes = array())
{
if ($name !== null) {
$attributes['name'] = $name;
}
$node = new Node\Textarea($text);
return $node->render($attributes);
} | php | {
"resource": ""
} |
q12095 | Element.text | train | public static function text($name, $value, array $attributes = array())
{
$node = new Node\Text();
if (!is_null($name)) {
$attributes['name'] = $name;
}
if (!is_null($value)) {
$attributes['value'] = $value;
}
return $node->render($attribute... | php | {
"resource": ""
} |
q12096 | Element.color | train | public static function color($name, $value, array $attributes = array())
{
$node = new Node\Color();
if (!is_null($name)) {
$attributes['name'] = $name;
}
if (!is_null($value)) {
$attributes['value'] = $value;
}
return $node->render($attribu... | php | {
"resource": ""
} |
q12097 | Element.email | train | public static function email($name, $value, array $attributes = array())
{
$node = new Node\Email();
if (!is_null($name)) {
$attributes['name'] = $name;
}
if (!is_null($value)) {
$attributes['value'] = $value;
}
return $node->render($attribu... | php | {
"resource": ""
} |
q12098 | Element.hidden | train | public static function hidden($name, $value, array $attributes = array())
{
$node = new Node\Hidden();
if (!is_null($name)) {
$attributes['name'] = $name;
}
if (!is_null($value)) {
$attributes['value'] = $value;
}
return $node->render($attri... | php | {
"resource": ""
} |
q12099 | Element.number | train | public static function number($name, $value, array $attributes = array())
{
$node = new Node\Number();
if (!is_null($name)) {
$attributes['name'] = $name;
}
if (!is_null($value)) {
$attributes['value'] = $value;
}
return $node->render($attri... | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.