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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 14,898
» Latest member: seatransport85
» Forum threads: 70,256
» Forum posts: 361,553

Full Statistics

Latest Threads
auth_override_class_metho...
Forum: Addins
57 minutes ago
» Replies: 1   » Views: 39
Changing the name of a vi...
Forum: Model-View-Controller
1 hour ago
» Replies: 1   » Views: 82
How to catch database ope...
Forum: Model-View-Controller
1 hour ago
» Replies: 7   » Views: 232
Saving data to MYSQL
Forum: Model-View-Controller
1 hour ago
» Replies: 1   » Views: 30
Relations Module
Forum: CodeIgniter 4 Addins
3 hours ago
» Replies: 1   » Views: 347
Call function in model be...
Forum: CodeIgniter 4 Support
7 hours ago
» Replies: 0   » Views: 52
The requested URL was not...
Forum: Issues
7 hours ago
» Replies: 0   » Views: 38
Looking for a developer
Forum: Jobs
8 hours ago
» Replies: 15   » Views: 1,571
validation if_exist
Forum: CodeIgniter 4 Support
11 hours ago
» Replies: 0   » Views: 76
Basic App - Free CMS on C...
Forum: CodeIgniter 4 Addins
Today, 05:07 AM
» Replies: 26   » Views: 6,655

 
  Issues with migration
Posted by: rahulswt7 - Yesterday, 08:03 AM - Forum: CodeIgniter 4 Support - Replies (1)

When I try to add a column in the existing table getting an error.

PHP Code:
<?php namespace App\Database\Migrations;

use 
CodeIgniter\Database\Migration;

class 
AddColumnCreatedAt extends Migration
{
    public function 
up()
    {
        $this->forge->addColumn('users''created_at');
    }

    
//--------------------------------------------------------------------

    
public function down()
    {
        
$this->forge->dropColumn('users''created_at');
    }
}

This is what i am doing

Getting error

Running all 
new migrations... 
PHP Code:
You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2 
PHP Code:
/var/www/html/appstart/vendor/codeigniter4/framework/system/Database/MySQLi/Connection.php 330 


Heart Basic Pagination for the official Tutorial
Posted by: AndreiCurelaru - 11-17-2019, 01:50 PM - Forum: CodeIgniter 4 Feature Requests - No Replies

Hi everybody,

as I see passing questions about pagination and almost every website will need one,
it would be lovely if somebody could spare a few moments and add the *pagination*
to the official news section Tutorial from the Docs.

That's all ^^


  href to display page
Posted by: dmorgan20 - 11-17-2019, 08:00 AM - Forum: Model-View-Controller - Replies (4)

Afternoon,

PHP and code igniter is new to me, so still getting to grips in understanding what does what.

Im using the following HTML: 

Code:
<li><a href="/application/views/appointments/booking.php"><span class=""></span>BOOK NOW</a></li>

Im getting a white blank page.

The file I want to view is in:

- application -> views -> appointments

I assume I need to change some settings somewhere in order to get this functioning but ive no idea where to start


  Help with Encryption library
Posted by: lucaswondir - 11-16-2019, 11:08 PM - Forum: General Help - Replies (1)

Hi, I use encryption library in Codeigniter. But I have a problem with encrypt and decrypt data. I want to encrypt data and can decrypt in any programming language easily. Can you give me some suggestion?


  Migration from 1.7.2 to the latest version 2.2 of CI?.
Posted by: iosman000 - 11-16-2019, 09:30 PM - Forum: General Help - Replies (1)

Hello,

I wanna clarify whether I need to do all steps from the instruction successively (I mean those steps http://www.codeigniter.com/user_guide/in...ading.html) or there is a way to migrate from 1.7.2 to 2.2 directly.
Please advise me.

I have already done the steps regarding v.1.7.2 to 2.0 migration in my project, but I got 503 server error. I can't find out what's wrong with it. I really love CodeIgniter and want to use its latest version for my project further.


thanks
iosman


  Doctrine integration
Posted by: ScientiFist - 11-16-2019, 08:26 PM - Forum: CodeIgniter 4 Support - Replies (7)

Hi,
I'm trying to integrate doctrine 2.6.4 with CI 4.

Doctrine was installed via composer.

App/Libraries/Doctrine.php

Code:
<?php

include_once dirname(__DIR__, 2) . '/vendor/autoload.php';

use Doctrine\Common\ClassLoader;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\Mapping\Driver\YamlDriver;


class Doctrine
{

    public $em;

    public function __construct()
    {


        $connection_options = array(
            'driver'        => 'pdo_mysql',
            'user'            => 'root',
            'password'    => 'password',
            'host'            => 'localhost',
            'dbname'        => 'project',
            'charset'        => 'utf8',
            'driverOptions'    => array(
                'charset'    => 'utf8',
            ),
        );

        $models_namespace = 'Entities';
        $models_path = APPPATH . 'Models';
        $proxies_dir = APPPATH . 'Models/Proxies';
        $metadata_paths = array(APPPATH . 'Models/Entities');

        $dev_mode = true;
        $cache = null;
        $useSimpleAnnotationReader = false;
        $config = Setup::createAnnotationMetadataConfiguration($metadata_paths, $dev_mode, $proxies_dir, $cache, $useSimpleAnnotationReader);
        $this->em = EntityManager::create($connection_options, $config);

        //YAML
        $yamlDriver = new YamlDriver(APPPATH . 'Models/Mappings');
        $config->setMetadataDriverImpl($yamlDriver);
        $loader = new ClassLoader($models_namespace, $models_path);
        $loader->register();
    }

}

App/Doctrine.php
Code:
<?php


define('APPPATH', dirname(__FILE__) . '/');
define('ENVIRONMENT', 'development');

chdir(APPPATH);

require __DIR__ . '/Libraries/Doctrine.php';

foreach ($GLOBALS as $helperSetCandidate) {
    if ($helperSetCandidate instanceof \Symfony\Component\Console\Helper\HelperSet) {
        $helperSet = $helperSetCandidate;
        break;
    }
}

$doctrine = new Doctrine;
$em = $doctrine->em;

$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
    'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
    'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
));

\Doctrine\ORM\Tools\Console\ConsoleRunner::run($helperSet);

Everything is working with the console i can render Entities via YML Mappings so everything is connected to my db and so on

Then i'm just calling doctrine in the Base controller in CI 3 i was using the load->library

Quote:require APPPATH.'/Libraries/Doctrine.php';

And here is the problem i can't initiate the entityManager i tried in different way but im all the time getting a undefined property or undefinedclass :

PHP Code:
<?php namespace App\Controllers;

class 
Home extends BaseController
{


    public function 
index()
    {

         //TEST 1
         $em $this->doctrine->getEntityManager();

         //TEST 2 with the name of my entities
         $test= new DebugTest();

        return 
view('welcome_message');
    }





I know it's maybe complicated or me who's missing something but would be amazing any kind of help, a lot of users of CI are using doctrine as an orm and would really help me for my future project


Question Best way to get which route was called (for Filter classes)
Posted by: AcidSlide - 11-16-2019, 06:52 PM - Forum: CodeIgniter 4 Support - Replies (1)

Hi there,

Can somebody suggest what is the best way to know which route was called from a controller or filter class?

Please don't say use uri_string() as this won't work for projects that uses baseURLs with a subpath.  I want to check (from my before() function in my custom filter) which route (or controller) was being called by the request.

Thanks in advance  Big Grin Big Grin


  HTML Table Class :: showing up as text on view?
Posted by: birdsaloon - 11-16-2019, 12:16 PM - Forum: General Help - Replies (2)

I am playing with the code for CI4 for the first time this weekend, I wanted to get familiar with the HTML class specifically the HTML Table Class.  Using the information on your codeigniter4.github.io site I had tried to make a test page so see how this works with the code below:

Test.php (Controller) below line:

------------------------------------------------------------------------------------------------------------------------------------------------

<?php namespace App\Controllers;

use CodeIgniter\Controller;

helper('array');

class Test extends Controller {

public function index() {

$parser = \Config\Services::parser();
$table = new \CodeIgniter\View\Table();

$template = [
'table_open'            => '<table border="0" cellpadding="4" cellspacing="0">',

'thead_open'            => '<thead>',
'thead_close'          => '</thead>',

'heading_row_start'    => '<tr>',
'heading_row_end'      => '</tr>',
'heading_cell_start'    => '<th>',
'heading_cell_end'      => '</th>',

'tfoot_open'            => '<tfoot>',
'tfoot_close'            => '</tfoot>',

'footing_row_start'      => '<tr>',
'footing_row_end'        => '</tr>',
'footing_cell_start'    => '<td>',
'footing_cell_end'      => '</td>',

'tbody_open'            => '<tbody>',
'tbody_close'          => '</tbody>',

'row_start'            => '<tr>',
'row_end'              => '</tr>',
'cell_start'            => '<td>',
'cell_end'              => '</td>',

'row_alt_start'        => '<tr>',
'row_alt_end'          => '</tr>',
'cell_alt_start'        => '<td>',
'cell_alt_end'          => '</td>',

'table_close'          => '</table>'
];

$table->setTemplate($template);
$table->setHeading('Name', 'Color', 'Size');

$table->addRow('Fred', 'Blue', 'Small');
$table->addRow('Mary', 'Red', 'Large');
$table->addRow('John', 'Green', 'Medium');

$mytable = $table->generate();

$data = [
'table' => $mytable,

];

echo view('templates/topfooter');
echo $parser->setData($data)
->render('test');
echo view('templates/navagation');
}
}


-------------------------------------------------------------------------------------------------------------

And the view as shown below the line:  test.php

-------------------------------------------------------------------------------------------------------------

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
</head>

<body>
<div class="w3-padding w3-display-middle">

{table}

</div>
</body>

</html>



------------------------------------------------------------------------------------------------------------------

The end result I am getting is this:

-------------------------------------------------------------------------------------------------------------------

<table border="0" cellpadding="4" cellspacing="0"> <thead> <tr> <th>Name</th><th>Color</th><th>Size</th></tr> </thead> <tbody> <tr> <td>Fred</td><td>Blue</td><td>Small</td></tr> <tr> <td>Mary</td><td>Red</td><td>Large</td></tr> <tr> <td>John</td><td>Green</td><td>Medium</td></tr> </tbody> </table>

---------------------------------------------------------------------------------------------------------------------

When looking at the page source I am seeing this:

----------------------------------------------------------------------------------------------------------------------

<div class="w3-padding w3-display-middle">

&lt;table border="0" cellpadding="4" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Color&lt;/th&gt;&lt;th&gt;Size&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Fred&lt;/td&gt;&lt;td&gt;Blue&lt;/td&gt;&lt;td&gt;Small&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mary&lt;/td&gt;&lt;td&gt;Red&lt;/td&gt;&lt;td&gt;Large&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;John&lt;/td&gt;&lt;td&gt;Green&lt;/td&gt;&lt;td&gt;Medium&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

</div>


-----------------------------------------------------------------------------------------------------------------------------

Any ideas on what I am doing wrong here?  One thing I can say is when I set the $template array it seems nothing is showing up?  So I think the framework is skipping that all together? 

I appreciate any input -

Chris


  sitemap.xml for auth sites
Posted by: muuucho - 11-16-2019, 07:55 AM - Forum: Best Practices - Replies (5)

I have created a sitemap.xml for a project with an auth system. So far I have just added the pages outside that wall. Is there a way to let crawlers login and crawl on the pages that requires authentication? If so, I like to add that pages in my sitemap. 
I am trying to get an app SEO friendly. 

Eh, not much Codeigniter in there, but what could possibly go wrong by posting to this friendly community?  Angel


  BCIT Contacts?
Posted by: ApexPlatform - 11-16-2019, 12:48 AM - Forum: Lounge - Replies (2)

Hi folks,

Nice to meet you all.  Plan to begin contributing to the CodeIgnighter4 codebase here starting in the next few days.  Already have it downloaded and forked over to my GIthub account, have been through the issues list, and will see what I can do to get my hands dirty with you all.

Anyway, BCIT is the current steward of CodeIgnighter, correct?  Vancouver is in my backyard, so this interests me.  I'm the creator of Apex, and after two years of hard work, finally done at: **REDACTED**

Research pulled a man by name name of James Perry as the CodeIgnighter conact at BCIT, but upon searching him, he works in the transportation technology department of BCIT.  Not sure if he got moved to that dept afterwards, or if he's still the contact, or??

Nonetheless, considering the obvious synergy, would love to get into contact with someone (or multiple people) over at BCIT who are involved with CodeIgnighter.  Any help you could provide would be greatly appreciated.

Thanks,
Matt



  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.