Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter v4.3.8 and v4.4.0 Released!
#26

(08-28-2023, 06:16 PM)kenjis Wrote: @chaos Did you customize Services for URI or Request?
Since v4.4.0, Services::request()->getUri() must return the SiteURI instance.
https://codeigniter4.github.io/CodeIgnit...ri-changes

Hello any help about this? this piece of code writes in to a database a text. The text is loaded from the database and should show a link to click where one can see a battle report. 

If i use anchor in a view no problem, the assert doesn't fail. However if i use anchor helper in a Model (like in the code below) I have the error displayed below. What am i doing wrong? before it used to work.

CODE


Code:
$characterevent_model->add(1, 'towncrier', "App.event_battleexecuted;". $this->battle['id'] ."," .
anchor("battle/view/{$this->battle['id']}", 'here') . "," .
$this->battle['source']['name'] . "," .
$this->battle['target']['name'] . "," .
$winnertext . "," .
$node['longname'],
'high'
);

ERROR


Code:
assert($currentURI instanceof SiteURI)

at SYSTEMPATH\Helpers\url_helper.php:34

Backtrace:
  1    SYSTEMPATH\Helpers\url_helper.php:34
      assert(false, 'assert($currentURI instanceof SiteURI)')

  2    APPPATH\Models\BattleModel.php:877
      site_url('battle/view/9')
'high'
);
Reply


Messages In This Thread
RE: CodeIgniter v4.3.8 and v4.4.0 Released! - by chaos - 09-06-2023, 08:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB