Jump to content

Recommended Posts

Posted

Looks like you already search for the files, so then you can find the class methods:

$class = "className"
$methods = get_class_methods($class);
Posted
  On 9/10/2014 at 12:00 AM, Tyson said:

Looks like you already search for the files, so then you can find the class methods:

$class = "className"
$methods = get_class_methods($class);

already i'm using this method . but a lot of code ,

$scaned_dir = array_diff(scandir(CONTROLLERDIR), array('..', '.'));

then i have made a regex to rename the file name (admin_client.php --- to AdminClient ) then i use this in the get_class_methods ,

$class_methods = get_class_methods('AdminClient');

foreach ($class_methods as $method_name) {

$result[] = $method_name;

}

all this in side a boucle of result files scan , so there is no built-in function todo this ?

Posted

I don't see a need for all controllers and controller methods to be fetched in/by Blesta.

 

 

  On 9/10/2014 at 12:11 AM, naja7host said:

then i have made a regex to rename the file name (admin_client.php --- to AdminClient ) then i use this in the get_class_methods ,

You could improve that by using Loader::toCamelCase

Posted
  On 9/10/2014 at 12:14 AM, Tyson said:

I don't see a need for all controllers and controller methods to be fetched in/by Blesta.

you will see the need when i will release my new magic plugin soon :)

 

  On 9/10/2014 at 12:14 AM, Tyson said:

You could improve that by using Loader::toCamelCase

this has saved me three like of code :)

EDIT ; still exist a small prob

$controller_name .= Loader::toCamelCase("admin_clients.php");

result

AdminClients.php

what i need just AdminClients

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...