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
A Detailed Info of Nested Set is Required
Can you be more specific? What exactly do you want to know? Do you understand the principle behind nested sets? If not, read this first, so you get an understanding of how it works: http://www.evanpetersen.com/item/nested-sets.html
Comment by
WanWizard
September 2014
permalink
Bug with ORM?
Can you post the query you have coded, and define the exact outcome you want it to produce?
Comment by
WanWizard
September 2014
permalink
Bug with ORM?
This is standard behaviour of the ORM, when you add relations, as documented. Since the ORM is not about single flattened rows, but about related objects, it always tries to keep resultsets complete, which is why the limit is in the subquery. If yo…
Comment by
WanWizard
September 2014
permalink
Formatting fieldset form
The fieldset generates a complete form, using the template defined in the forms config. This only works with relative simple forms, which bootstrap isn't. There are two options: - use the Fuel v2 Fieldset package - strip the forms config, buil…
Comment by
WanWizard
September 2014
permalink
View parsers with multiple modules
If Fuel, configuration is global, as you have noticed, so this is not the way to approach this. Instead, leave the default view type to "php", and use the extension to identify which template engine you want to use to render the view. Thi…
Comment by
WanWizard
September 2014
permalink
enable CORS on fuelPHP
Assuming you use Controller_Rest to create this functionality: That returns a 405 status if it can't match the request to any method in the controller. Again, assuming with a link like http://event.chart.local/api/vendor/events.json, your con…
Comment by
WanWizard
September 2014
permalink
change fuel core path
VENDORPATH is defined relative to COREPATH: defined('VENDORPATH') or define('VENDORPATH', realpath(COREPATH.'..'.DS.'vendor').DS); So there should be no reason to change this if you have moved the core to an…
Comment by
WanWizard
September 2014
permalink
How do I get the current controller name from a view?
You can retrieve that information from the Request object, or from the Route object which is a property of the Request object. You can get the object using \Request::active(); FuelPHP doesn't have a read-made breadcrumb module, since it('…
Comment by
WanWizard
September 2014
permalink
Module Enable/Disable Auto Codes
No, you define your events yourself. The only predefined events are the ones that the framework itself triggers. For events that need to be available system wide, most people create an events class, and have that "always_load". In the cla…
Comment by
WanWizard
September 2014
permalink
Module Enable/Disable Auto Codes
It's probably best to use the Event class for that, it allows you to add "observer" functionality anywhere you want. Define the events, and the code to run, and trigger the event when a module is enabled, passing details like module …
Comment by
WanWizard
September 2014
permalink
NestedSets: How i Proceed with that
That's very application specific, I can't comment on that. With your second question, you mean add a submenu to an existing menu structure? Yes, the NestedSet model contains all the methods for tree manipulation, including adding nodes or…
Comment by
WanWizard
September 2014
permalink
NestedSets: How i Proceed with that
This is not correct; protected static $_tree = array( 'menu_id' => 'tree_id', // name of the tree node tree index field ); it should be protected static $_tree = array( 'tree_id' =&g…
Comment by
WanWizard
September 2014
permalink
Using Parser Twig in Theme
If you have installed the Twig and the parser package, you only need to specify the extension. View::forge('viewname'); // will load the viewname.php view file if view_ext was set to '.php' View::forge('viewname.twig')…
Comment by
WanWizard
September 2014
permalink
NestedSets: How i Proceed with that
What is the design of the 'menus' table? What is your primary key? Because the error is that you don't give it a value, and there is already a record in place with value 0 (probably from your first save). As with all ORM models, ever…
Comment by
WanWizard
September 2014
permalink
simpleauth security questions
That may be true, but if you have a hacker that gets to that point, you're in serious shit anyway, since both your database and your filesystem are compromised. At which time the hacker has - all usernames, with all password hashes, and all p…
Comment by
WanWizard
September 2014
permalink
Auth session being interrupted by Session::set()
Cool you got it solved. Any idea how large the cookie was? The cookie driver should throw an exception when the cookie is to large, but it's a bit guess work when you encrypt the cookie payload, as that creates a variable length string...
Comment by
WanWizard
September 2014
permalink
I get confused with git repos
The answer is (unfortunately); it depends. First question is, did you install from zip, or by cloning the fuel/fuel repository (manual or through oil install)? If by zip, then you don't have a local repo, so you can just init a new one in you…
Comment by
WanWizard
September 2014
permalink
Nested View in Theme Views using Fuelphp
view() forges a new View object, and returns it. So you pass data any way you can pass data to View::forge(): as an array as second parameter, using the set() method, or the set_safe() method. If you want to pass an individual variable (assuming a…
Comment by
WanWizard
September 2014
permalink
remember me
Yes, it should. The remember-me function is a long-lived cookie based session. https://github.com/fuel/auth/blob/1.8/develop/classes/auth/login/ormauth.php#L38 https://github.com/fuel/auth/blob/1.8/develop/classes/auth/login/simpleauth.php#L33
Comment by
WanWizard
September 2014
permalink
Nested View in Theme Views using Fuelphp
Ah, if your View file is part of a Theme, you can not use View::forge(), you need to use echo Theme::instance()->view('partials/level2/top_nav_notif'); assuming you use the default instance. If you have a named instance, you need to s…
Comment by
WanWizard
September 2014
permalink
Auth session being interrupted by Session::set()
No, and I've never seen that behavior. You're not overwriting the session variables that Auth creates? Our using cookie based sessions, and making your session payload to large?
Comment by
WanWizard
September 2014
permalink
Nested View in Theme Views using Fuelphp
What PHP version are you using? From PHP 5.4 onwards, you can use $this->get() to access variables inside the view. So you can get your second partial using echo View::forge('something')->set('var', $this->get('va…
Comment by
WanWizard
September 2014
permalink
remember me
That is exactly what it does (and nothing more). Some people wanted that to be part of the Auth package, so there you go... ;-)
Comment by
WanWizard
September 2014
permalink
Using Observers to add custom properties to Orm Model to modify the results of ::find()
It's called from the observer class, so it has to be public. And I checked Observer_Self, and it doesn't pass the model object to the event method, like all other observers. Understandable, since you can access the model instance using $t…
Comment by
WanWizard
September 2014
permalink
Using Observers to add custom properties to Orm Model to modify the results of ::find()
If you want to modify the data in the model object after it's been read, you need the 'after_load' event. There are several things wrong with your approach: When using Observer_Self, it calls methods inside the model itself, which m…
Comment by
WanWizard
September 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,399
Last Active
9:41AM
Roles
Administrator