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
8245
Activity
New Language Model
In that case it's not a language string, so you shouldn't treat it as such. It's an intergral part of the design, it is application data. In this case a product that has descriptions in multiple languages. If it was only a single desc…
Comment by
WanWizard
August 2013
permalink
Type Hints causing 4096 error
Please, no code pastes here, use http://bin.fuelphp.com for that (and post the link instead). Your problem is that you can't typehint "string". So PHP assumes it's a class name, and if you pass a string, it's not an instanc…
Comment by
WanWizard
August 2013
permalink
New Language Model
I'm not in favour of such integration. We have it split in our applications. We work with standard language files, and all developers create the english versions only. We have a backend admin module that can import these into the database, and…
Comment by
WanWizard
August 2013
permalink
PHP 5.5.1 deprecated error
Pushed a fix to 1.7/develop: https://github.com/fuel/core/commit/270ba79b39e93317e88260a162872ea48e8cfb2c
Comment by
WanWizard
August 2013
permalink
Rest controller format / mime type
If you have the REST controller deal with it, your action will return an array which does not have the functionality to add attributes, array's are just key->value. If you want to set a specific return value in your action, use: $this->…
Comment by
WanWizard
August 2013
permalink
[MySQL] DB Joins - Error
You have never been able to pass literals. It expects a field name there, and will escape it for security reasons, which means 1 will become `1`, which fails. You have to encapsulate it in a DB::expr(), to avoid it being escaped: ->join…
Comment by
WanWizard
August 2013
permalink
the db.php file in config/development and the db.php file in confif folder
That doesn't help much, since you've cut out all relevant information. In your controller, do: \Config::load('db', true); var_dump(\Config::get('db')); and post the result on http://bin.fuelphp.com. Add both config/db…
Comment by
WanWizard
August 2013
permalink
the db.php file in config/development and the db.php file in confif folder
Remember that the config/db.php and config/
Comment by
WanWizard
August 2013
permalink
get_one/limit while searching related tables
This ORM is so much cooler... ;-)
Comment by
WanWizard
August 2013
permalink
Theme WSOD
That is exactly how it should, so the problem must be elsewhere. if you do a var_dump($__data) in the partial, you should see everything that is passed to the view.
Comment by
WanWizard
August 2013
permalink
Theme WSOD
Something like http://bin.fuelphp.com/snippet/view/kz Just have your controllers extend it, set the $template property in your controllers to the desired page template, and use \Theme::instance()->set_partial() in your methods to define template…
Comment by
WanWizard
August 2013
permalink
how to make the admin panel in the module
fuel/modules/news/classes/controller/admin/news.php has to be accessed (as in route target) as "news/admin/news/...". There is no way around that. /admin/news doesn't work, because this route converts that to "news/admin", …
Comment by
WanWizard
August 2013
permalink
Upload w/ new name
Problem is that Upload is a Fuel 2 library, and Fuel 2 is PHP 5.4+. Upload itself doesn't really have that requirement. We have to figure that out for the time we're running 2.0 libraries in the 1.x codebase.
Comment by
WanWizard
August 2013
permalink
Routing to a pages module without loosing normal routing
Maybe as a workaround, you could have your (:any) route point to a front controller. It can pick up the URI, check if it maps to something in a module somewhere. If so, fire an HMVC request for the URI, prefixed with the correct module name. If no …
Comment by
WanWizard
August 2013
permalink
Routing to a pages module without loosing normal routing
You can't. "module" is what uniquely idenfies the module (and therefore the location of it's classes folder), and the module namespace. If you get a request for say "/something/", how would that map to a controller cal…
Comment by
WanWizard
August 2013
permalink
Clean input
No. When you handcraft a query, you have to deal with anything yourself. But it is (almost) never needed to do so, the query builder works fine: $result = DB::select() ->from('patients') ->where('username', '…
Comment by
WanWizard
August 2013
permalink
Find empty records on relation
You need a subquery for that. Problem is that ORM currently doesn't have the functionality to generate embedded sub-querys. So you need something like this (from the top of my head): $shifts = \Model_Employee::query() ->related('sh…
Comment by
WanWizard
August 2013
permalink
Security js_fetch_token not returning anything
As you say it is printed, so the method call works. However, it only defines the javascript function, you still have to call it to get the CSRF token back.
Comment by
WanWizard
August 2013
permalink
Clean input
The ORM, like the DB query builder, will fully protect you against SQL injections. You don't need to take any additional action for that. The Framework doesn't clean anything by default. Fuel is build on the principle of "do not modi…
Comment by
WanWizard
August 2013
permalink
get_one/limit while searching related tables
It does produce the correct results, it only doesn't produce the results you want. What you want is: $equipo = \Model_Equipo::query() ->related("promo")->where("promo.id", 1) ->related("colegio")->…
Comment by
WanWizard
August 2013
permalink
Theme WSOD
I'll see if I can add a Theme base controller to the framework, so you don't have to invent the wheel...
Comment by
WanWizard
August 2013
permalink
Theme WSOD
Where are you rendering your template? Easiest is to take a copy of Controller_Template (which is in fuel/core/controller/template.php), swap the View code in there for Theme code, and use that as a base controller for your controllers. In the aft…
Comment by
WanWizard
August 2013
permalink
Upload w/ new name
check in your composer.json which version is speficied. It should say "dev-master".
Comment by
WanWizard
August 2013
permalink
What is most simple way to get Japanese Holidays?
Without knowing the package: it doesn't look like you are supposed to call that method statically, I assume you are supposed to create an instance of the class, like $var = new Date_TimeZone; $isvalid = $var->isValidID();
Comment by
WanWizard
August 2013
permalink
Unable to get relations working, even in same namespace
PHP is a bit quirky when it comes to namespaces. You might want to read http://php.net/manual/en/language.namespaces.php to get up to speed.
Comment by
WanWizard
August 2013
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,422
Last Active
September 6
Roles
Administrator