Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
updated htaccess in docs (fixed #27)
Browse files Browse the repository at this point in the history
added shortcuts methods for some types of inputs in form helper (fixed #22)
  • Loading branch information
maximebf committed Mar 4, 2014
1 parent 386386d commit 97367a1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/urls.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ For cleaner and prettier url you can use url rewriting. When using Apache, simpl
code below into a *.htaccess* file in the same directory as Atomik's core file.

RewriteEngine on
# Allow access to assets folder
RewriteRule ^app/plugins/(.+)/assets - [L]
RewriteRule ^app/ - [L,F]
RewriteRule ^vendor/ - [L,F]
RewriteRule ^vendor/maximebf/debugbar/src/DebugBar/Resources - [L]
# forbid access to files and folders under app and vendor
RewriteRule ^app/.*$ - [L,F]
RewriteRule ^vendor/.*$ - [L,F]
# rewrite to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?action=$1 [L,QSA]
Expand Down
35 changes: 35 additions & 0 deletions src/helpers/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,41 @@ public function input($name, $value = '', $type = 'text', $attrs = array())

return sprintf('<input %s />', Atomik::htmlAttributes($attrs));
}

public function password($name, $attrs = array())
{
return $this->input($name, '', 'password', $attrs);
}

public function email($name, $value = '', $attrs = array())
{
return $this->input($name, $value, 'email', $attrs);
}

public function date($name, $value = '', $attrs = array())
{
return $this->input($name, $value, 'date', $attrs);
}

public function time($name, $value = '', $attrs = array())
{
return $this->input($name, $value, 'time', $attrs);
}

public function number($name, $value = '', $attrs = array())
{
return $this->input($name, $value, 'number', $attrs);
}

public function url($name, $value = '', $attrs = array())
{
return $this->input($name, $value, 'url', $attrs);
}

public function datetime($name, $value = '', $attrs = array())
{
return $this->input($name, $value, 'datetime', $attrs);
}

public function checkbox($name, $checked = false, $value = 1, $attrs = array())
{
Expand Down

0 comments on commit 97367a1

Please sign in to comment.