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
8243
Activity
Presenter and different layouts
Fuel's filesystem is "cascading". It will search the local scope first (in this case the module), and if not found, it will fall back (to app in this case). You can not specify you want to load from the app, if you want that you have…
Comment by
WanWizard
January 2015
permalink
Presenter and different layouts
All Fuel classes are aliased to the global namespace, which is part of the way Fuel extensions work. If you reference the core class directly, you bypass extensions, which make cause your app to break. Some packages no longer work properly, also, al…
Comment by
WanWizard
January 2015
permalink
Presenter and different layouts
Assuming the footer and header are the same on all pages, I would use a base controller for that, that extends Controller_Template So you'll get class Controller_Base extends Controller_Template {} And class Controller_Auth extends Controll…
Comment by
WanWizard
January 2015
permalink
Date format -> for time AGO
If your created_at field is a timestamp (which is the default), there is no need to do all this, you can feed it directly into Date::time_ago(), since that wants a timestamp. Date::time_ago($message->created_at); If it's a MySQL date, you …
Comment by
WanWizard
January 2015
permalink
Update table_through with foreach (user_id field)
Normally you wouldn't need to update the through table, that happens automatically when you update the relations in the many-many. If you have data in your through table, you shouldn't access it through the many-many (you can't), you…
Comment by
WanWizard
January 2015
permalink
How do you handle POST requests in a presenter?
No, that's not true. Models are for business logic, it is a big and very common misunderstanding that because an ORM interacts with a DB, and it's classes are called "Model", that that's it. The standard model class in F…
Comment by
WanWizard
January 2015
permalink
How do you handle POST requests in a presenter?
Not really the way to go. The Presenter is meant for variable prepping for a view, not to process input, and interact with models. Calling it will generate the view associated with it. Which means they are in your applications output path, not inpu…
Comment by
WanWizard
December 2014
permalink
simple question
As far as I can see, this is about coding your own classes. In FuelPHP, you use models to encapsulate your business logic. Models can use custom objects (which should have getters and settings) to encapsulate single data entities, or use Model_Crud…
Comment by
WanWizard
December 2014
permalink
simple question
What do you mean by "encapsulation in your code"?
Comment by
WanWizard
December 2014
permalink
Use select field from within ORM
Code generation currently doesn't support relations, so you'll have to add the dropdowns manually after generation. You're field definition in the model should look like this: 'language' => array( …
Comment by
WanWizard
December 2014
permalink
Reusability of code
FuelPHP has been designed with such re-use in mind. In general, modules are extensions of the application, and packages are extensions of the core. Since an admin panel will have controllers, a module is a more obvious candidate than a package.
Comment by
WanWizard
December 2014
permalink
Caching Whole page
You can't do that there, a controller never has a full view on everything that happens. Not unless you completely redesign your app and use a single front controller. And a before() doesn't have return value, so you can't return a cac…
Comment by
WanWizard
December 2014
permalink
How can I change my mongodb hostname dynamic ?
You can have multiple configurations in your db.php config: 'mongo' => array( 'default' => array( ... ), 'my_instance' => array( ... ), ), And you can add it dynamically if you want: \Config::set(…
Comment by
WanWizard
December 2014
permalink
relation with auth table
Define "not work"? Error messages? Unexpected behavior? If I may guess: the model you define this on contains the column 'user_id', which is the foreign key of this relation. Which means this must be a belongs_to relation, not a…
Comment by
WanWizard
December 2014
permalink
relation with auth table
You have to fully write it out, auto-detection doesn't detect namespaced models. protected static $_has_one = array('user => array( 'model_to' => '\Auth\Model\Auth_User', )'); and other parameters you …
Comment by
WanWizard
December 2014
permalink
OLD PASSWORD IS INVALID -- HELP!
Not if you create accounts using create_user(). It will check for both duplicate email and duplicate username, and will throw an exception if you have a collision.
Comment by
WanWizard
December 2014
permalink
OLD PASSWORD IS INVALID -- HELP!
No, there is nothing I can think of that is server dependent.
Comment by
WanWizard
December 2014
permalink
OLD PASSWORD IS INVALID -- HELP!
No, update_user() will hash it for you. As said, it was made for users changing profile information, it does therefore only work for the current logged-in user.
Comment by
WanWizard
December 2014
permalink
Email not send
Without cURL it's not going to work. Maybe this will give some pointers: http://stackoverflow.com/questions/19335305/composer-install-error-requires-ext-curl-when-its-actualy-enabled
Comment by
WanWizard
December 2014
permalink
Email not send
The default config is in fuel/packages/email/config/email.php. You can copy this to app/config and modify it, or create a new email.php file in app/config with the values you want to override. What do you exactly want? Just to send an email? Or use…
Comment by
WanWizard
December 2014
permalink
OLD PASSWORD IS INVALID -- HELP!
That should work fine if the old password is correct? you get the error if the passed old password is empty(), or if the hash of the old password doesn't match with the hash stored.
Comment by
WanWizard
December 2014
permalink
upload image through .csv file
How would you go about that? A CSV file is a text format, an image is a binary format.
Comment by
WanWizard
December 2014
permalink
Email not send
I think Kenjis refers to the email config file. You need to copy it from the email package to app/config, and then configure it for mailgun.
Comment by
WanWizard
December 2014
permalink
OLD PASSWORD IS INVALID -- HELP!
When doing what? If you try to use the standard update method, it was build for things like user profiles, and it requires the current user password to make sure the data is not tampered with. This is mentioned in the docs. If you want to update i…
Comment by
WanWizard
December 2014
permalink
Do not repeat yourself. So how can I reuse parts of my view?
http://fuelphp.com/docs/classes/view.html#/function_render It is procedural alias for View::forge().
Comment by
WanWizard
December 2014
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,384
Last Active
10:34PM
Roles
Administrator