Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
WanWizard
a.k.a. WanWizard
Discussions
4
Comments
8242
Activity
Check if a database index exists before creating or dropping
It's in 1.9/dev and not officially released yet I think. I'll add "release changed in dev" to the todo list.
Comment by
WanWizard
August 2017
permalink
Getting nested tree of the result
Use the nestedsets model: https://fuelphp.com/docs/packages/orm/model/nestedset.html. It has all that functionality built-in, and more.
Comment by
WanWizard
August 2017
permalink
Value of select field depend another value of select field.
I told you that wouldn't work. You need a Contoller_Hybrid or Controller_Rest for it. Standard controllers require View rendering, you can't just echo something out.
Comment by
WanWizard
August 2017
permalink
Value of select field depend another value of select field.
No, Fuel doesn't provide anything frontend, as there are 1001 solutions, and everyone has his/her own perference. To create an API, your controller must extend either Controller_Rest (if all actions are APi methods) or Controller_Hybrid (if you…
Comment by
WanWizard
August 2017
permalink
Value of select field depend another value of select field.
That is a frontend operation, requiring javascript to do an ajax call to a rest controller to retrieve the related data based on the selection and after filling the dropdown, enable it. More a jQuery thing than a Fuel thing, and as I don't do f…
Comment by
WanWizard
August 2017
permalink
Session, Flash, Controller Active, Change Controller
That seems logical, that you use different variables for different search operations.
Comment by
WanWizard
August 2017
permalink
Handling errors using Theme class
You can do the same with raw / harcoded javascript. So the answer is: imho No, I always have frontend code in the view, whether it is loaded as a seperate file, or hardcoded/embedded.
Comment by
WanWizard
August 2017
permalink
Is this intentional?
It is not intended, I'm pretty sure it was wriiten when using MySQL, and the author didn't give this issue a moments thought. Please create an issue for it at https://github.com/fuel/auth/issues so it can be addressed.
Comment by
WanWizard
August 2017
permalink
Handling errors using Theme class
If it is hardcoded javascript, specific to that view, why not put it in the view itself? We do things like theme()->asset->css([ 'plugins/bootstrap-datepicker/datepicker.css', 'plugins/bootstrap-datepicker/datepicker3.css…
Comment by
WanWizard
August 2017
permalink
Handling errors using Theme class
Our theme engine does: /** * The 404 action for the application. * * @access public * @parm Exception $e * @return Response */ public function action_404($e = null) { theme()->set_template('templat…
Comment by
WanWizard
August 2017
permalink
Model_CRUD vs ORM
The ORM (at least recent versions) are compatible with that, because the ORM works the other way, it will delete child objects before parent objects, The main power of an ORM, besides the fact you use the data in an object manner, is that it automat…
Comment by
WanWizard
August 2017
permalink
Session, Flash, Controller Active, Change Controller
You don't have to. When the session class loads at the start of a request, all session variables present in flash will be marked expired. In that request, their values will still be available. When the request is finished, the cleanup will dele…
Comment by
WanWizard
August 2017
permalink
Model_CRUD vs ORM
Both the ORM and Model_Crud (a pour-mans-ORM without relations) are not designed to be query builders, for that use the DB class inside your model methods. Having said that, you can just pass your selection in the array: $result = MyModel::find(arra…
Comment by
WanWizard
August 2017
permalink
Even page has changed,want to keep input value for search result pagination
See https://fuelphp.com/docs/classes/session/usage.html#/method_set_flash (and it's compagnion get_flash). When the action is called, and no search value is posted, call get_flash() to see if there is a search value stored in the session, and i…
Comment by
WanWizard
August 2017
permalink
Multiple Apps with a single fuelphp core
You're welcome. We have chosen for this architecture because our apps interact with oneanother via a generic REST api. This allows us to either install 30+ apps on a single VM on a laptop for demo purposes, or scale out to a single app per VM, …
Comment by
WanWizard
August 2017
permalink
Multiple Apps with a single fuelphp core
You can make it as complex as you really want. This is the structure we use for our commercial apps: https://bin.fuelphp.com/snippet/view/OM It requires:changes to the index.php of your apps (APPPATH, COREPATH, VENDORPATH and PKGPATH)adding the glob…
Comment by
WanWizard
August 2017
permalink
ORM, Firebird
Fuel doesn't have a native Firebird driver (mainly because we don't have Firebird databases to test with). You might try the generic PDO driver, and see how far you get. If the SQL language is based on the ANSI standard, I think (most of) …
Comment by
WanWizard
August 2017
permalink
Oil, Scaffolding, Modules, Generate, Admin
If you haven't modified that file, just use the -f flag. Every generate of an admin controller generates the base file, as it is shared between all admin controllers. The error is to make sure it doesn't get overwritted by accident if you …
Comment by
WanWizard
August 2017
permalink
Orm adds quote on query, how to escape that? Please suggest.
Remove the parent call, if your parent class doesn't have an init method. I've copy/pasted this from one of our models, which are have a base-class, might have copied a bit too much. ;-)
Comment by
WanWizard
August 2017
permalink
Oil, Scaffolding, Modules, Generate, Admin
I don't think I understand what your problem is, that all looks fine to me?
Comment by
WanWizard
August 2017
permalink
Orm adds quote on query, how to escape that? Please suggest.
Ah, wait. You can't do that in a property, properties only allow scalar's. Use this instead: protected static $_has_one = array( 'propertydate1' => array( 'key_from' => 'id', 'model_to…
Comment by
WanWizard
August 2017
permalink
Oil, Scaffolding, Modules, Generate, Admin
Generated admin controllers should popup in the generated admin page automatically?
Comment by
WanWizard
August 2017
permalink
Orm adds quote on query, how to escape that? Please suggest.
Have a look at https://fuelphp.com/docs/classes/database/db.html#/method_expr
Comment by
WanWizard
August 2017
permalink
Check if a database index exists before creating or dropping
p.s. This table is defined as: ---- Table structure for table `users_sessionscopes`-- CREATE TABLE `users_sessionscopes` ( `id` int(11) NOT NULL, `session_id` int(11) NOT NULL, `access_token` varchar(50) NOT NULL DEFAULT '', `scope` va…
Comment by
WanWizard
August 2017
permalink
Check if a database index exists before creating or dropping
Which Fuel version are you on? When I do $result = \DB::list_indexes('users_sessionscopes');var_dump($result); which is a table from the Auth package with a few indexes, I get array (size=4) 0 => array (size=8) 'name…
Comment by
WanWizard
August 2017
permalink
More Comments
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
About
Username
WanWizard
Joined
January 2011
Visits
2,366
Last Active
April 29
Roles
Administrator