Re: H2Admin - The standalone Housekeeping solution (PHP7, CakePHP)
Quote:
Originally Posted by
ovflowd
Nobrain, this is the best Housekeeping development that i ever seen. I really wish good luck. The screen shots and the features sounds promising! Can you add some snippets later?
Good luck.
Aye, there's literally not much to show considering Cake's built in stuff handles most of it but I'll throw up a public repository in the near future. Extremely busy with work at the moment.
Re: H2Admin - The standalone Housekeeping solution (PHP7, CakePHP)
Hi,
I've been extremely busy with work at the moment so here have a snippet. It might be a bit buggered because I copied it from my Bitbucket. More on the way later this week. This code WILL be changed in the future, there's no doubting that.
Code:
<?php
class MembersController extends AppController
{
public $uses = array('users', 'Member');
public $components = array('Paginator');
public $helpers = array('Paginator');
public function index()
{
/**
* Set page title
*/
$this->set('title_for_layout', 'Members');
/**
* Set logged in template.
*/
$this->layout = 'default-in';
/**
* Paginate whole table.
*/
$this->Paginator->settings = array('order' => 'username', 'limit' => 10);
$members = $this->Paginator->Paginate('Member');
/**
* Search functionality.
*/
if (isset($this->request->query['membersearch']) && $this->request->query['membersearch'] != '')
{
if (strpbrk($this->request->query['membersearch'], '+-<>~') !== false)
{
$mode = ' IN BOOLEAN MODE';
}
else {
$mode = ' ';
}
/**
* Search conditions
*/
$conditions = array(
array(
'or' => array(
array('Member.id =' => $this->request->query['membersearch']), // ID
array('Member.username LIKE' => '%' . $this->request->query['membersearch'] . '%'), // Username
array('Member.mail LIKE' => '%' . $this->request->query['membersearch'] . '%'), // Email
array('Member.rank =' => $this->request->query['membersearch']), // Rank
array('Member.ip_last LIKE' => '%' . $this->request->query['membersearch'] . '%'), // Latest IP
array('Member.ip_reg LIKE' => '%' . $this->request->query['membersearch'] . '%'), // IP Registered
)
)
);
$this->Paginator->settings = array(
'fields' => array('Member.*'),
'conditions' => $conditions,
'order' => array('Member.id' => 'ASC'),
'limit' => 20
);
$members = $this->Paginator->paginate('Member');
}
$this->set(compact('members'));
}
}
Re: H2Admin - The standalone Housekeeping solution (PHP7, CakePHP)
Since you're all about PHP7 you do know that you can now use short syntax for arrays in php
Code:
$a = [1, 2, 3, 4];
$b = ['one' => 1, 'two' => 2, 'three' => 3, 'four' => 4];
Code:
$a
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
)
Code:
$b
Array
(
[one] => 1
[two] => 2
[three] => 3
[four] => 4
)
Re: H2Admin - The standalone Housekeeping solution (PHP7, CakePHP)
I liked the snippet. But this method "index()" breaches the OO manifest.
But good luck.
Re: H2Admin - The standalone Housekeeping solution (PHP7, CakePHP)
Quote:
Originally Posted by
ovflowd
I liked the snippet. But this method "index()" breaches the OO manifest.
But good luck.
I'm writing it as per CakePHP's 2.x documentation.
Quote:
Originally Posted by
SeanRog
Since you're all about PHP7 you do know that you can now use short syntax for arrays in php
Code:
$a = [1, 2, 3, 4];
$b = ['one' => 1, 'two' => 2, 'three' => 3, 'four' => 4];
Code:
$a
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
)
Code:
$b
Array
(
[one] => 1
[two] => 2
[three] => 3
[four] => 4
)
I'm aware, I'm just used to using the previous method. It produces the same output and I'm also not all about PHP7 I'm just saying it's supported. Thanks for the information though.
Re: H2Admin - The standalone Housekeeping solution (PHP7, CakePHP)
Why CakePHP? Why not something like Laravel or Symfony? Any specific reasons to why CakePHP?
Re: H2Admin - The standalone Housekeeping solution (PHP7, CakePHP)
Quote:
Originally Posted by
Dominic
Why CakePHP? Why not something like Laravel or Symfony? Any specific reasons to why CakePHP?
Already explained why in the main post. I have a big dislike towards symfony, I also have very little experience with laravel.
Sent from my SM-G900F using Tapatalk
Re: H2Admin - The standalone Housekeeping solution (PHP7, CakePHP)
Quote:
Originally Posted by
pea-brain
Already explained why in the main post. I have a big dislike towards symfony, I also have very little experience with laravel.
Sent from my SM-G900F using Tapatalk
Laravel is largely based on Symfony. Laravel is very easy to workaround, using their magic queries (DB->whereOnline(1)) and whatnot :D:
Re: H2Admin - The standalone Housekeeping solution (PHP7, CakePHP)
Quote:
Originally Posted by
Dominic
Laravel is largely based on Symfony. Laravel is very easy to workaround, using their magic queries (DB->whereOnline(1)) and whatnot :D:
I'll be sticking with CakePHP regardless.
Sent from my SM-G900F using Tapatalk
Re: H2Admin - The standalone Housekeeping solution (PHP7, CakePHP)
For me the best framework is which one you creates. You have the entirely control about the code. And don't have unnecessary libraries. Only what you want.
But in the Frameworks the two ones that i like is Yii and FalconPHP.
FalconPHP is the fastest PHP Framework.
Re: H2Admin - The standalone Housekeeping solution (PHP7, CakePHP)
It looks so really nice so far!
Request: A avatar image on the users search page and registred users?
Re: H2Admin - The standalone Housekeeping solution (PHP7, CakePHP)
Quote:
Originally Posted by
Vimsoration
It looks so really nice so far!
Request: A avatar image on the users search page and registred users?
You read my mind with that idea. Thank for the idea though :)
Sent from my SM-G900F using Tapatalk
Re: H2Admin - The standalone Housekeeping solution (PHP7, CakePHP)
Sounds cool. Panel is very clunky and doesn't feel right for a retro. Probably just me though.
Also, what's with CakePHP? A housekeeping, even with intricate features, doesn't really need a framework behind it. A class or two, maybe.
Re: H2Admin - The standalone Housekeeping solution (PHP7, CakePHP)
Quote:
Originally Posted by
Jonteh
Sounds cool. Panel is very clunky and doesn't feel right for a retro. Probably just me though.
Also, what's with CakePHP? A housekeeping, even with intricate features, doesn't really need a framework behind it. A class or two, maybe.
What's with emulators using frameworks.
In all reality though,
He uses Cake because he's familiar with it in a professional environment and all in all frameworks are used to build faster and more scalable projects without needing to worry about the compatibility or possible exploitation while building. Fast and easy development, it's just a retro and code cleanliness also comes in handy. Something, Illumina missed out on.
Re: H2Admin - The standalone Housekeeping solution (PHP7, CakePHP)
Quote:
Originally Posted by
LeChris
What's with emulators using frameworks.
In all reality though,
He uses Cake because he's familiar with it in a professional environment and all in all frameworks are used to build faster and more scalable projects without needing to worry about the compatibility or possible exploitation while building. Fast and easy development, it's just a retro and code cleanliness also comes in handy. Something, Illumina missed out on.
I'm sorry you feel the need to use anything other than your own code to build a working project.