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
Hydrate() error with Model_Temporal
This happens in recent PHP versions when E_STRICT is enabled. Can you replace it by public function hydrate(&$row, $models, \stdClass $result, $model = null, $select = null, $primary_key = null) and let me know if that solves the problem? I…
Comment by
WanWizard
October 2016
permalink
Response 401 in Hybrid Controller
You can't return 401, unless you also return a basic authentication challenge. The RFC says: The server generating a 401 response MUST send a WWW-Authenticate header field1 containing at least one challenge applicable to the target resource. …
Comment by
WanWizard
October 2016
permalink
Response 401 in Hybrid Controller
Most logical is throw new HttpNoAccessException(); A controller renders every returned value, so you can only escape the flow using "throw" or by doing a Response::redirect().
Comment by
WanWizard
October 2016
permalink
Orm\Observer_Typing with Model::query()->get()
The idea behind it is that you can use it to convert a serialized array to an array on read, and serialize it again on write. Or an integer (which some drivers return as string) to an integer and back.
Comment by
WanWizard
October 2016
permalink
Orm\Observer_Typing with Model::query()->get()
No, typing is bi-directional. This suggests you are doing bulk operations using the ORM, which isn't really suited for that, because of this, but also because the hydrating process and the fact all ORM objects are cached (i.e. kept in memory).
Comment by
WanWizard
October 2016
permalink
Different Templates
See http://fuelphp.com/docs/general/controllers/template.html, "Changing the default template file".
Comment by
WanWizard
October 2016
permalink
Trying to get property of non-object [Resolved]
You are sure the post is found? If not, it will go into the "else" branch, and title isn't set.
Comment by
WanWizard
October 2016
permalink
How do I swap out partials
Every section can contain multiple partials, what you do here is just add a second partial to it. If you want to overwrite the sections contents, pass true as third parameter. See http://fuelphp.com/docs/classes/theme/methods.html#/method_set_parti…
Comment by
WanWizard
October 2016
permalink
Token Based Authentication in Single Page App
Yes, easiest is to use the session id as your token, in which case all other Auth functions would work as they would with a standard HTML frontend. See also the answer to your other question.
Comment by
WanWizard
October 2016
permalink
Session Token in Fuelphp
I gather your angular app doesn't handle cookies? You can get the current active session id using \Session::key(). But you have to be careful with this, Fuel updates its sessions in a shutdown event, and it could be that it will rotate the ses…
Comment by
WanWizard
October 2016
permalink
Add a Log level
Fuel uses the Monolog package to do the actual logging. Tnese are the log levels Monolog supports: https://github.com/Seldaek/monolog/blob/master/doc/01-usage.md#log-levels These levels are mapped to Fuel constants: L_DEBUG = 100; L_INFO = 200; L_W…
Comment by
WanWizard
October 2016
permalink
Fresh installation into vhost but styleseet is not rendered
With a screenshot it is difficult to see what exactly happens. It looks like an altered welcome view, but that doesn't use a stylesheet, it uses embedded css.
Comment by
WanWizard
October 2016
permalink
E-mail is not unique?
Yeah, Jelmer was well known for writing complicated code. ;) If you feel up to it, you can always send us a PR against 1.9/develop, code reviews are always welcome. p.s. if you do, don't alter existing migrations, but add a new one if needed.…
Comment by
WanWizard
October 2016
permalink
Trying to get property of non-object [Resolved]
You can even condense that a bit: // make the parameter required so requests without id will fail public function action_view($id) { // make sure $id is a valid positive number before attempting to fetch the post if ($id and ctype_digit($id…
Comment by
WanWizard
October 2016
permalink
Response class not working in SPA
You can't send a 401 back, unless you use basic or digest authentication, and you also send WWW-Authenticate headers back causing the browser to prompt for authentication. Is that what you want? If not, do you just want to set a status, of do…
Comment by
WanWizard
October 2016
permalink
language
Language is already there.
Comment by
WanWizard
October 2016
permalink
language
this is how our app framework does it. We have the 'supported languages' actually in a lang file, since we use that to create a dropdown in the app page header so the user can select another language. The controller action that is called…
Comment by
WanWizard
October 2016
permalink
language
Ok. It isn't the best solution, as it makes it difficult to generate links in the application (which now are language dependent). Using a separate language cookie is a better solution, as you can manage the language selection completely diffe…
Comment by
WanWizard
October 2016
permalink
language
To make sure I understand you, do you want to convert http\\sitename\en\module\controller\action to http\\sitename\module\controller\action and \Lang::set_lang('en'); ?
Comment by
WanWizard
October 2016
permalink
E-mail is not unique?
First, you conclude that the Simpleauth Auth driver does NOT allow you to add duplicate usernames or duplicate email addresses. And then you say that email is not unique and you want to enforce that with an index? Bit of a contradiction, you just sa…
Comment by
WanWizard
October 2016
permalink
E-mail is not unique?
Again, if you want to use it differently from the default behaviour, nothing is stopping you from altering it. You can't please all of the people all of the time. The create_user() method of the Auth package will ensure that both username and …
Comment by
WanWizard
October 2016
permalink
E-mail is not unique?
If you use Auth, you should use Auth to create users, and not use direct database access. It is not a requirement of the user table, we have auth drivers in use that authenticate on username only, so no problem with duplicate emails. The index is j…
Comment by
WanWizard
October 2016
permalink
Upgrading FuelPhp without composer.
Good tip! I use VB for all my development, mainly to test in different environments. I use the feature to map host folders to map the site I am going to test or develop to the document root of the webserver installed in the VM, so I can easily swi…
Comment by
WanWizard
October 2016
permalink
Query builder subquery in join?
Ok.
Comment by
WanWizard
October 2016
permalink
Where is "messages" class located?
The examples in the Auth docs are taken from our application framework, which we use to make apps for our clients. It is not open source I'm afraid. You can find an early version at https://github.com/fuel/depot/tree/1.0/develop/fuel/app/class…
Comment by
WanWizard
October 2016
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,416
Last Active
4:32PM
Roles
Administrator