Welcome Guest, Not a member yet? Register   Sign In
BackendPro 0.6.1

[eluser]nooby[/eluser]
i am noob, so please someone tell me how to do simple things... for example... i setup it to my CI engine.. and now want to make controller with some simple function - select from db... i wrote simple class by example

<?php
class Test extends Base_model
{
function Custom_model()
{
// Call parent constructor
parent::Base_model();

// Setup tables
$this->_TABLES = array('Table' => 'test_table');
}
}
?>

put this in controllers folder and named it test.php

now try to open localhost/test/ and see there error
Fatal error: Class 'Base_model' not found blablabla/test.php

help me some one.. i havent find more clearly examples... =(

[eluser]adamp1[/eluser]
@steel_slasher: No it doesn't create dynamic forms since this is a complex operation and for it to be fully customisable its too complicated for what I wanted.

@nooby: I think your getting confused with what a controller and a model is. The class you have extended is a Model and should be in the application/models folder. To create controller you simply need to extend Public_Controller or Admin_Controller depending on what type of controller you want. Once you have the controller created you can call a model class to perform the DB query, and as you have seen extending the Base_model class means you instantly get basic select/insert/update/delete commands.

So you would need something like this

Code:
class Test extends Public_Controller
{
...
CLASS CODE
...
}

[eluser]nooby[/eluser]
ok, thanks! but how do i need then release simple task - select from db, using all this thing. Where i need to write my code? i want this $this->_TABLES = array('Table' => 'complex_table_name'); but still cant understand, how do so, that i could open some url http://localhost/dbscript/ and it print to me contain of table Sad hello world example is working

<?php
class Blog extends Controller {
function index()
{
echo "hello";
}
}
?>
write please simple code to put table contain in output. thanks for that!

[eluser]adamp1[/eluser]
OK, this is what you would do.

First we make are own model to do the DB query
Code:
class My_Model extends Base_Model
{
  function My_Model()
  {
    parent::Base_model();

    $this->_TABLES = array('table' => 'complex table name');
  }
}

So that will allow us to perform basic queries to the database. So now we need a controller which can display the data and which uses the Model.

Code:
class Test extends Public_Controller
{
  function Test()
  {
    parent::Public_Controller();
  }

  function index()
  {
    $this->load->model('My_Model');

    // You can now uses
    // $this->My_Model->select(.....);
    // etc
  }
}

[eluser]nooby[/eluser]
Thank you for so clear explane... its all ok now.. but i find some error.. in file modules/auth/libraries/Userlib.php line 414. there are $data['users']['acive'] = 1; in "none" case, but it must be $data['users']['active'] = 1; i fixed it and it now wokr.. please fix it in next release

and another problem.. login doesnt work, when i dont enable "remember me" checkbox. i dont know the reason... trying to debug your code now... may be you know what it could be? (with cheked "remember me" box all work fine)

[eluser]adamp1[/eluser]
Yes that bug has been fixed in SVN release #120

[eluser]nooby[/eluser]
i dont know, is it was fixed or no, but i find another problem
modules/auth/controllers/admin/acl_permissions.php in function ajax_fetch_actions($group,$resource)

there are need string $this->load->library('khacl');

without it script are not working.

[eluser]adamp1[/eluser]
Thanks added to the TODO.

[eluser]DennisP[/eluser]
Hi,

I've got BackendPro working find except for one thing. On the acl_permissions page, I get a blank screen. I've CHMODDed my logs folder to 0777, and checked my Apache error log (nothing), and my CI error logs. Here's the contents of my CI error log:

Code:
ERROR - 2008-08-29 01:36:27 --&gt; Severity: Notice  --&gt; unserialize() [<a href='function.unserialize'>function.unserialize</a>]: Error at offset 0 of 1 bytes /Users/dennispedrie/Sites/vids/modules/preferences/models/preference_model.php 66
ERROR - 2008-08-29 01:36:27 --&gt; Severity: Notice  --&gt; unserialize() [<a href='function.unserialize'>function.unserialize</a>]: Error at offset 0 of 1 bytes /Users/dennispedrie/Sites/vids/modules/preferences/models/preference_model.php 66
ERROR - 2008-08-29 01:36:27 --&gt; Severity: Notice  --&gt; unserialize() [<a href='function.unserialize'>function.unserialize</a>]: Error at offset 0 of 1 bytes /Users/dennispedrie/Sites/vids/modules/preferences/models/preference_model.php 66

If you could give me a clue what's wrong, I'd appreciate it.

[eluser]tdktank59[/eluser]
Is there a way to assign a group to multiple resources.

From what I can see you can only have global or 1 localized control.

Being able to assign a group say moderators to be able to manage users and create new user groups for example without being able to edit resources and that sort of stuff.

Its limiting at least the way im looking at it. Ive also read the user guide and it says nothing about this.

EDIT: Or is this controlled by actions?




Theme © iAndrew 2016 - Forum software by © MyBB