Welcome Guest, Not a member yet? Register   Sign In
  How integrate XAJAX in CI ??
Posted by: El Forum - 06-21-2007, 06:52 AM - No Replies

[eluser]PoWah[/eluser]
Can someone help with integrating xajax into CI ?
I found article in wiki page about that but it seems to be deprecated, because it is using init/ folder that is deprecated in CI latest versions.

So how shoul the library xajax look like?? Smile


  help with scaffolding on the tutorial
Posted by: El Forum - 06-21-2007, 05:17 AM - No Replies

[eluser]adrian westlake[/eluser]
Hi,

I am new to CI, and just ran through the third tutorial (the AJAX function search) and downloaded the code. I thought I\'d try the scaffolding functionality, so amended the routes.php file, and the application.php file. When the page loads up, there is a warning message at the top.


Code:
A PHP Error was encountered

Severity: Warning

Message: preg_match() expects parameter 2 to be string, array given

Filename: helpers/url_helper.php

Line Number: 93


Anyone know the problem here?

In the routes.php file i added the line:


Code:
$route[\'scaffolding_trigger\'] = \"g6sHjjUUSF7shbH\";


In the constructor of the application.php file I put:


Code:
$this->load->scaffolding(\'functions\');


and to access the scaffolding I typed the url localhost/ci_sample/application/g6sHjjUUSF7shbH

I commented out the other code in the constuctor just in case that was interfering, but no luck...

Any help most gratefully received,

Adrian


  Need help with controller and accessing object
Posted by: El Forum - 06-21-2007, 04:56 AM - No Replies

[eluser]Robert M.[/eluser]
Hi @ all together.

This will be my first time here in the CI Forum. A have a small problem with understading how i can access an result in controller.

I got an error message like \"Trying to get property of non-object\" on line...

I want to do some like this.


Code:
function get_something($some_var){

    $this->load->model(\'some_model\',\'\',TRUE);
    $data[\'query\'] = $this->some_model->get_some_thing($some_var);
    
    if($data[\'query\']->col2==some_value){    //<--this will be the line where i get the error.
        $this->load->view(\'view_1\',$data);
    }else{
        $this->load->view(\'view_2\',$data);
    }
    

}

i know my mistake but i don\'t understand how i can access the value. normally in the view i do some like this

Code:
foreach($query as $row):
echo \"col2: \".$row->col2;

and so on but i want access the vaule in the controller

the function in some_model looks like this...

Code:
function get_some_thing($some_var){

    $this->db->select(\'col1\');
    $this->db->select(\'col2\');
    $this->db->select(\'col3\');
    $this->db->where(\'col1\',$some_var);
    
    $data = $this->db->get(\'some_table\');
    return $data->result();
}


  Tutorials
Posted by: El Forum - 06-21-2007, 03:15 AM - No Replies

"[eluser]aran384[/eluser]\nCode Igniter is a great PHP framework and am really wanting to use this system more, but am having a problem, finding enough tutorials and examples to give me a general understand of how to change normal PHP code into Code Igniter code. \n\nCould anyone please link me to a list of example codes or videos with a decent quality that I can see the code while they are coding. \n\nElliot Haughin has some great videos but I am unable to download them and the the quality of the video from the online screencasts is just not good enough for me to understand the code while he is explaining it...\n\nIf anyone could either reupload the videos else where or direct me to more videos would appreiate it."


  need help in upload file
Posted by: El Forum - 06-21-2007, 02:30 AM - No Replies

"[eluser]java[/eluser]
I planing to construct a page allow visiter can upload muti-file into my database. I have tried but it generated the error in any file. Please tell me how to do it?


  CodeIgniter on exisiting site
Posted by: El Forum - 06-21-2007, 02:06 AM - No Replies

[eluser]emperius[/eluser]
Hello!

I have already made site and I want to use CodeIgniter only for new pages.
How can I do this?


  default controller in sub dir doesnt work
Posted by: El Forum - 06-21-2007, 12:08 AM - No Replies

[eluser]the real rlee[/eluser]
Hi guys not sure this is related to this bug post about sub applications, but i\'ve found i keep getting 404\'s when i set the default_controller to a controller within a subdir. A few echo statements reveals that the class name for the default controller is not getting set properly in Routes.php - it seems to be using the controller path and not the controller name!

Router.php (line 109):

Code:
$this->set_class($this->default_controller);
// is actually setting the class to subdir/controller

And then CodeIgniter.php creates the 404 (line 158):
Code:
$class  = $RTR->fetch_class(); // is subdir/controller
$method = $RTR->fetch_method();
// does a class called \"subdir/controller\" exists - of course not!
if ( ! class_exists($class)
   OR $method == \'controller\'
   OR substr($method, 0, 1) == \'_\'
   OR in_array($method, get_class_methods(\'Controller\'), TRUE)
   )
{


  need help with a mod_rewrite :)
Posted by: El Forum - 06-20-2007, 10:50 PM - No Replies

[eluser]the real rlee[/eluser]
Hi I\'m using the stock CI mod rewrite to get rid of the \"index.php\" at the start of my URI\'s, but i\'d like to extend this rewrite to make the server redirect any request bar user/... main/.. to a specific controller function. The situation is my main website has a number of subsites which look like www.mysite.com.au/joebloggs which needs to be passed to my Sites controller i.e. www.mysite.com.au/joebloggs - > Sites/index/joebloggs.

Your help greatly appreciated!

Code:
# CI needs PATH_INFO
<Files \"index.php\">
AcceptPathInfo On
</Files>

# Check mod_rewrite is enabled
<IfModule mod_rewrite.c>
# Lets remove index.php from URI...
RewriteEngine On\nRewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
# If mod_rewrite isn\'t enabled try and
# forward request to index.php

ErrorDocument 404 index.php

</IfModule>
"


  Noob: Trouble using Models, Parse Errors & The like occur :(
Posted by: El Forum - 06-20-2007, 09:53 PM - No Replies

[eluser]Unknown[/eluser]
I must start off by saying I\'m usually the type to just get really stubborn and figure it out on my own but this time I must admit I really need some help Tongue

Okay so lets get into it. I decided to use CI to code my website because I wanted to create a lean, very simple content managing system. Right now I\'m trying to pull text out of a database and display it on a page. I keep getting PHP Parse errors however, having messed around with it and getting different error messages Tongue
Here\'s what I have now:
Parse error: syntax error, unexpected T_STATIC, expecting T_STRING in [...]/system/application/models/static.php on line 2

Here\'s the code for my Model (it exists in the models folder as static.php):

Code:
&lt;?php
class Static extends Model {

var $content    = \'\';

   function Static()
   {
       parent::Model();
   }
    function show_about_block()
   {
   $sql = \"SELECT content FROM static LIMIT 1\";
    
$this->db->query($sql);
   return $this;
   }
    }
    ?&gt;

I\'m guessing you\'ll need the
controller and the View too so here goes:
Controller (exists in controllers folder as
home.php):
Code:
&lt;?php

class Home extends Controller {

   function Home()
   {
    
parent::Controller();    
   }
   
   function index()
   {
    
$this->load->model(\'static\');
               $data[\'about\'] =
$this->static->show_about_block();
       $this->load->view(\'home_page\', $data);
        
}
}
?&gt;
And Finally View (exists in views folder as
home_page.php):
Code:
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;DeadRinger&lt;/title&gt;
&lt;!--
(REMOVED CSS TO SAVE SPACE IN THIS POST) ->
&lt;/head&gt;
&lt;body&gt;

<h1>DeadRinger Media -
COMING SOON</h1>

<p>Test:</p>

<p>&lt;?php echo $about
?&gt;</p>

&lt;/body&gt;
&lt;/html&gt;

Let me know if you\'ll want information about my
Database too! Thanks so much in advance! I\'ll see if perhaps I can return the favor somehow.

Thanks
again,
Sean"


  Blank page
Posted by: El Forum - 06-20-2007, 09:26 PM - No Replies

[eluser]K-C[/eluser]
I encountered some wierd things.

My CI code is working fine in my local machine but when I upload to the server, some pages are loaded properly and some are just blank page.

Any clue on why such things happen?


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

Username
  

Password
  





Latest Threads
Any user guid or video o...
by msnisha
56 minutes ago
MVC vs MVCS vs CodeIgnite...
by massimiliano1.mancini
5 hours ago
Why PHP is still worth le...
by php_rocs
10 hours ago
Is hiring a digital marke...
by Markhenry123
Today, 02:45 AM
my controller fails to fi...
by PaulC
Today, 01:40 AM
My Library cannot see ses...
by InsiteFX
Yesterday, 08:48 PM
update the framework to t...
by captain-sensible
Yesterday, 12:14 PM
CodeIgniter Shield 1.0.0 ...
by Ayatorvi
Yesterday, 06:06 AM
Update to 4.6.1
by serialkiller
05-07-2025, 11:58 AM
Can't create new database...
by paulbalandan
05-07-2025, 08:49 AM

Forum Statistics
» Members: 144,976
» Latest member: bangalorerussian
» Forum threads: 78,382
» Forum posts: 379,420

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB