Welcome Guest, Not a member yet? Register   Sign In
  Get list of available languages
Posted by: Ryubal - 07-21-2021, 01:12 AM - Replies (1)

Hello guys, quick question.

Is there a built-in way to get a list of languages available? Or do I have to go the manual route, by scanning folder names in app/Language?

I'd like to provide a logged-in user with the languages available, so he can choose whichever he wants.


  Namespace or function?
Posted by: superior - 07-21-2021, 12:59 AM - Replies (3)

Hi,

What do you prefer calling other classes, using the namespace like new \App\Model\ModelName or with the function model('App\Model\ModelName') ?
I haven't used this function before and am wondering what is the best approach to this, for me namespaces have more logic (in my head) but maybe someone has an answer for this?


  having a chat widget appear (or not!)
Posted by: richb201 - 07-20-2021, 02:06 PM - Replies (5)

I'd like to offer paying customers premium support. I have a support widget that I plan to use on a system called tawk.to. They advise to embed the following code on the page. 
<!--Start of Tawk.to Script-->

<script type="text/javascript">
var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
(function(){
var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
s1.async=true;
s1.src='https://embed.tawk.to/5fc604b2a1d54c18d8ef211d/default';
s1.charset='UTF-8';
s1.setAttribute('crossorigin','*');
s0.parentNode.insertBefore(s1,s0);
})();
</script>
<!--End of Tawk.to Script-->


Now in my case I am adding the a few lines of HTML at the bottom of every page (see below). Can I just paste the above script onto that page and expect it to display? 
<h1>company</h1>

<p></p>
<a href="https://researchstudytoolkit.tawk.help/category/setting-up-the-research-credit-study-toolkit#company-tab" target="_blank">help on setting up the research study online</a>
<br>
<br>

can I just place the above script here?


  trailing slash misdirects resource controller
Posted by: lukmim - 07-20-2021, 06:43 AM - Replies (2)

when specifying a resource route according to the user guide:

PHP Code:
$routes->resource('photos'); 
the create() controller method is correctly called when POSTing data to /photos, however when a trailing slash is added /photos/ the index() controller method is called instead


adding a route like
PHP Code:
$routes->post('users/''Users::create');
$routes->resource('users'); 
before the resource route doesn't help


  space in quoted string in email is treated as not valid
Posted by: lukmim - 07-20-2021, 02:06 AM - Replies (4)

this is just a tiny nitpick: emails containing spaces in quoted strings are treated by CI4 as not valid (using the "valid_email" validation)

Code:
"Fred Bloggs"@example.com
see https://datatracker.ietf.org/doc/html/rfc3696#section-3


  @deprecated Entity ci4
Posted by: paliz - 07-19-2021, 11:13 AM - Replies (2)

PHP Code:
 i dont know why ci4 team wants  remove this cool  feature of ci4 which make database interaction easier then before  we ll regret for losing such an amazing abllity 

i hope not that happen 

entity  dataMap
[] is super useful for front end framwork
/**
 * Entity encapsulation, for use with CodeIgniter\Model
 ** @deprecated use CodeIgniter\Entity\Entity class instead
 */
class Entity extends CoreEntity
{


  Overwrite file instead create new file
Posted by: pippuccio76 - 07-19-2021, 11:05 AM - Replies (2)

How can i overwrite file instead create new one : 

              if($file->move(WRITEPATH.'/uploads/my_dir/', $newName))


  builder's set() captured by model doesn't support object
Posted by: lukmim - 07-19-2021, 07:51 AM - Replies (1)

The documentation for update() says I can use

PHP Code:
$userModel
    
->whereIn('id', [1,2,3])
    ->set(['active' => 1])
    ->update(); 
and the documentation for $builder->set() says set() also accepts objects, but it appears the set() on models doesn't support objects


  Deploy CI4 on Docker
Posted by: pbd - 07-18-2021, 10:50 AM - No Replies

Hi, I'm new in CI4. I created a simple CI4 project. Now I want to deploy this project on Docker. How could I do this?


  Test file/ image upload
Posted by: Quadralix - 07-18-2021, 01:15 AM - No Replies

Hello,
How can I use http testing for file/ image uploads using post method?


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
Emails has exceeded the m...
by ZoeF
40 minutes ago
Query builder question (C...
by ikesela
1 hour ago
PHP 8 - Mailhog and CI 4....
by Chroma
1 hour ago
I can't validate array in...
by paliz
2 hours ago
Filters and $_POST (or $r...
by Kaosweaver
2 hours ago
inhibiting image download
by InsiteFX
2 hours ago
Codeigniter mentioned in ...
by John_Betong
8 hours ago
How handle errors when in...
by wuuyun
Yesterday, 05:47 PM
Ci4 Developer Wanted
by paliz
Yesterday, 02:06 PM
[ASK] Whatsapp Library on...
by ISSHIKI
Yesterday, 11:48 AM

Forum Statistics
» Members: 25,668
» Latest member: smcintyr
» Forum threads: 73,776
» Forum posts: 360,123

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB