Welcome Guest, Not a member yet? Register   Sign In
PHXView View Engine...
#3

[eluser]PhoenixPowered[/eluser]
Well it appears that you can call $this->load->phxview or $this->phxview. I missed that piece in the user guide and was following the code of someone else that was loading the library. I guess I'm not sure which way is the "right way" other than what the docs say, so I have changed my controller code in the examples to use $this->phxview. Thanks for catching that inconsistency.

The application/layouts directory is where any layout classes exist. Creating a class here will allow you to seperate your programming so that only programming relevant to your particular action happen in your controller, while programming relevant to your layout happen in the layout class. The data from the controller methods is passed in to the render method just the same as you would pass it in to the load->view method of the base view engine. Once in the layout method if there is an external class the Render method of that class is called and passed the compiled data_array and reference to the view engine.

Code:
$this->phxview->RenderLayout('layout name', $data_array);

As for views in subdirectories, those should work fine using the RenderView method. This is because the RenderView method is little more than a wrapper of $this->load->view('view name', $data, true);. All it does is set the rendered view to a property on the class for later display. While layouts and components will definitely not work with subdirectories, but I could look @ adding that in the future. Should be easy enough.


Messages In This Thread
PHXView View Engine... - by El Forum - 10-28-2007, 10:14 PM
PHXView View Engine... - by El Forum - 10-29-2007, 04:20 AM
PHXView View Engine... - by El Forum - 10-29-2007, 05:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB