Skip to content

Instantly share code, notes, and snippets.

View Ulv's full-sized avatar
🤔
Working

Ulv Ulv

🤔
Working
View GitHub Profile
@Ulv
Ulv / htmlform.php
Created June 27, 2013 16:59
объект form. Содержит спарсенные данные html формы
/**
* Class form
* just a container
*/
class form implements IteratorAggregate
{
private $_formAction;
private $_formMethod;
private $_inputs;
@Ulv
Ulv / htmlform.php
Created June 27, 2013 16:58
парсит формы html, вынимает input text. input hidden и textarea. Возвращает массив объектов form
/**
* парсит формы в html. Выбирает input[type=text], input[type=hidden] и textarea
*
* @return массив объектов form()
*/
public function extract()
{
$dom = new DOMDocument();
$dom->loadXML(self::$saw->get('form')->toXml());
$xpath = new DOMXPath($dom);
# all php files :: disallow direct access of file
# between <?php and ?>
defined('_JEXEC') or die;
# index.php :: define variable with application
# between <?php and ?>
$app = JFactory::getApplication();
# index.php :: define variable with document
# between <?php and ?>
@Ulv
Ulv / mime-types.php
Created October 24, 2012 16:42
mime types
// Atom
header('Content-type: application/atom+xml');
// CSS
header('Content-type: text/css');
// Javascript
header('Content-type: text/javascript');
//JPEG Image
header('Content-type: image/jpeg');
//JSON
header('Content-type: application/json');