Comments (4)
I would advice to watch the tutorial video on Models. There is a part that tells you how to use criteria.
You could make a form, which routes to Search. So the form action would be action="search".
So if you want to have the user look though a database table which has Posts, which you want to sort by date
then you would have a route like this:
'GET:search' => array('route' => 'Posts.Search'),
Then in the PostsController.php you could add a function:
public function Search()
{
require_once 'Model/PostsCriteria.php';
// From date, that the user selected
$fromDate = RequestUtil::Get("FromDate");
// To date, that the user selected
$toDate = RequestUtil::Get("ToDate");
// use Post criteria, to create a custom Query
$criteria = new PostsCriteria();
$criteria->Date_GreaterThanOrEqual = $fromDate;
$criteria->Date_LessThanOrEqual = $toDate;
// Then run the Query on the posts db table
$posts = $this->Phreezer->Query('Posts', $criteria);
// Then display the search results
foreach ($posts as $post)
{
echo $post->Name . '<br/>';
}
}
Hope this helps.
from phreeze.
Hey, thank you!
Yes, I have watched the videos which have made MVC much clearer to me. I just couldn't make the jump from static criteria to variable criteria from the web client. Let me see if I can take your lead and make this work.
Thank you, again.
from phreeze.
Awesome man, love your attitude. You will love Phreeze, I can smell it. Working with Phreeze opened up my view on MVC also.
I really want you to stick around and keep using Phreeze. It's bleeding edge software and a rough diamond with bad documentation, but it's heart is smart and strong.
from phreeze.
Thanks guys! I started the Phreeze wiki where I hope some documentation might start appearing soon with the help of anybody who wishes. I will try to start working on it little by little as well.
https://github.com/jasonhinkle/phreeze/wiki
-j
from phreeze.
Related Issues (20)
- Greetings HOT 1
- Error after building
- Its work wordpress 4.8+?
- Phreeze Builder Broken HOT 1
- master-detail / master-detail-detail examples
- builder/analyze gives 404 on Nginx
- Generated code in scripts/model.js displays all tables regardless
- index null HOT 1
- Controler filename / classname containing space character(s)
- Stuck loading tables with varbinary?
- Error Opening MySQL Database HOT 1
- analyze Not Found HOT 1
- after instalation HOT 2
- Undefined offset: 1 in DBTable.php at line 285 HOT 1
- Jason Hinkle 1970-2016 HOT 5
- Security issue : use hash_equals() instead of '===' to compare hashes
- Show on select many-to-one
- http://192.168.32.10/phreeze/builder/analyze HOT 1
- Foreign key issue
- Problem after builder page HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phreeze.