Welcome Guest, Not a member yet? Register   Sign In
Using Viewi and CI4
#11

(This post was last modified: 08-27-2023, 11:23 PM by murugappan. Edit Reason: added the URL format )

(10-17-2022, 03:14 AM)kenjis Wrote: I've update the adapter:
https://github.com/kenjis/ci4-viewi-demo

And created another sample code for the Viewi's tutorial:
https://github.com/kenjis/ci4-viewi-tour-of-heroes

@kenjis I tested the ci4-viewi-demo using  php builtin server and it worked fine. I switched to use xampp  and i found the links menu-bar components do not work. because the file is HTML and i am unable to use the base_url() function. This is sample of the link:

Code:
<li>
    <a href="<?=base_url()?>counter" class="mui--text-light>Counter</a>
</li>

The URL shows "http://localhost/MyCoursesLG/ci4/projects/ci4-viewi-demo/public/<?=base_url()?>counter".

How do we get this to work?
Reply
#12

Code:
<a href="/counter" class="mui--text-light">Counter</a>
Reply
#13

(This post was last modified: 08-28-2023, 02:55 AM by murugappan.)

(08-27-2023, 11:27 PM)kenjis Wrote:
Code:
<a href="/counter" class="mui--text-light">Counter</a>


@kenjis  Its ok I resolved it. It should be interpolated like this:

Code:
<a href="{base_url() . '/counter'}" class="mui--text-light">Counter</a>



Reply
#14

hey,

base_url() is not allowed since there is no such function in javascript and it will throw an error in browser.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB