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
Login Form not working
What error? The process flow in the controller isn't altered by using another view. In the controller you posted, you only get to that redirect if the request is not for Controller_Admin::login or Controller_Admin::logout, and nobody is logge…
Comment by
WanWizard
October 2013
permalink
How do I download a file, then delete it?
Register a shutdown event that will delete the file after the download has completed, something like: \Event::register('fuel-shutdown', function($data, $arg) { \File::delete($arg); }, $file); then call File::download(). p.s. from the to…
Comment by
WanWizard
October 2013
permalink
Can not delete A file on Tasks
Which means that the possible culprit is DOCROOT. Which means you have to check your index.php to make sure it uses Windows paths instead of Linux paths.
Comment by
WanWizard
October 2013
permalink
Create a pivot table and access it from ORM?
EAV isn't a pivot table, it's an attribute-value container, which means it contains single combinations of an attribute and it's value, and not a list. The attribute is available as virtual property of the model object. So your EAV f…
Comment by
WanWizard
October 2013
permalink
How do I execute dynamic sql (prepared statements)?
If it gives you that error, it will also tell you which part it thinks has the error? DB::query() just passes the code for execution without any modification. I assume the problem is that this string contains multiple SQL commands, the query() met…
Comment by
WanWizard
October 2013
permalink
Can not delete A file on Tasks
If you're on Windows, that path is incorrect, a fully qualified path should start with a drive letter, starting with a / is a linux filesystem. How do you construct the path?
Comment by
WanWizard
October 2013
permalink
calling module method shows wrong
Ah, you call \Honda\Main, but your controller is called Controller_Main. Two different class names, so that is not going to work as I wrote. So it should be \Honda\Controller_Main. But calling classes cross module isn't exactly best practice,…
Comment by
WanWizard
October 2013
permalink
Where clause with many to many related
The number is dependent on the number of joins, so t3 means "the third joined related table in this query". So it is variable, and dependent on how you construct the query.
Comment by
WanWizard
October 2013
permalink
Where clause with many to many related
In a standard many-to-many relation, the through table is there for technical reasons (linking the two tables), but is otherwise invisible. As it doesn't have a relation name, you can't access columns of it in your where clause. It has an…
Comment by
WanWizard
October 2013
permalink
Extending base controller
There is no technical difference between that and Uri::create('themes/bootstrap/css/bootstrap.css'); which I find a bit cleaner. Uri::create() is also more feature rich, so it can generate url's with "fake" extensions if y…
Comment by
WanWizard
October 2013
permalink
calling module method shows wrong
How is your "honda" controller defined? Based on how you call it, it should be namespace Honda; class Main { public static function called() { //do something } } which should be defined in C:\web\fuelphp\fuel\app\modu…
Comment by
WanWizard
October 2013
permalink
Extending base controller
The problem in your views is as I suspected. You use which is a link relative to the CURRENT url (because of the missing leading slash). So on your homepage, it translates to http://mysite/themes/bootstrap/css/bootstrap.css, but on your reg…
Comment by
WanWizard
October 2013
permalink
Save a number of models in one transaction
Yes, by wrapping all your model save's in a DB transaction. See http://docs.fuelphp.com/classes/database/db.html#/transaction
Comment by
WanWizard
October 2013
permalink
Extending base controller
First, if you make a base controller, it's best not to call it Controller_something, and put it in classes/controller. That will make it publicly accessible. It's better to either put it in classes, or in a folder of classes (and change th…
Comment by
WanWizard
October 2013
permalink
How to setup checkbox property to accept 0 or 1 for values
Correct. If you create the form element manually (using Form::checkbox), you will have to deal with the DB value manually as well, for example to use that as the default for Input::post (i.e. if no posted value is present, use the DB value). Somet…
Comment by
WanWizard
October 2013
permalink
How to setup checkbox property to accept 0 or 1 for values
See http://docs.fuelphp.com/classes/form.html#/method_checkbox, you need to pass true as third parameter to check the checkbox, or pass the same value as the fields set value: echo Form::checkbox('coaching', 1, Input::post('coaching&…
Comment by
WanWizard
October 2013
permalink
[OrmAuth] Error when actions = null
This is about revoked rights, so not relevant unless you're talking about that. How do actions work? The permission record defines the possible actions for that permission. For example: array('add', 'edit', 'delete…
Comment by
WanWizard
October 2013
permalink
How do I Unit Test a Controller?
A controller needs access to the request that creates it, so you need to mock that, by creating a dummy request object yourself, and pass that to the constructor.
Comment by
WanWizard
October 2013
permalink
PHPUnit, dependencies and dependency injection
You've hit one of the reasons for redesigning the Fuel architecture for v2. The current architecture doesn't lend itself to being tested. I don't know what your \Model\Category::corporate() does, but it clearly expects a fully funct…
Comment by
WanWizard
October 2013
permalink
Redis class name conflict with PHP extension in 1.5.x
There are two options left if you can't upgrade to 1.7: - disable the Redis PECL package, so you don't have a conflict anymore - implement the change in your 1.5 core (see https://github.com/fuel/core/commit/03a235be4ec8dfb54eb0b55c8c7fa8…
Comment by
WanWizard
October 2013
permalink
[OrmAuth] Error when actions = null
If you use the supplied ORM models to access the tables (userpermission, rolepermission and grouppermission), this will be handled automatically. If you create records manually, you have to make sure all values are stored correctly. If your permiss…
Comment by
WanWizard
October 2013
permalink
Is there a way to know if another user is logged in?
What do you define as "logged in"? Technically it's not possible. A PHP application is stateless, so every request stands on it's own. Only a cookie that's passed back and forth can create state via the session, by for exam…
Comment by
WanWizard
October 2013
permalink
Login Form not working
Check if line 36 does what it should. That if should bypass the redirect on line 49 if this controller's "login" or "logout" action is called. If line 49 is to blame, then something goes wrong there...
Comment by
WanWizard
October 2013
permalink
Login Form not working
I don't get you. You say that the form doesn't submit. So there is nothing to see, no submit means no post means no controller is called... Obviously there's nothing to see then. So why doesn't the form submit? Because there d…
Comment by
WanWizard
October 2013
permalink
Login Form not working
the input one should absolutely submit the form. And the rest of your form looks absolutely fine.
Comment by
WanWizard
October 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,373
Last Active
1:00PM
Roles
Administrator