Skip to content

Commit

Permalink
Merge pull request #186 from BADAKAA/master
Browse files Browse the repository at this point in the history
Add Attribute Support
  • Loading branch information
jorgecc authored Mar 26, 2024
2 parents a38c40e + 34f6e85 commit fc9549e
Showing 1 changed file with 58 additions and 1 deletion.
59 changes: 58 additions & 1 deletion lib/BladeOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -4149,6 +4149,64 @@ protected function compileJSon($expression): string
return $this->phpTagEcho . "json_encode($parts[0], $options, $depth); ?>";
}
//</editor-fold>
//<editor-fold desc="attributes">
/**
* Compile the checked statements into valid PHP.
*
* @param string $expression
* @return string
*/
protected function compileChecked($expression): string
{
return $this->phpTag . "if$expression echo 'checked'; ?>";
}

/**
* Compile the selected statements into valid PHP.
*
* @param string $expression
* @return string
*/
protected function compileSelected($expression): string
{
return $this->phpTag . "if$expression echo 'selected'; ?>";
}

/**
* Compile the disabled statements into valid PHP.
*
* @param string $expression
* @return string
*/

protected function compileDisabled($expression): string
{
return $this->phpTag . "if$expression echo 'disabled'; ?>";
}

/**
* Compile the readonly statements into valid PHP.
*
* @param string $expression
* @return string
*/

protected function compileReadonly($expression): string
{
return $this->phpTag . "if$expression echo 'readonly'; ?>";
}

/**
* Compile the required statements into valid PHP.
*
* @param string $expression
* @return string
*/
protected function compileRequired($expression): string
{
return $this->phpTag . "if$expression echo 'required'; ?>";
}
//</editor-fold>
// <editor-fold desc='language'>
protected function compileIsset($expression): string
{
Expand Down Expand Up @@ -4220,7 +4278,6 @@ protected function compile_n($expression): string
{
return $this->phpTagEcho . "\$this->_n$expression; ?>";
}

// </editor-fold>
//<editor-fold desc="cli">
public static function isCli(): bool
Expand Down

0 comments on commit fc9549e

Please sign in to comment.