移動し、あなたにも、この時にsystem/core/Loader.php
を見てください、あなたはこのような何か(->view()
関連)
を見ることができ、それがすべてのトリガー
public function __construct()
{
self::$instance =& $this;
foreach (is_loaded() as $var => $class)
{
$this->$var =& load_class($class);
}
$this->load =& load_class('Loader', 'core');
$this->load->initialize();
log_message('info', 'Controller Class Initialized');
}
を得るライン、下に見ることができます
/**
* View Loader
*
* Loads "view" files.
*
* @param string $view View name
* @param array $vars An associative array of data
* to be extracted for use in the view
* @param bool $return Whether to return the view output
* or leave it to the Output class
* @return object|string
*/
public function view($view, $vars = array(), $return = FALSE)
{
return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_prepare_view_vars($vars), '_ci_return' => $return));
}
すべてはCI_controllerから来ます –
あなたはcodeigniterで 'library'を使うことでそれを達成できます。また、あなたが望むものを明確にしてくださいキエフ? –
@Rajeevbbqq私は、codeigniterフレームワークが変数のメソッドをどのように呼び出すかを知ろうとしています。例えば$ this-> loadは可変であり、メソッドを呼び出します。どのようにそれらを実現しましたか?私は内部のメカニズムについて話しています –