#5 | Phalcon\Mvc\Model::find()
/home/idporg/katalog.idp.org.tr/app/forms/SearchForm.php (109) <?php
namespace Idp\Forms;
use Phalcon\Forms\Form;
use Phalcon\Forms\Element\Text;
use Phalcon\Forms\Element\Hidden;
use Phalcon\Forms\Element\Select;
use Phalcon\Forms\Element\Submit;
use Phalcon\Validation\Validator\PresenceOf;
use Phalcon\Validation\Validator\Email;
use Idp\Models\Authors;
use Idp\Models\ArticleTypes;
class SearchForm extends Form
{
public function initialize($entity = null, $options = null)
{
// Query
$query = new Text('query', array(
'placeholder' => 'Terim',
'class' => 'ico-01',
'placeholder' => 'Genel arama'
));
$query->setDefault($this->request->getQuery('query', ['trim', 'lower']));
$this->add($query);
// Article Title
$article_title = new Text('article_title', array(
'placeholder' => 'Yazı Başlığı',
'class' => 'form-control',
));
$article_title->setDefault($this->request->getQuery('article_title', ['trim', 'lower']));
$this->add($article_title);
// Article Types
$types = new Select('types[]', ArticleTypes::getPopularTypes(), array(
'using' => array(
'id',
'name'
),
'class' => 'chosen-select-no-single',
'useEmpty' => true,
'emptyText' => 'Tüm Yazı Türleri',
'emptyValue' => null,
'data-placeholder' => 'Tüm Yazı Türleri',
'multiple' => true
));
$types->setDefault($this->request->getQuery('types'));
$this->add($types);
// Journal Name
$journal_name = new Text('journal_name', array(
'placeholder' => 'Dergi Adı',
'class' => 'form-control',
));
$journal_name->setDefault($this->request->getQuery('journal_name', ['trim', 'lower']));
$this->add($journal_name);
// Author Name
$author_name = new Text('author_name', array(
'placeholder' => 'Yazar Adı',
'class' => 'form-control',
));
$author_name->setDefault($this->request->getQuery('author_name', ['trim', 'lower']));
$this->add($author_name);
// Year
$year = new Text('year', array(
'placeholder' => 'Yıl',
'class' => 'form-control',
));
$year->setDefault($this->request->getQuery('year', ['trim', 'string', 'lower']));
$this->add($year);
// Start Year
$start_year = new Text('start_year', array(
'placeholder' => 'Başlangıç Yılı',
'class' => 'form-control',
));
$start_year->setDefault($this->request->getQuery('start_year', ['trim', 'string', 'lower']));
$this->add($start_year);
// End Year
$end_year = new Text('end_year', array(
'placeholder' => 'Bitiş Yılı',
'class' => 'form-control',
));
$end_year->setDefault($this->request->getQuery('end_year', ['trim', 'string', 'lower']));
$this->add($end_year);
// Tag Name
$tag_name = new Text('tag_name', array(
'placeholder' => 'Anahtar Kelimeler',
'class' => 'form-control'
));
$tag_name->setDefault($this->request->getQuery('tag_name', ['trim', 'string', 'lower']));
$this->add($tag_name);
// Authors
$authors = new Select('authors[]', Authors::find(), array(
'using' => array(
'id',
'name'
),
'class' => 'chosen-select',
'useEmpty' => true,
'emptyText' => 'Tüm Yazarlar',
'emptyValue' => null,
'data-placeholder' => 'Tüm Yazarlar',
'multiple' => true
));
$authors->setDefault($this->request->getQuery('authors'));
$this->add($authors);
// Action
$this->add(new Hidden('action'));
// Hidden
$this->add(new Hidden('hidden'));
// CSRF
$this->add(new Hidden('csrf'));
// Submit
$this->add(new Submit('submit', ['class' => 'button', 'value' => 'Kaydet']));
}
}
|
#7 | Phalcon\Forms\Form->__construct()
/home/idporg/katalog.idp.org.tr/app/controllers/IndexController.php (31) <?php
namespace Idp\Controllers;
use Idp\Models\Journals;
use Idp\Models\Articles;
use Idp\Models\Issues;
use Idp\Models\Authors;
use Idp\Forms\SearchForm;
class IndexController extends ControllerBase
{
public function indexAction()
{
// Last Journals
$last_journals = Journals::getLastJournals(6);
// Counters
$count_journals = Journals::count(['status = :status:','bind' => ['status' => true]]);
$count_issues = Issues::count(['status = :status:','bind' => ['status' => true]]);
$count_articles = Articles::count(['status = :status:','bind' => ['status' => true]]);
$count_authors = Authors::count();
// Vars
$this->view
->setVar('is_homepage', true)
->setVar('count_journals', $count_journals)
->setVar('count_articles', $count_articles)
->setVar('count_issues', $count_issues)
->setVar('count_authors', $count_authors)
->setVar('form', new SearchForm())
->setVar('last_journals', $last_journals)
->setVar('page_title', "İDP - İslamcı Dergiler Projesi")
->setVar('meta_title', "İDP - İslamcı Dergiler Projesi")
->setVar('meta_description', "");
}
}
|
#11 | Phalcon\Mvc\Application->handle()
/home/idporg/katalog.idp.org.tr/public/index.php (62) <?php
/**
* Set Locate
*/
setlocale(LC_COLLATE, 'turkish', 'tr_TR.UTF-8', 'tr_TR', 'tr');
setlocale(LC_MONETARY, 'turkish', 'tr_TR.UTF-8', 'tr_TR', 'tr');
setlocale(LC_NUMERIC, 'turkish', 'tr_TR.UTF-8', 'tr_TR', 'tr');
setlocale(LC_TIME, 'turkish', 'tr_TR.UTF-8', 'tr_TR', 'tr');
setlocale(LC_CTYPE,'en_US.utf8');
// setlocale(LC_MESSAGES,'tr_TR.utf8');
/**
* Set Time Zone
*/
date_default_timezone_set('Europe/Istanbul');
/**
* Define some useful constants
*/
define('DOT', '.');
define('DS', DIRECTORY_SEPARATOR);
define('BASE_PATH', dirname(__DIR__));
define('APP_PATH', BASE_PATH . DS. 'app');
define('PUBLIC_PATH', BASE_PATH . DS . 'public');
/**
* Read the constants
*/
$config = include APP_PATH . '/config/constants.php';
/**
* Read the configuration
*/
$config = include APP_PATH . '/config/config.php';
/**
* Read auto-loader
*/
include APP_PATH . '/config/loader.php';
/**
* Read services
*/
include APP_PATH . '/config/services.php';
// Debug Application
if($config->application->debug)
{
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
(new Phalcon\Debug)->listen();
/**
* Handle the request
*/
$application = new \Phalcon\Mvc\Application($di);
echo $application->handle()->getContent();
}
else
{
try
{
/**
* Handle the request
*/
$application = new \Phalcon\Mvc\Application($di);
echo $application->handle()->getContent();
}
catch(Exception $e)
{
$di->getLogger()->error($e->getMessage());
echo $e->getMessage(), '<br>';
echo nl2br(htmlentities($e->getTraceAsString()));
exit;
}
} |