_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | 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])
| php | {
"resource": ""
} |
q12001 | Generator.getSingleAttrKey | train | public static function getSingleAttrKey(Tag &$Tag)
{
if (isset(TagInfo::$singleAttrKeys[$Tag->name])) {
return TagInfo::$singleAttrKeys[$Tag->name];
| php | {
"resource": ""
} |
q12002 | XmlStreamWriter.writeStartElement | train | public function writeStartElement(string $elementName): self
{
$this->doWriteStartElement($elementName);
| php | {
"resource": ""
} |
q12003 | XmlStreamWriter.writeEndElement | train | public function writeEndElement(): self
{
if ($this->isFinished()) {
throw new \LogicException('Can not write end elements, no element open.');
}
| 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')) {
| 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) | 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', $attr, $attr);
/*
* Get the interessting part.
*/
$attr = $attr[0];
$r = array();
foreach ($attr as $k => $v) {
/*
* Skip empty matches
*/
if (trim($v) == '') {
continue;
}
/*
* Split by the first = symbol.
*/
$e = explode('=', $v, 2);
/*
| 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
);
/*
* Initiate variables.
*/
$r = array();
$line = '';
$isInline = true;
$oneLine = array();
$lastWasTag = false;
/*
* Loop throu the tree.
*/
foreach ($tree as $k => $elm) {
/*
* Check what kind of element this is.
*/
$info;
switch (self::_getTreeElm($elm[0], $info)) {
case 'start':
/*
* It's a starting tag
*/
$add = new Tag(
$info[1], /* The Tags Name */
array(self::parseAttrs($info[2])), /* The attributes */
array(
'generate',
($info[3] == '/>' ? 'selfQlose' : 'doNotSelfQlose'),
'start',
(in_array($info[1], TagInfo::$inlineTags) ? 'inline' : null)
)
);
break;
case 'end':
/*
* It is a closing tag
*/
| 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';
} elseif (strpos($str, '<!') === 0) {
return 'content';
} elseif (strpos($str, '<!--') === 0) {
| 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');
if (false === $this->callbackList) {
throw new XslCallbackException(
| 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.
*/
| php | {
"resource": ""
} |
q12011 | BasicModule.generate | train | final public function generate() {
$options = array_merge($this->options, (array) 'generate');
| 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(),
'url' => $event->getUrl(),
| 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);
break;
case 'boolean':
$this->serializeBool($value, $xmlWriter, $tagName);
break;
case 'string':
case 'integer':
case 'double':
$this->serializeScalarValue($value, $xmlWriter, $tagName);
break;
case 'array':
$this->serializeArray($value, $xmlWriter, $tagName, $elementTagName);
break;
case 'object':
if ($value instanceof \Traversable && !annotationsOf($value)->contain('XmlNonTraversable')) {
if (null === $tagName && $value instanceof \Traversable && annotationsOf($value)->contain('XmlTag')) {
$annotation = annotationsOf($value)->firstNamed('XmlTag');
| php | {
"resource": ""
} |
q12014 | XmlSerializer.serializeNull | train | public function serializeNull(XmlStreamWriter $xmlWriter, string $tagName = null): XmlStreamWriter
{
return $xmlWriter->writeStartElement(null === $tagName ? | php | {
"resource": ""
} |
q12015 | XmlSerializer.serializeBool | train | public function serializeBool($value, XmlStreamWriter $xmlWriter, string $tagName = null): XmlStreamWriter
{
return $this->serializeScalarValue(
$this->convertBoolToString($value), | php | {
"resource": ""
} |
q12016 | XmlSerializer.serializeFloat | train | public function serializeFloat($value, XmlStreamWriter $xmlWriter, string $tagName = | php | {
"resource": ""
} |
q12017 | XmlSerializer.serializeScalarValue | train | protected function serializeScalarValue($value, XmlStreamWriter $xmlWriter, string $tagName = null): XmlStreamWriter
{ | 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)) {
$xmlWriter->writeStartElement($tagName);
}
foreach ($array as $key => $value) {
if (is_int($key)) {
$this->serialize($value, $xmlWriter, $elementTagName); | php | {
"resource": ""
} |
q12019 | XmlSerializer.serializeObject | train | public function serializeObject($object, XmlStreamWriter $xmlWriter, string $tagName = null): XmlStreamWriter
{
| php | {
"resource": ""
} |
q12020 | XmlSerializer.serializerFor | train | protected function serializerFor($object): ObjectXmlSerializer
{
if (!annotationsOf($object)->contain('XmlSerializer')) {
return AnnotationBasedObjectXmlSerializer::fromObject($object);
}
return $this->injector->getInstance(
| 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 ' . | php | {
"resource": ""
} |
q12022 | XslProcessor.applyStylesheet | train | public function applyStylesheet(\DOMDocument $stylesheet): self
{
$this->stylesheets[] = $stylesheet;
| 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 | php | {
"resource": ""
} |
q12024 | XslProcessor.usingCallback | train | public function usingCallback(string $name, $instance): self
{
| php | {
"resource": ""
} |
q12025 | XslProcessor.registerCallbacks | train | protected function registerCallbacks()
{
self::$_callbacks = $this->xslCallbacks; | 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
. ' with value ' . $paramValue
);
| 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();
| 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();
| 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();
| 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";
}
| php | {
"resource": ""
} |
q12032 | XmlStreamWriterProvider.createStreamWriter | train | protected function createStreamWriter(string $xmlExtension): XmlStreamWriter
{
$className = $this->types[$xmlExtension];
| 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);
}
| php | {
"resource": ""
} |
q12034 | Db.asManyToMany | train | public function asManyToMany($alias, $junction, $column, $table, $pk, $columns = | php | {
"resource": ""
} |
q12035 | Db.asOneToOne | train | public function asOneToOne($column, $alias, $table, $link)
{
| php | {
"resource": ""
} |
q12036 | Db.asOneToMany | train | public function asOneToMany($table, $pk, $alias)
{
| 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 {
| 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, $alias));
| 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
| 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()
->select('*')
->from($table)
->getQueryString();
$stmt = $this->pdo->query($select);
$fieldCount = $stmt->columnCount();
// Append additional drop state
$result .= $this->queryBuilder->clear()
->dropTable($table)
->getQueryString();;
// Show how this table was created
$createResult = $this->pdo->query(sprintf('SHOW CREATE TABLE %s', $table))->fetch();
$result .= "\n\n" . $createResult['Create Table'] . ";\n\n";
// Start main loop
for ($i = 0; $i < $fieldCount; $i++) {
// Loop to generate INSERT statements
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$values = array();
// Extra values and push them to $values array
for ($j = 0; $j < $fieldCount; $j++) {
// We need to ensure all quotes are properly escaped
$row[$j] = addslashes($row[$j]);
// Ensure its correctly escaped
| php | {
"resource": ""
} |
q12042 | Db.paginateRaw | train | public function paginateRaw($count, $page, $itemsPerPage)
{
$this->paginator->tweak($count, $itemsPerPage, $page);
| 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);
| php | {
"resource": ""
} |
q12044 | Db.getPrimaryKey | train | public function getPrimaryKey($table)
{
$db = $this->showKeys()->from($table)
| php | {
"resource": ""
} |
q12045 | Db.raw | train | public function raw($query, array $bindings = array())
{
if (!empty($bindings)) {
foreach ($bindings as $column | 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 logging purpose
$log = str_replace(array_keys($this->bindings), array_values($this->bindings), $this->queryBuilder->getQueryString());
// Execute it
| 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;
} else {
foreach ($rows as $row) {
if (isset($row[$column])) {
| 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])) {
$result = $rows[$column];
} else {
$result = false;
}
| 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);
| php | {
"resource": ""
} |
q12050 | Db.increment | train | public function increment($table, $column, $step = 1)
{
| php | {
"resource": ""
} |
q12051 | Db.decrement | train | public function decrement($table, $column, $step = 1)
{
| php | {
"resource": ""
} |
q12052 | Db.equals | train | public function equals($column, $value, $filter = false)
{
| php | {
"resource": ""
} |
q12053 | Db.notEquals | train | public function notEquals($column, $value, $filter = false)
{
| php | {
"resource": ""
} |
q12054 | Db.like | train | public function like($column, $value, $filter = false)
{
| php | {
"resource": ""
} |
q12055 | Db.notLike | train | public function notLike($column, $value, $filter = false)
{
| php | {
"resource": ""
} |
q12056 | Db.greaterThan | train | public function greaterThan($column, $value, $filter = false) | php | {
"resource": ""
} |
q12057 | Db.lessThan | train | public function lessThan($column, $value, $filter = false)
{
| php | {
"resource": ""
} |
q12058 | Db.orWhereBetween | train | public function orWhereBetween($column, $a, $b, $filter = false)
{
| 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 RawSqlFragmentInterface) {
$y = $b->getFragment();
}
// When doing betweens, unique placeholders come in handy
if (!isset($x)) {
$x = $this->getUniqPlaceholder();
}
if (!isset($y)) {
$y = $this->getUniqPlaceholder();
| php | {
"resource": ""
} |
q12060 | Db.constraint | train | private function constraint($method, $column, $operator, $value, $filter)
{
if (!$this->queryBuilder->isFilterable($filter, $value)) { | 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->getTarget(), $filter);
} elseif ($values instanceof RawSqlFragmentInterface) {
call_user_func(array($this->queryBuilder, $method), $column, $values, $filter);
| php | {
"resource": ""
} |
q12062 | Db.where | train | public function where($column, $operator, $value, $filter = false)
{
| php | {
"resource": ""
} |
q12063 | Db.orWhereEquals | train | public function orWhereEquals($column, $value, $filter = | php | {
"resource": ""
} |
q12064 | Db.orWhereNotEquals | train | public function orWhereNotEquals($column, $value, $filter = | php | {
"resource": ""
} |
q12065 | Db.orWhereGreaterThanOrEquals | train | public function orWhereGreaterThanOrEquals($column, $value, $filter = | php | {
"resource": ""
} |
q12066 | Db.orWhereLessThanOrEquals | train | public function orWhereLessThanOrEquals($column, $value, $filter = | php | {
"resource": ""
} |
q12067 | Db.whereGreaterThan | train | public function whereGreaterThan($column, $value, $filter = | php | {
"resource": ""
} |
q12068 | Db.andWhereGreaterThan | train | public function andWhereGreaterThan($column, $value, $filter = | php | {
"resource": ""
} |
q12069 | Db.andWhereLessThan | train | public function andWhereLessThan($column, $value, $filter = | php | {
"resource": ""
} |
q12070 | Db.whereLessThan | train | public function whereLessThan($column, $value, $filter = | php | {
"resource": ""
} |
q12071 | Db.orWhereLessThan | train | public function orWhereLessThan($column, $value, $filter = | php | {
"resource": ""
} |
q12072 | Db.orWhereGreaterThan | train | public function orWhereGreaterThan($column, $value, $filter = | php | {
"resource": ""
} |
q12073 | Db.andWhereLike | train | public function andWhereLike($column, $value, $filter = false)
{
| php | {
"resource": ""
} |
q12074 | Db.andWhereNotLike | train | public function andWhereNotLike($column, $value, $filter = false) | php | {
"resource": ""
} |
q12075 | Db.orWhereLike | train | public function orWhereLike($column, $value, $filter = false)
{
| php | {
"resource": ""
} |
q12076 | Db.orWhereNotLike | train | public function orWhereNotLike($column, $value, $filter = false)
{
| php | {
"resource": ""
} |
q12077 | Db.whereLike | train | public function whereLike($column, $value, $filter = false)
{
| php | {
"resource": ""
} |
q12078 | Db.andWhereEquals | train | public function andWhereEquals($column, $value, $filter = | php | {
"resource": ""
} |
q12079 | Db.andWhereNotEquals | train | public function andWhereNotEquals($column, $value, $filter = | php | {
"resource": ""
} |
q12080 | Db.andWhereEqualsOrGreaterThan | train | public function andWhereEqualsOrGreaterThan($column, $value, $filter = | php | {
"resource": ""
} |
q12081 | Db.andWhereEqualsOrLessThan | train | public function andWhereEqualsOrLessThan($column, $value, $filter = | php | {
"resource": ""
} |
q12082 | Db.dropTable | train | public function dropTable($table, $ifExists = true)
{ | 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($data['Extra']) || $data['Extra'] == '' || isset($data['nsas'])) {
$data['Comment'] = Convert::raw2sql($data['Comment']);
$exists = Comment::get()
->filter(array('Comment:PartialMatch' => $data['Comment']))
->where('ABS(TIMEDIFF(NOW(), Created)) < 60');
| 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($value)) {
| 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);
case 'url':
return self::url($name, $value, $attributes);
case 'range':
return self::range($name, $value, $attributes);
case 'number':
return self::number($name, $value, $attributes);
case 'hidden':
return self::hidden($name, $value, $attributes);
case 'date':
return self::date($name, $value, $attributes);
case 'time':
return self::time($name, $value, $attributes);
case 'color':
return self::color($name, $value, $attributes);
case 'textarea':
| php | {
"resource": ""
} |
q12086 | Element.icon | train | public static function icon($icon, $link, array $attributes = array())
{
// Inner | php | {
"resource": ""
} |
q12087 | Element.link | train | public static function link($text, $link = '#', array $attributes = array())
{
if (!is_null($link)) {
| php | {
"resource": ""
} |
q12088 | Element.option | train | public static function option($value, $text, array $attributes = array())
{
if (!is_null($value)) {
| php | {
"resource": ""
} |
q12089 | Element.button | train | public static function button($text, array $attributes = array())
{
$node = new Node\Button($text);
| 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'] | php | {
"resource": ""
} |
q12091 | Element.checkbox | train | public static function checkbox($name, $checked, array $attributes = array(), $serialize = true)
{
if ($name !== null) {
$attributes['name'] = $name;
}
| 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'] | 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;
}
| php | {
"resource": ""
} |
q12094 | Element.textarea | train | public static function textarea($name, $text, array $attributes = array())
{
if ($name !== null) {
$attributes['name'] = $name;
}
$node | 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)) | 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)) | 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)) | 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)) | 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)) | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.