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
FuelPHP and Smarty - Variables not working
You're welcome.
Comment by
WanWizard
July 2016
permalink
Cascade restore does not work
Can you enable the profiler in your config, and enable database profiling in the database config? And then run your code, and post the generated SQL that returns that "5" value?
Comment by
WanWizard
July 2016
permalink
Cascade restore does not work
This is the correct object. I am clueless atm, I don't see how that objects' get() method can ever return a string. You haven't overloaded any query(), get() or get_one() methods in your model? You are using at least v1.8 of Fuel, an…
Comment by
WanWizard
July 2016
permalink
FuelPHP and Smarty - Variables not working
Variables are always local to the view, there is no automatic inheritance of data between views, unless you use global view variables which are available in all views, but that is something that should be avoided if possible.
Comment by
WanWizard
July 2016
permalink
FuelPHP and Smarty - Variables not working
Fixed the extension overload problem: https://github.com/fuel/parser/commit/de6416ede782627621f10e11d2a202dc949298a2 As to the variables, I changed my first test to return Response::forge(View::forge('welcome/index.tpl', array('name…
Comment by
WanWizard
July 2016
permalink
FuelPHP and Smarty - Variables not working
No, that should be ok. Let me see why it doesn't want to use the tpl extension, and if I have a problem passing variables too.
Comment by
WanWizard
July 2016
permalink
Cascade restore does not work
Hmm, ok. It does a get() there on the relation object, which must return either NULL or a model object. Since it returns a value instead, it suggests it does a get() on a model object instead. Can you replace it with: if ( ! is_object($model)) { …
Comment by
WanWizard
July 2016
permalink
FuelPHP and Smarty - Variables not working
Ok. Setup a new test site using the current develop version (shouldn't make a difference compared to your 1.8 in this case). Installed Smarty using "composer require smarty/smarty". Changed the action_index() of the Welcome controlle…
Comment by
WanWizard
July 2016
permalink
FuelPHP and Smarty - Variables not working
Ok, so it doesn't seem like it is parsing the templates at all. It has been years since I've used Smarty, and never used v3. I need to setup a test environment to see if I can reproduce it.
Comment by
WanWizard
July 2016
permalink
Cascade restore does not work
Ok, so it returns the field value rather than the object. This might have to do with the fact that your User model doesn't seen to have a relation definition for the Person model. In ORM, you always have to define the relation both ways, in …
Comment by
WanWizard
July 2016
permalink
FuelPHP and Smarty - Variables not working
And do internal variables work, like {$smarty.now}? i.e. is it a passing of data problem or a Smarty parsing problem?
Comment by
WanWizard
July 2016
permalink
FuelPHP and Smarty - Variables not working
Ah,ok. Have you made any changes to the rest of the default config? // SMARTY ( http://www.smarty.net/documentation ) // ------------------------------------------------------------------------ 'View_Smarty' => array( …
Comment by
WanWizard
July 2016
permalink
FuelPHP and Smarty - Variables not working
You are using the wrong extension. By default, "tpl" is reserved for the Dwoo template engine. To address that, create a parser.php config file, and add: return array( 'extensions' => array( 'dwoo' …
Comment by
WanWizard
July 2016
permalink
Cascade restore does not work
Can you add this line in front of line 238, and tell me the result? if ( ! is_object($model)) { var_dump($model); die(); } It tries to retrieve the related objects there so it can remove their deletedate, but instead of a model object, a string se…
Comment by
WanWizard
July 2016
permalink
remember me function
Like how? That page only shows some config. You need something in your UI (like a checkbox) that indicates the users wants to be remembered. On post of the form, if the checkbox is checked, you need to call the remember-me method. This has a compl…
Comment by
WanWizard
July 2016
permalink
remember me function
Are you using Fuel's Auth package?
Comment by
WanWizard
July 2016
permalink
Using different DB definitions as default
Cool, thanks for the feedback. Expect a hotfix later today.
Comment by
WanWizard
July 2016
permalink
Using different DB definitions as default
Sorry, was trying to type a command I never use from the top of my head. Bad idea. ;-) I pushed a fix: https://github.com/fuel/core/commit/e8f23453e315ee6a0572837bd853e2e5d3d20ee2 Perhaps you can backport it, and see if it solves your problem? If …
Comment by
WanWizard
July 2016
permalink
Regarding log
Log files are generated as PHP files. This line is there to prevent direct access to your logfiles and expose potential internal information in case you have installed FuelPHP inside the docroot, and have not properly secured the log directory.
Comment by
WanWizard
July 2016
permalink
Using different DB definitions as default
Can you check if this works? $res = $db2->query("SELECT * FROM users WHERE status = 1") ->execute() ->as_array(); It is processed differently, so if this gives the same error, I need to come u…
Comment by
WanWizard
July 2016
permalink
Using different DB definitions as default
Ok, thanks, I'll try to work out a solution today.
Comment by
WanWizard
July 2016
permalink
Using different DB definitions as default
If I'm right, this should work: $res = DB::select() ->set_connection($db2) ->from('users') ->where('status', '=', 1) ->execute() …
Comment by
WanWizard
July 2016
permalink
Using different DB definitions as default
Think you bumped into a bug that's there since day 1. execute() does: if ($this->_connection !== null and $db === null) { $db = $this->_connection; } if ( ! is_object($db)) { …
Comment by
WanWizard
July 2016
permalink
Using different DB definitions as default
What Fuel version are you using?
Comment by
WanWizard
July 2016
permalink
Using different DB definitions as default
All static DB calls use Database_Connection::instance() to fetch the DB instance on which the query should be executed. If Database_Connection::instance() is called without parameters, $name will be null, and if ($name === null) {…
Comment by
WanWizard
July 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,368
Last Active
4:01PM
Roles
Administrator